Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 593784

Summary: <sys-libs/glibc-2.25-r5 : CFLAGS=-fno-omit-frame-pointer breaks 32-bit x86 build: compilation error: bp cannot be used in asm here
Product: Gentoo Linux Reporter: hexum <hexumg>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: alexander, eseifert, kingjon3377, matthew, pchrist, richard, spalmroos
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 628180    
Attachments: portage info
build.log.gz
build.log for sys-libs/glibc-2.23-r3
Upstream patch for this issue
emerge --info output
Failing build log from sys-libs/glibc-2.23-r4
Backported patch to 2.23.

Comment 1 hexum 2016-09-14 17:29:20 UTC
Created attachment 445704 [details]
portage info
Comment 2 Panagiotis Christopoulos (RETIRED) gentoo-dev 2016-09-21 07:43:06 UTC
Can you give it a shot with CFLAGS="-O2 -pipe -march=native" and report back if it works?
Comment 3 Tomáš Mózes 2016-09-22 04:40:17 UTC
Please attach the full build log.
Comment 4 hexum 2016-09-24 23:44:09 UTC
Created attachment 447794 [details]
build.log.gz

Original build log with error
Comment 5 hexum 2016-09-24 23:44:15 UTC
CFLAGS="-O2 -pipe -march=native" emerge glibc
compiled without any errors
Comment 6 hexum 2016-09-24 23:49:59 UTC
Option -fno-omit-frame-pointer causes the problem.
Comment 7 Stefan Sydow 2017-01-12 16:05:48 UTC
Created attachment 459786 [details]
build.log for sys-libs/glibc-2.23-r3

sys-libs/glibc-2.23-r3 also breaks with CFLAGS="-march=native -O2 -pipe -fno-omit-frame-pointer -g1"
Comment 8 Martin Kolleck 2017-05-15 14:57:05 UTC
I cannot find any combination of "-fno-omit-frame-pointer", "-fomit-frame-pointer", or none of them in CFLAGS that would allow me to rebuild sys-libs/glibc-2.23-r3 since gcc-5.4 has been stabilized.

For me this affects pure 32-bit systems as well as the 64-bit systems that use multilib x86.
Comment 9 Matthew Dawson 2017-07-02 04:18:59 UTC
Created attachment 479262 [details, diff]
Upstream patch for this issue

It appears this is happening for many glibc users.  Upstream has committed this patch to fix the issue, which let me compile glibc 2.25 + patch using gcc 6.3.  So far everything seems normal on my system, though I'm still upgrading.

It currently doesn't apply to 2.24 or 2.23.  If it would be helpful, I'm happy to take a stab at backporting this patch to those versions.

Note the patch as is won't apply cleanly due to Changelog updates.
Comment 10 Richard Ash 2017-07-04 18:42:11 UTC
Created attachment 480768 [details]
emerge --info output

This is affecting me on stable amd64 multilib with gcc 5.4.0. I have set CFLAGS as requested above and get the same build failure. Attached emerge --info output for info.
Comment 11 Richard Ash 2017-07-04 18:44:21 UTC
Created attachment 480770 [details]
Failing build log from sys-libs/glibc-2.23-r4
Comment 12 Martin Kolleck 2017-07-14 20:56:56 UTC
Created attachment 484678 [details, diff]
Backported patch to 2.23.

Putting this patch in /etc/portage/patches/sys-libs/glibc allowed me to update glibc.

Thanks, Matthew, for finding the original patch.
Comment 13 Richard Ash 2017-07-15 18:30:30 UTC
sys-libs/glibc-2.23-r4 is now stable on amd64 but still exhibits this bug. Patch by Martin works nicely, thank you!

What is the obstacle to getting this into the tree? As stated above, there does not seem to be a known CFLAGS which enables the in-tree ebuild to compile with the current stable GCC (5.4.0). Certainly the suggested flags do not compile.
Comment 14 Andreas K. Hüttel archtester gentoo-dev 2017-09-11 10:01:29 UTC
*** Bug 622316 has been marked as a duplicate of this bug. ***
Comment 15 Andreas K. Hüttel archtester gentoo-dev 2017-09-11 11:31:43 UTC
No go for 2.23, but 2.25 will be stabilized soon. Added the patch to our 2.25 patchset (gentoo/glibc-2.25-9), will be in the next bump if nothing breaks. 

It's included in 2.26 anyway.
Comment 16 Andreas K. Hüttel archtester gentoo-dev 2017-10-19 19:24:13 UTC
Fixed in glibc-2.25-r5