Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 667224 - www-client/firefox-62.0.2 fails to exec src_configure with USE=clang on arm
Summary: www-client/firefox-62.0.2 fails to exec src_configure with USE=clang on arm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-28 13:05 UTC by tt_1
Modified: 2018-09-30 20:05 UTC (History)
0 users

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


Attachments
compressed build.log (firefox-failed on arm.gz,6.21 KB, application/gzip)
2018-09-28 13:05 UTC, tt_1
Details
output of emerge --info (arm-emerge-info,5.17 KB, text/plain)
2018-09-28 13:06 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2018-09-28 13:05:35 UTC
Created attachment 548108 [details]
compressed build.log

The ebuild claims that there is no working c compiler, thus it shuts down: 

 2:32.80 checking whether the C compiler (/usr/lib/llvm/6/bin/armv7a-unknown-linux-gnueabihf-clang -std=gnu99 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,-rpath=/usr/lib/firefox,--enable-new-dtags -fuse-ld=lld) works... no
 2:32.82 configure: error: installation or configuration problem: C compiler cannot create executables.
 2:32.84 DEBUG: <truncated - see config.log for full output>
 2:32.84 DEBUG: configure:833: checking host system type
 2:32.84 DEBUG: configure:854: checking target system type
 2:32.85 DEBUG: configure:872: checking build system type
 2:32.85 DEBUG: configure:1021: checking for objcopy
 2:32.85 DEBUG: configure:2054: checking for gcc
 2:32.86 DEBUG: configure:2167: checking whether the C compiler (/usr/lib/llvm/6/bin/armv7a-unknown-linux-gnueabihf-clang -std=gnu99 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,-rpath=/usr/lib/firefox,--enable-new-dtags -fuse-ld=lld) works
 2:32.86 DEBUG: configure:2183: /usr/lib/llvm/6/bin/armv7a-unknown-linux-gnueabihf-clang -std=gnu99 -o conftest -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard  -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,-rpath=/usr/lib/firefox,--enable-new-dtags -fuse-ld=lld conftest.c  1>&5
 2:32.86 DEBUG: configure:2180:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
 2:32.86 DEBUG: main(){return(0);}
 2:32.87 DEBUG: ^
 2:32.87 DEBUG: 1 warning generated.
 2:32.87 DEBUG: /usr/bin/ld.lld: error: unknown argument: --reduce-memory-overheads
 2:32.88 DEBUG: clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
 2:32.88 DEBUG: configure: failed program was:
 2:32.88 DEBUG:
 2:32.88 DEBUG: #line 2178 "configure"
 2:32.89 DEBUG: #include "confdefs.h"
 2:32.89 DEBUG:
 2:32.89 DEBUG: main(){return(0);}
 2:32.89 DEBUG: configure: error: installation or configuration problem: C compiler cannot create executables.
 2:32.90 ERROR: old-configure failed
 2:33.17 *** Fix above errors and then restart with\
 2:33.17                "/usr/bin/gmake -f client.mk build"
 2:33.18 gmake: *** [client.mk:127: configure] Error 1
 * ERROR: www-client/firefox-62.0.2::gentoo failed (configure phase):
 *   (no error message)
Comment 1 tt_1 2018-09-28 13:06:32 UTC
Created attachment 548110 [details]
output of emerge --info

my emerge --info

its from a qemu-chroot, but that shouldn't matter.
Comment 2 tt_1 2018-09-28 13:20:26 UTC
here's the problem: 

USE=clang pulls in ld.ldd as the linker to use, but mozcoreconf-v6 has some optimized linkerflags for arm enabled which are only compatible with ld.bfd 

same breakage would happen when ld.gold is choosen, but here its only -Wl,--reduce-memory-overheads being incompatible. 


it should be for ld.bfd: 
append-ldflags -Wl,--no-keep-memory -Wl,--reduce-memory-overheads

for ld.gold:
append-ldflags -Wl,--no-keep-memory

for ld.ldd:
<empty>


ppc64 has a similar optimization for linking, so it should be changed as well. 


Now, since mozcoreconf-v6 already includes toolchain-funcs, I thought of something like:

if use arm; then
 if tc-ld-is-bfd ; then
  append-ldflags -Wl,--no-keep-memory -Wl,--reduce-memory-overheads
 elif tc-ld-is-gold ; then
  append-ldflags -Wl,--no-keep-memory
 fi
fi

(there is no check for tc-ld-is-ldd in the eclass) 

I already tried to get my head around this in a github pullrequest, but ever failing to solve the riddle: https://github.com/gentoo/gentoo/pull/9992

only solution so fare is to remove the whole part for the case of using clang, but that's no proper solution.
Comment 3 tt_1 2018-09-28 13:57:13 UTC
Silly me didn't properly read through the toolchain-funcs eclass. There is no tc-ld-is-bfd neither, only tc-ld-is-gold and its reversion ofc to solve this. 

I'll ask toolchain if they are able and willing to add detection for bfd or ldd, or both, to the the eclass.
Comment 4 Larry the Git Cow gentoo-dev 2018-09-30 20:05:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dd49b494e19472aac612afea0d1540274684419

commit 2dd49b494e19472aac612afea0d1540274684419
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-09-30 19:56:59 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-09-30 20:05:44 +0000

    mozcoreconf-v6.eclass: don't set ldflags lld doesn't support
    
    Closes: https://bugs.gentoo.org/667224
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 eclass/mozcoreconf-v6.eclass | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)