Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 593784 - <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
Summary: <sys-libs/glibc-2.25-r5 : CFLAGS=-fno-omit-frame-pointer breaks 32-bit x86 bu...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 622316 (view as bug list)
Depends on:
Blocks: glibc-2.25
  Show dependency tree
 
Reported: 2016-09-14 17:27 UTC by hexum
Modified: 2017-10-19 19:24 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
portage info (portage.info,8.80 KB, text/plain)
2016-09-14 17:29 UTC, hexum
Details
build.log.gz (build.log.gz,81.46 KB, application/octet-stream)
2016-09-24 23:44 UTC, hexum
Details
build.log for sys-libs/glibc-2.23-r3 (build.log,69.00 KB, text/plain)
2017-01-12 16:05 UTC, Stefan Sydow
Details
Upstream patch for this issue (glibc.git-3b33d6ed6096c1d20d05a650b06026d673f7399a.patch,12.66 KB, patch)
2017-07-02 04:18 UTC, Matthew Dawson
Details | Diff
emerge --info output (emerge-info.txt,6.76 KB, text/plain)
2017-07-04 18:42 UTC, Richard Ash
Details
Failing build log from sys-libs/glibc-2.23-r4 (sys-libs:glibc-2.23-r4:20170704-183444.log.xz,58.60 KB, application/x-xz)
2017-07-04 18:44 UTC, Richard Ash
Details
Backported patch to 2.23. (fix-bp-cannot-be-used-in-asm-here.patch,4.86 KB, patch)
2017-07-14 20:56 UTC, Martin Kolleck
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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