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

Bug 666096

Summary: sys-libs/glibc-2.27-r6 `__TMC_END__' can not be used when making a PIE object
Product: Gentoo Linux Reporter: Andreas Westin <gentoo>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: major    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log
emerge --info

Description Andreas Westin 2018-09-12 18:23:53 UTC
Hi,

emerging glibc-2.27-r6 (and -r5) results in a compilation error:

/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/crtbegin.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a PIE object
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: nonrepresentable section on output


Reproducible: Always
Comment 1 Andreas Westin 2018-09-12 18:25:22 UTC
Created attachment 546786 [details]
build log
Comment 2 Andreas Westin 2018-09-12 18:25:45 UTC
Created attachment 546788 [details]
emerge --info
Comment 3 Andreas Westin 2018-09-12 18:27:37 UTC
Just to clarify, this is using a hardened toolchain.
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2018-09-12 19:03:12 UTC
This breakage is caused by explicit mention of -fPIC / -fPIE in CFLAGS:
> CFLAGS="-march=native -O2 -pipe -fPIE -fPIC"

Normally you should hever add those flags to CFLAGS. Previous instance is bug #664340
Comment 5 Andreas Westin 2018-09-12 20:47:14 UTC
Thanks Sergei, that solved the issue. I've had those flags there for a long time, completely forgot about them.