https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98784

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[8/9/10/11 Regression]      |[8/9/10/11 Regression]
                   |sparcv8 regression          |problematic build of uClibc
                   |                            |with -fPIC

--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> The previous gcc command line was from the busybox build (without -fPIC) but
> this is not busybox that crash... this is the libc.
> 
> See how the libc (uClibc) was built:
> 
> output/host/bin/sparc-buildroot-linux-uclibc-gcc -c libc/stdlib/atoll.c -o
> libc/stdlib/atoll.os -Wall -Wstrict-prototypes -Wstrict-aliasing
> -Wno-nonnull-compare -funsigned-char -fno-builtin -fcommon -fno-asm
> -fmerge-all-constants -std=gnu99 -mcpu=v8 -fno-stack-protector -nostdinc
> -I./include -I./include -include libc-symbols.h -I./libc/sysdeps/linux/sparc
> -I./libc/sysdeps/linux -I./ldso/ldso/sparc -I./ldso/include -I. -Os
> -fstrict-aliasing -D__USE_STDIO_FUTEXES__ -DHAVE_FORCED_UNWIND
> -D_LIBC_REENTRANT -I./libpthread/nptl -I./libpthread/nptl
> -I./libpthread/nptl/sysdeps/unix/sysv/linux/sparc
> -I./libpthread/nptl/sysdeps/sparc -I./libpthread/nptl/sysdeps/sparc
> -I./libpthread/nptl/sysdeps/unix/sysv/linux
> -I./libpthread/nptl/sysdeps/unix/sysv/linux
> -I./libpthread/nptl/sysdeps/pthread -I./libpthread/nptl/sysdeps/pthread/bits
> -I./libpthread/nptl/sysdeps/generic -I./libc/sysdeps/linux/common -isystem
> output/host/lib/gcc/sparc-buildroot-linux-uclibc/10.2.0/include-fixed
> -isystem output/host/lib/gcc/sparc-buildroot-linux-uclibc/10.2.0/include
> -Ioutput/build/linux-headers-5.4.88/usr/include/ -DNDEBUG -DIN_LIB=libc
> -fPIC -MT libc/stdlib/atoll.os -MD -MP -MF libc/stdlib/.atoll.os.dep
> 
> Indeed we have "-fPIC"

OK, this makes sense now and this looks like a bootstrap problem, e.g. the code
setting up _GLOBAL_OFFSET_TABLE_ in the libc might be trying to access it or
something along this line.

Can you find out which module of uClibc sets up _GLOBAL_OFFSET_TABLE_ and
confirm that it is compiled with -fPIC as well?  If so, would it be possible
*not* to compile with -fPIC?

Reply via email to