Error when re-compiling libc

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Error when re-compiling libc

Luca-32
Hi all.

I upgraded libc-sources to latest cvs version.
I have a previous libc version installed on the system.

Now when compiling new libc I get the following error:

gcc -B/tools/bin/ ../sysdeps/ieee754/dbl-64/s_signbit.c -c -std=gnu99
-O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -g
-Wstrict-prototypes -mpreferred-stack-boundary=4    -Wno-uninitialized
-D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES -I../include
-I/mnt/sources/libc-build/math -I/mnt/sources/libc-build
-I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686
-I../sysdeps/unix/sysv/linux/i386/i686
-I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386
-I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread
-I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu
-I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet
-I../sysdeps/unix/sysv/i386/i686 -I../sysdeps/unix/sysv/i386
-I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv
-I../sysdeps/unix/i386/i686 -I../sysdeps/unix/i386
-I../nptl/sysdeps/unix -I../libidn/sysdeps/unix -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/i386/i686/fpu
-I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686
-I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu
-I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32
-I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64
-I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754
-I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../libidn
-I.. -I../libio -I. -nostdinc -isystem
/mnt/tools/bin/../lib/gcc/i686-pc-linux-gnu/4.3.0/include -isystem
/tools/include -D_LIBC_REENTRANT -include
../include/libc-symbols.h       -o
/mnt/lfs/sources/libc-build/math/s_signbit.o -MD -MP -MF
/mnt/lfs/sources/libc-build/math/s_signbit.o.dt -MT
/mnt/lfs/sources/libc-build/math/s_signbit.o
../sysdeps/ieee754/dbl-64/s_signbit.c:27: error: redefinition of '__signbit'
../sysdeps/i386/fpu/bits/mathinline.h:135: error: previous definition of
'__signbit' was here
make[2]: *** [/mnt/sources/libc-build/math/s_signbit.o] Error 1
make[1]: *** [math/subdir_lib] Error 2

libc configured in this way:
mkdir libc-build; cd libc-build
../libc/configure --prefix=/tools --enable-profile
--enable-add-ons=nptl,libidn --enable-kernel=2.6.0
--with-binutils=/tools/bin --without-gd --without-selinux
--with-headers=/tools/include

Thanks in advance,
Luca
Reply | Threaded
Open this post in threaded view
|

RE: Error when re-compiling libc

Fred Fish-2

This problem can easily be reproduced with a stripped down copy of the preprocessed source:

    $ cat bug.i
    extern int __signbit (double __value) __attribute__ ((__nothrow__))
         __attribute__ ((__const__));

    extern __inline int
    __attribute__ ((__nothrow__)) __signbit (double __x)
    {
      __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
      return __u.__i[1] < 0;
    }

    int
    __signbit (double x)
    {
    }
    $ gcc -c bug.i
    $ gcc -std=gnu99 -c bug.i
    bug.i:13: error: redefinition of ‘__signbit’
    bug.i:6: error: previous definition of ‘__signbit’ was here
    $

Note that the trigger is the -std=gnu99 option.  Not sure if this error is a bug
in glibc sources or in support for gnu99.

-Fred
Reply | Threaded
Open this post in threaded view
|

Re: Error when re-compiling libc

Luca-32
Fred Fish wrote:

> This problem can easily be reproduced with a stripped down copy of the preprocessed source:
>
>     $ cat bug.i
>     extern int __signbit (double __value) __attribute__ ((__nothrow__))
>          __attribute__ ((__const__));
>
>     extern __inline int
>     __attribute__ ((__nothrow__)) __signbit (double __x)
>     {
>       __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
>       return __u.__i[1] < 0;
>     }
>
>     int
>     __signbit (double x)
>     {
>     }
>     $ gcc -c bug.i
>     $ gcc -std=gnu99 -c bug.i
>     bug.i:13: error: redefinition of ‘__signbit’
>     bug.i:6: error: previous definition of ‘__signbit’ was here
>     $
>
> Note that the trigger is the -std=gnu99 option.  Not sure if this error is a bug
> in glibc sources or in support for gnu99.
>
> -Fred
>
>  
Hi Fred and thanks for the reply.
I found out a patch by Jakub Jelinek about the use of __extern_inline
and __extern_always_inline changes in gcc-4.3.0 (experimental) and
applying it the problem is solved.

Luca
Reply | Threaded
Open this post in threaded view
|

Re: Error when re-compiling libc

Fred Fish-2
In reply to this post by Fred Fish-2
On Saturday 02 December 2006 09:10, Fred Fish wrote:
> Note that the trigger is the -std=gnu99 option.  Not sure if this error is a bug
> in glibc sources or in support for gnu99.

Turns out gcc 4.1.1 as distributed in Fedora Core 6 works fine:

  $ /usr/bin/gcc -std=gnu99 -c bug.i
  $ /usr/bin/gcc -v 2>&1| grep 'gcc version'
  gcc version 4.1.1 20061011 (Red Hat 4.1.1-30)

But a gcc built from current top-of-tree sources does not:

  $ gcc -std=gnu99 -c bug.i
  bug.i:13: error: redefinition of '__signbit'
  bug.i:6: error: previous definition of '__signbit' was here
  $ gcc -v 2>&1| grep 'gcc version'
  gcc version 4.3.0 20061126 (experimental)

-Fred