Created attachment 477914 [details] build.log media-libs/libdv-1.0.0-r3 fails during linking when emerging with sys-devel/gcc-7.1.0-r1[pie,ssp] when using the gold linker on an x86 system. The failure does not occur on an amd64 system. According to the error messages, USE=pie of gcc is perhaps related. Adding -fno-PIE -fno-pie -no-pie -fno-stack-protector -fuse-ld=bfd to CFLAGS CXXFLAGS AFLAGS ASFLAGS AMFLAGS LDLAGS or exporting LDFLAGS=/usr/bin/ld.bfd did not help. However, binutils-config --linker ld.bfd did.
Created attachment 477916 [details] emerge.info
Same problem with gcc-6.4.0
The problem with -fuse-ld=bfd not working is that the generated ${WORKDIR}/${P}-abi_x86_32.x86/libtool does not honour CFLAGS wherever it should: After sed -i -e s/compiler_flags=$/compiler_flags=-fuse-ld=bfd/ for that file (once it has been generated in src_configure), compilation runs through.
(In reply to Martin Väth from comment #3) > The problem with -fuse-ld=bfd not working is that the generated > ${WORKDIR}/${P}-abi_x86_32.x86/libtool > does not honour CFLAGS wherever it should: After > sed -i -e s/compiler_flags=$/compiler_flags=-fuse-ld=bfd/ > for that file (once it has been generated in src_configure), > compilation runs through. Tried this and works flawlessly. I had to do this because this package failed at build when I had to change the profile to the 17.1 and then had to rebuilt all /lib32 and /usr/lib32 packages. libdv was the only package failed for me until I did your workaround. Thanks!
(In reply to jorgicio from comment #4) > (In reply to Martin Väth from comment #3) > > The problem with -fuse-ld=bfd not working is that the generated > > ${WORKDIR}/${P}-abi_x86_32.x86/libtool > > does not honour CFLAGS wherever it should: After > > sed -i -e s/compiler_flags=$/compiler_flags=-fuse-ld=bfd/ > > for that file (once it has been generated in src_configure), > > compilation runs through. > > Tried this and works flawlessly. > > I had to do this because this package failed at build when I had to change > the profile to the 17.1 and then had to rebuilt all /lib32 and /usr/lib32 > packages. > libdv was the only package failed for me until I did your workaround. > > Thanks! Similar problem here - but on ~amd64, 17.1, gcc-9.1, gold linker. Again, solution in https://bugs.gentoo.org/622662#c3 fixed things.
Could the fix please be rolled out as an updated ebuild?