INPUT("../../media/psshparser/Unified_cpp_media_psshparser0.o") INPUT("StaticXULComponentsEnd/StaticXULComponentsEnd.o") x86_64-unknown-freebsd/release/libgkrust.a: could not read symbols: File format not recognized c++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[7]: *** [/usr/ports/www/firefox/work/firefox-56.0/config/rules.mk:719: libxul.so] Error 1 gmake[7]: Leaving directory '/usr/ports/www/firefox/work/firefox-56.0/obj-x86_64-unknown-freebsd11.1/toolkit/library' gmake[6]: *** [/usr/ports/www/firefox/work/firefox-56.0/config/recurse.mk:73: toolkit/library/target] Error 2 gmake[6]: Leaving directory '/usr/ports/www/firefox/work/firefox-56.0/obj-x86_64-unknown-freebsd11.1' gmake[5]: *** [/usr/ports/www/firefox/work/firefox-56.0/config/recurse.mk:33: compile] Error 2 gmake[5]: Leaving directory '/usr/ports/www/firefox/work/firefox-56.0/obj-x86_64-unknown-freebsd11.1' gmake[4]: *** [/usr/ports/www/firefox/work/firefox-56.0/config/rules.mk:453: default] Error 2 gmake[4]: Leaving directory '/usr/ports/www/firefox/work/firefox-56.0/obj-x86_64-unknown-freebsd11.1' gmake[3]: *** [/usr/ports/www/firefox/work/firefox-56.0/client.mk:419: realbuild] Error 2 gmake[3]: Leaving directory '/usr/ports/www/firefox/work/firefox-56.0' gmake[2]: *** [/usr/ports/www/firefox/work/firefox-56.0/client.mk:170: build] Error 2 gmake[2]: Leaving directory '/usr/ports/www/firefox/work/firefox-56.0' ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make[1]: stopped in /usr/ports/www/firefox *** Error code 1
> x86_64-unknown-freebsd/release/libgkrust.a: could not read symbols: File format not recognized What FreeBSD version? Can you list selected port options? Can you show output for pkg query '%o: %v'? If ld.bfd is too old try the following: $ pkg install binutils $ export COMPILER_PATH=/usr/local/bin FWIW, pkg-fallout@ didn't complain: http://beefy5.nyi.freebsd.org/data/103i386-default/450797/logs/firefox-56.0,1.log http://beefy6.nyi.freebsd.org/data/103amd64-default/450797/logs/firefox-56.0,1.log http://beefy10.nyi.freebsd.org/data/110i386-default/450797/logs/firefox-56.0,1.log http://beefy9.nyi.freebsd.org/data/110amd64-default/450797/logs/firefox-56.0,1.log
(In reply to Jan Beich from comment #1) Hi Jan, I had the same problem on recent HEAD like Rob described, and can confirm, that $ pkg install binutils $ export COMPILER_PATH=/usr/local/bin solves the problem. Obviously, there is a problem with compiler versions? Thanks for your hint.
I'm seeinx86_64-unknown-freebsd/release/libgkrust.a: could not read symbols: File format not recognized c++: error: linker command failed with exit code 1 (use -v to see invocation) g the same failure on 11.1-STABLE with firefox-56.0 FreeBSD sodalime.pun-pun.prv 11.1-STABLE FreeBSD 11.1-STABLE #20 r322604: Thu Aug 17 18:47:07 JST 2017 devin@sodalime.pun-pun.prv:/usr/obj/usr/src/sys/SODALIME amd64
Created attachment 186783 [details] pkg query output
Yes, I forgot FreeBSD version is 11.1. Port options are the defaults.
I also experienced this: x86_64-unknown-freebsd/release/libgkrust.a: could not read symbols: File format not recognized But setting this environment fixed it: export COMPILER_PATH=/usr/local/bin
Maybe someone from toolchain@ has a clue.
(In reply to Jan Beich from comment #7) There are a lot of clues in the reports. I am almost sure, that the error message comes out because in-tree ld(1) does not know about some relocation type used by some object file included into libgkrust.a. When people install the binutils from ports and set a knob to force use /usr/local/bin/ld, the build finishes successfully because new ld understands this relocation. The solution would be to force use binutils port ld(1) for linking. libgkrust.a is produced by the rust compiler, unless I am wrong. It probably triggers some code generation paths in llvm backend which caused to issue unusual relocations, which typically not created by clang. So the C compilation is not affected and do not trip old linker in base.
Reproduced the problem in poudriere, see http://people.freebsd.org/~pi/logs/firefox-56.0_1,1.log
While I have not encountered the issue, some of the other comments reminded me of bug #220481 (where the ar(1) that was invoked by the gcc5 toolchain is the one found in the execution search path -- not necessarily the one that was part of the gcc5 toolchain).
(In reply to Kurt Jaeger from comment #9) > Reproduced the problem in poudriere, see > > http://people.freebsd.org/~pi/logs/firefox-56.0_1,1.log Can you figure out the location of the bad libgkrust.a file, and run file(1) on it? If it says "thin archive", that will be the cause for the failure.
If it helps. I'm building it from ports and found it only in /usr/ports/www/firefox/work/firefox-56.0/obj-x86_64-unknown-freebsd11.1/toolkit/library/x86_64-unknown-freebsd/release and not on my system. Running 'file' on it returns "current ar archive"
OPTIMIZED_CFLAGS=off adds RUSTFLAGS += -C opt-level=0 but the issue seems limited to --enable-stylo builds (default on amd64) which invoke rust-bindgen (uses libclang.so from devel/llvm40) to integrate Style system from Servo with the rest of Gecko.
OPTIMIZED_CFLAGS=on allows ff 56 to build. Thanks!
(In reply to Kurt Jaeger from comment #14) That did not work for me. Got the same error.
(In reply to Rob Belics from comment #15) Did you build in poudriere or on the main system ?
(In reply to Kurt Jaeger from comment #16) As a data point I build with poudriere and can only build if OPTIMIZED_CFLAGS is enabled (10.3-RELEASE-p21).
(In reply to Dimitry Andric from comment #11) I'm running a testbuild for this right now, with -i to catch the file in question.
(In reply to Kurt Jaeger from comment #16) I use "portmaster -m OPTIMIZED_CFLAGS=on firefox"
(In reply to Rob Belics from comment #19) > I use "portmaster -m OPTIMIZED_CFLAGS=on firefox" That doesn't do anything useful. See bug 170180 for how to override options on command line.
(In reply to Jan Beich from comment #20) I've used it twice fairly recently and it worked. It's also the instructions in the man page for portmaster (the -m part).
Discussing portmaster bugs is off-topic. I'm also biased. Please, use bare build if poudriere is too hard/heavy for you: $ make clean all deinstall install WITH=OPTIMIZED_CFLAGS -C /usr/ports/www/firefox (In reply to Rob Belics from comment #21) > I've used it twice fairly recently and it worked. Placebo? Or did you use a different syntax? > the man page for portmaster (the -m part). Can you quote the relevant part?
(In reply to Jan Beich from comment #22) >Discussing portmaster bugs is off-topic. You brought it up. >Placebo? Or did you use a different syntax? I just quoted what I did. >Can you quote the relevant part? Do "man portmaster" and search in vim with /-m I hope that's not too hard/heavy for you. >make clean all deinstall install WITH=OPTIMIZED_CFLAGS -C /usr/ports/www/firefox I'll try this in an hour or two.
(In reply to Rob Belics from comment #23) >>Can you quote the relevant part? > Do "man portmaster" and search in vim with /-m > I hope that's not too hard/heavy for you. Where did portmaster manpage suggests how to use -m flag to override port options? "portmaster -m WITH=OPTIMIZED_CFLAGS firefox" may have worked as intended.
(In reply to Jan Beich from comment #24) I thought you were complaining about the -m option. This works at upgraded Firefox: "make clean all deinstall install WITH=OPTIMIZED_CFLAGS -C /usr/ports/www/firefox"
(In reply to Kurt Jaeger from comment #18) I was not able to catch the libgkrust file as of now.
I just had this problem too trying to build 57.0_2,1, and was able to overcome it by setting the environment variable COMPILER_PATH to /opt/bin (/opt is what I use for LOCALBASE) and simply rerunning the build -- without cleaning and rebuilding. My options are: # This file is auto-generated by 'make config'. # Options for firefox-57.0_2,1 _OPTIONS_READ=firefox-57.0_2,1 _FILE_COMPLETE_OPTIONS_LIST=BUNDLED_CAIRO CANBERRA DBUS DEBUG DTRACE FFMPEG GCONF INTEGER_SAMPLES LIBPROXY OPTIMIZED_CFLAGS PROFILE TEST ALSA JACK PULSEAUDIO SNDIO OPTIONS_FILE_UNSET+=BUNDLED_CAIRO OPTIONS_FILE_UNSET+=CANBERRA OPTIONS_FILE_SET+=DBUS OPTIONS_FILE_UNSET+=DEBUG OPTIONS_FILE_UNSET+=DTRACE OPTIONS_FILE_SET+=FFMPEG OPTIONS_FILE_UNSET+=GCONF OPTIONS_FILE_UNSET+=INTEGER_SAMPLES OPTIONS_FILE_UNSET+=LIBPROXY OPTIONS_FILE_UNSET+=OPTIMIZED_CFLAGS OPTIONS_FILE_UNSET+=PROFILE OPTIONS_FILE_UNSET+=TEST OPTIONS_FILE_SET+=ALSA OPTIONS_FILE_UNSET+=JACK OPTIONS_FILE_UNSET+=PULSEAUDIO OPTIONS_FILE_UNSET+=SNDIO
A commit references this bug: Author: jbeich Date: Sun Dec 31 00:57:07 UTC 2017 New revision: 457657 URL: https://svnweb.freebsd.org/changeset/ports/457657 Log: www/firefox: unbreak OPTIMIZED_CFLAGS=off build after r450707 x86_64-unknown-freebsd/release/libgkrust.a: could not read symbols: File format not recognized PR: 222641 Reported by: many Changes: head/Mk/bsd.gecko.mk
A commit references this bug: Author: jbeich Date: Sun Dec 31 00:58:13 UTC 2017 New revision: 457658 URL: https://svnweb.freebsd.org/changeset/ports/457658 Log: MFH: r457657 www/firefox: unbreak OPTIMIZED_CFLAGS=off build after r450707 x86_64-unknown-freebsd/release/libgkrust.a: could not read symbols: File format not recognized PR: 222641 Reported by: many Approved by: ports-secteam blanket Changes: _U branches/2017Q4/ branches/2017Q4/Mk/bsd.gecko.mk
OPTIMIZED_CFLAGS=off is still broken on 11.1 i386 because new ld.bfd cannot handle DTRACE=on for some reason. /usr/local/bin/ld: ../../js/src/js-dtrace.o: warning: relocation against `_ZN2js13ExecuteKernelEP9JSContextN2JS6HandleIP8JSScriptEER8JSObjectRKNS2_5ValueENS_16AbstractFramePtrEPS9_' in readonly section `.SUNW_dof' /usr/local/bin/ld: read-only segment has dynamic relocations. build log: https://ptpb.pw/Erv2