Bug 25792 - GCC 6.4 can't build glibc with -fno-omit-frame-pointer
Summary: GCC 6.4 can't build glibc with -fno-omit-frame-pointer
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.32
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-06 14:19 UTC by H.J. Lu
Modified: 2020-04-06 19:03 UTC (History)
2 users (show)

See Also:
Host:
Target: i386
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2020-04-06 14:19:25 UTC
/usr/gcc-6.4.1-x32/bin/gcc -m32 ../sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c -c -std=gnu11 -fgnu89-inline  -O2 -g -march=i686 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-definition -fmath-errno  -fno-omit-frame-pointer  -Wa,-mtune=i686   -ftls-model=initial-exec      -I../include -I/export/build/gnu/tools-build/glibc-32bit/build-i686-linux/nptl  -I/export/build/gnu/tools-build/glibc-32bit/build-i686-linux  -I../sysdeps/unix/sysv/linux/i386/i686  -I../sysdeps/i386/i686/nptl  -I../sysdeps/unix/sysv/linux/i386  -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86  -I../sysdeps/x86/nptl  -I../sysdeps/i386/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/i386  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/i386/i686/fpu/multiarch  -I../sysdeps/i386/i686/fpu  -I../sysdeps/i386/i686/multiarch  -I../sysdeps/i386/i686  -I../sysdeps/i386/fpu  -I../sysdeps/x86/fpu  -I../sysdeps/i386  -I../sysdeps/x86  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/float128  -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.   -D_LIBC_REENTRANT -include /export/build/gnu/tools-build/glibc-32bit/build-i686-linux/libc-modules.h -DMODULE_NAME=libpthread -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -o /export/build/gnu/tools-build/glibc-32bit/build-i686-linux/nptl/pthread_mutex_timedlock.o -MD -MP -MF /export/build/gnu/tools-build/glibc-32bit/build-i686-linux/nptl/pthread_mutex_timedlock.o.dt -MT /export/build/gnu/tools-build/glibc-32bit/build-i686-linux/nptl/pthread_mutex_timedlock.o
In file included from ../sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c:22:0:
../nptl/pthread_mutex_timedlock.c: In function ‘__pthread_mutex_clocklock_common’:
../nptl/pthread_mutex_timedlock.c:599:1: error: bp cannot be used in asm here
 }
 ^
Comment 1 Andreas Schwab 2020-04-06 14:53:32 UTC
Does it work with gcc 7?
Comment 2 H.J. Lu 2020-04-06 15:05:07 UTC
GCC 7 and 8 have the same problem.  GCC 9 is OK.
Comment 3 Adhemerval Zanella 2020-04-06 16:27:18 UTC
Which was the configure command? And which is the value of CAN_USE_REGISTER_ASM_EBP on config.h?

I think it might be related to the -Os issues (BZ#25240 and BZ#22581)
Comment 4 H.J. Lu 2020-04-06 16:35:25 UTC
(In reply to Adhemerval Zanella from comment #3)
> Which was the configure command? And which is the value of
> CAN_USE_REGISTER_ASM_EBP on config.h?
> 

config.h:#define CAN_USE_REGISTER_ASM_EBP 0
Comment 5 Adhemerval Zanella 2020-04-06 17:20:11 UTC
It is the expected config.h value for -fno-omit-frame-pointer, but I don't know exactly why it is failing with GCC 6.4.  

At least with gcc 7.5.0 (from ubuntu 18.04) the build does not fail with

configure CC="gcc -m32 -march=i686 -fno-omit-frame-pointer" CXX="g++  -m32 -march=i686 -fno-omit-frame-pointer" --prefix=/usr --build=x86_64-linux-gnu --host=i686-linux-gnu

I will try to build gcc 6.4 and check.
Comment 6 H.J. Lu 2020-04-06 17:24:50 UTC
(In reply to Adhemerval Zanella from comment #5)
> It is the expected config.h value for -fno-omit-frame-pointer, but I don't
> know exactly why it is failing with GCC 6.4.  
> 
> At least with gcc 7.5.0 (from ubuntu 18.04) the build does not fail with
> 
> configure CC="gcc -m32 -march=i686 -fno-omit-frame-pointer" CXX="g++  -m32
> -march=i686 -fno-omit-frame-pointer" --prefix=/usr --build=x86_64-linux-gnu
> --host=i686-linux-gnu
> 
> I will try to build gcc 6.4 and check.

I know what is going on.  It is caused by my patch to remove GCC 5 support.
Comment 7 Adhemerval Zanella 2020-04-06 17:27:13 UTC
(In reply to H.J. Lu from comment #6)
> (In reply to Adhemerval Zanella from comment #5)
> > It is the expected config.h value for -fno-omit-frame-pointer, but I don't
> > know exactly why it is failing with GCC 6.4.  
> > 
> > At least with gcc 7.5.0 (from ubuntu 18.04) the build does not fail with
> > 
> > configure CC="gcc -m32 -march=i686 -fno-omit-frame-pointer" CXX="g++  -m32
> > -march=i686 -fno-omit-frame-pointer" --prefix=/usr --build=x86_64-linux-gnu
> > --host=i686-linux-gnu
> > 
> > I will try to build gcc 6.4 and check.
> 
> I know what is going on.  It is caused by my patch to remove GCC 5 support.

I was about to comment that patch on libc-alpha, we can't remove that code because we need to the CAN_USE_REGISTER_ASM_EBP.
Comment 8 H.J. Lu 2020-04-06 19:03:17 UTC
False alarm.