https://patchwork.openembedded.org/patch/118909/
Created attachment 445704 [details] portage info
Can you give it a shot with CFLAGS="-O2 -pipe -march=native" and report back if it works?
Please attach the full build log.
Created attachment 447794 [details] build.log.gz Original build log with error
CFLAGS="-O2 -pipe -march=native" emerge glibc compiled without any errors
Option -fno-omit-frame-pointer causes the problem.
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"
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.
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.
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.
Created attachment 480770 [details] Failing build log from sys-libs/glibc-2.23-r4
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.
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.
*** Bug 622316 has been marked as a duplicate of this bug. ***
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.
Fixed in glibc-2.25-r5