Attempting to build from https://github.com/MrAlex94/Waterfox/commit/af8d60305611159dea4ca8fbf36fa532151f8c5d (gecko68 branch) fails with this error -
toolkit/library/libxul.so
../../dom/media/ipc/RDDChild.o: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/media/gecko/waterfox/Waterfox/config/rules.mk:667: recipe for target 'libxul.so' failed
make[5]: *** [libxul.so] Error 1
/media/gecko/waterfox/Waterfox/config/recurse.mk:74: recipe for target 'toolkit/library/target' failed
make[4]: *** [toolkit/library/target] Error 2
/media/gecko/waterfox/Waterfox/config/recurse.mk:32: recipe for target 'compile' failed
make[3]: *** [compile] Error 2
/media/gecko/waterfox/Waterfox/config/rules.mk:400: recipe for target 'default' failed
make[2]: *** [default] Error 2
client.mk:125: recipe for target 'build' failed
make[1]: *** [build] Error 2
Building on Xubuntu 18.04 64-bit, with clang 8.0.1 + nodejs 12.1.0 + rust 1.34.1
Remove --enable-lto and it should fix it.
May need to remove this for Linux, or switch the linker.
Success! Adding ac_add_options --disable-lto to my mozconfig customisations got it to build. Thanks!
@laniakea64 @MrAlex94 LTO needs more open files, just do ulimit -n 4096 and it will work :smile:.
LTO needs more open files, just do
ulimit -n 4096and it will work :smile:.
@hawkeye116477 Where would I put that code? Is it to be added to mozconfig (and if so how?), or is it a shell command to run before starting the build?
@laniakea64 It's a shell command to run before starting the build.
@hawkeye116477 Thanks for your help, I was able to successfully build leaving --enable-lto! :smiley:
The shell command alone wasn't enough. Build spewed more errors than I've ever seen anything spew. So I looked at hawkeye116477's mozconfig, based on that I tried adding these lines to my mozconfig customisations -
# Unbreak building with LTO
export AR=llvm-ar
export NM=llvm-nm
export RANLIB=llvm-ranlib
And that (plus the shell command) got build with --enable-lto working. :+1:
Are all three mozconfig lines needed to unbreak build?
(Note for other readers: I also set export PATH="/usr/lib/llvm-8/bin:$PATH" before starting the build)
@MrAlex94 Could you please reopen this issue until the in-tree mozconfig is fixed for Linux?
Fixed by https://github.com/MrAlex94/Waterfox/pull/1378 :tada:
Most helpful comment
@laniakea64 It's a shell command to run before starting the build.