Building mozilla-central with clang + icecream
I tried to build m-c today with clang 5.0 and icecream using the following mozconfig: ``` mk_add_options MOZ_MAKE_FLAGS="-j$(icecc-jobs)" mk_add_options 'export CCACHE_PREFIX=icecc' mk_add_options "export RUSTC_WRAPPER=sccache" export CC=clang export CXX=clang++ ac_add_options --with-ccache ``` The result is an error during config: ``` 0:02.58 checking the target C compiler version... 5.0.0 0:05.91 checking the target C compiler works... no 0:05.91 DEBUG: Creating `/tmp/conftest.oIC8nq.c` with content: 0:05.91 DEBUG: | 0:05.91 DEBUG: | int 0:05.91 DEBUG: | main(void) 0:05.91 DEBUG: | { 0:05.91 DEBUG: | 0:05.91 DEBUG: | ; 0:05.91 DEBUG: | return 0; 0:05.91 DEBUG: | } 0:05.91 DEBUG: Executing: `/usr/bin/ccache /usr/bin/clang -std=gnu99 -c /tmp/conftest.oIC8nq.c` 0:05.91 DEBUG: The command returned non-zero exit status 127. 0:05.91 DEBUG: Its error output was: 0:05.91 DEBUG: | usr/bin/clang: error while loading shared libraries: libLLVM-5.0.so: cannot open shared object file: No such file or directory 0:05.91 DEBUG: | ICECC[8371] 17:45:53: Compiled on 10.251.24.73 0:05.91 ERROR: Failed compiling a simple C source with the target C compiler 0:05.94 *** Fix above errors and then restart with\ 0:05.94"/usr/bin/make -f client.mk build" 0:05.94 make[2]: *** [/projects/mozilla-unified/client.mk:2 ``` I know I can build using gcc+icecream or using clang without icecream, but does anyone know how to combine clang and icecream to make it work? Thanks, zb. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building mozilla-central with clang + icecream
I'm using this setup daily (with clang trunk from some weeks ago, not 5.0, but it's the same really), here is my mozconfig: ``` export CC="icecc clang" export CXX="icecc clang++" mk_add_options MOZ_MAKE_FLAGS="-j100" # adjust, this is good for the paris office mk_add_options 'export RUSTC_WRAPPER=sccache' mk_add_options 'export CARGO_INCREMENTAL=1' ``` Cheers, Paul. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building mozilla-central with clang + icecream
Also sprach p...@paul.cx: I'm using this setup daily (with clang trunk from some weeks ago, not 5.0, but it's the same really), here is my mozconfig: ``` export CC="icecc clang" export CXX="icecc clang++" mk_add_options MOZ_MAKE_FLAGS="-j100" # adjust, this is good for the paris office mk_add_options 'export RUSTC_WRAPPER=sccache' mk_add_options 'export CARGO_INCREMENTAL=1' ``` I use this in the London office: mk_add_options MOZ_MAKE_FLAGS="-j90" mk_add_options 'export RUSTC_WRAPPER=sccache' mk_add_options 'export CCACHE_PREFIX=icecc' export CC=/usr/lib/icecc/bin/cc export CXX=/usr/lib/icecc/bin/c++ But I sense there is opportunity to abstract some of this complexity away in the build system once sccache gets integrated properly. (Is there a plan to make it mandatory? Could it replace ccache for C++?) ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building mozilla-central with clang + icecream
On Tuesday, November 7, 2017 at 2:54:45 AM UTC-8, pa...@paul.cx wrote: > I'm using this setup daily (with clang trunk from some weeks ago, not > 5.0, but it's the same really), here is my mozconfig: > > ``` > export CC="icecc clang" > export CXX="icecc clang++" > mk_add_options MOZ_MAKE_FLAGS="-j100" # adjust, this is good for the > paris office > mk_add_options 'export RUSTC_WRAPPER=sccache' > mk_add_options 'export CARGO_INCREMENTAL=1' > ``` > > Cheers, > Paul. Yeah, tried the same thing and got: ``` 0:02.49 checking yasm version... 1.3.0 0:02.50 checking the target C compiler version... 5.0.0 0:12.70 checking the target C compiler works... no 0:12.70 DEBUG: Creating `/tmp/conftest.E5oBtT.c` with content: 0:12.70 DEBUG: | 0:12.70 DEBUG: | int 0:12.70 DEBUG: | main(void) 0:12.70 DEBUG: | { 0:12.70 DEBUG: | 0:12.70 DEBUG: | ; 0:12.70 DEBUG: | return 0; 0:12.70 DEBUG: | } 0:12.70 DEBUG: Executing: `/usr/bin/ccache icecc /usr/bin/clang -std=gnu99 -c /tmp/conftest.E5oBtT.c` 0:12.70 DEBUG: The command returned non-zero exit status 127. 0:12.70 DEBUG: Its error output was: 0:12.70 DEBUG: | usr/bin/clang: error while loading shared libraries: libLLVM-5.0.so: cannot open shared object file: No such file or directory 0:12.70 DEBUG: | ICECC[8354] 18:03:45: Compiled on 10.251.25.45 0:12.70 ERROR: Failed compiling a simple C source with the target C compiler 0:12.74 *** Fix above errors and then restart with\ 0:12.74"/usr/bin/make -f client.mk build" ``` Maybe it's just the SF Office icecream instance? zb. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building mozilla-central with clang + icecream
On 10/11/2017 10:04 AM, Zibi Braniecki wrot > 0:12.70 DEBUG: | usr/bin/clang: error while loading shared libraries: > libLLVM-5.0.so: cannot open shared object file: No such file or directory Looks like somehow it cannot find libLLVM-5.0.so, probably a distro issue? Probably icecc-create-env can help. It will create a standalone toolchain package: /usr/lib/icecc/icecc-create-env --clang /usr/bin/clang-5.0 /usr/lib/icecc/compiler-wrapper Then export ICECC_VERSION="" in your mozconfig. -- Wei-Cheng Pan ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building mozilla-central with clang + icecream
Unfortunately, that still doesn't make it fly. My mozconfig: ``` ▶ cat .mozconfig mk_add_options MOZ_MAKE_FLAGS="-j$(icecc-jobs)" mk_add_options 'export CCACHE_PREFIX=icecc' mk_add_options "export RUSTC_WRAPPER=sccache" mk_add_options 'export CARGO_INCREMENTAL=1' mk_add_options 'export ICECC_VERSION="/home/zbraniecki/projects/mozilla-unified/380221610b59b33bb654b45d4fedb5ed.tar.gz"' export CC="clang" export CXX="clang++" ac_add_options --with-ccache ac_add_options --enable-optimize="-g -Og" ac_add_options --enable-debug-symbols ac_add_options --enable-debug ``` error log: ``` 0:11.54 checking whether /usr/bin/ccache /usr/bin/g++ -std=gnu++11 accepts -g... (cached) yes 0:11.55 checking for ranlib... (cached) ranlib 0:11.55 checking for as... (cached) /usr/bin/as 0:11.55 checking for ar... (cached) ar 0:11.55 checking for strip... (cached) strip 0:11.55 checking for windres... no 0:11.55 checking for otool... no 0:11.57 checking for X... (cached) libraries /usr/lib64, headers 0:11.57 checking for dnet_ntoa in -ldnet... (cached) no 0:11.57 checking for dnet_ntoa in -ldnet_stub... (cached) no 0:11.57 checking for gethostbyname... (cached) yes 0:11.58 checking for connect... (cached) yes 0:11.58 checking for remove... (cached) yes 0:11.58 checking for shmat... (cached) yes 0:11.58 checking for IceConnectionNumber in -lICE... (cached) yes 0:11.63 configure: error: compiler is incompatible with sanitize options 0:11.63 DEBUG: 0:11.63 DEBUG: configure: In function 'main': 0:11.63 DEBUG: configure:4301:15: error: '__thumb2__' undeclared (first use in this function); did you mean '__unix__'? 0:11.63 DEBUG: configure:4301:15: note: each undeclared identifier is reported only once for each function it appears in 0:11.63 DEBUG: configure: failed program was: 0:11.63 DEBUG: #line 4298 "configure" 0:11.63 DEBUG: #include "confdefs.h" 0:11.63 DEBUG: 0:11.63 DEBUG: int main() { 0:11.63 DEBUG: return sizeof(__thumb2__); 0:11.63 DEBUG: ; return 0; } 0:11.63 DEBUG: configure:5029: /usr/bin/ccache /usr/bin/gcc -std=gnu99 -o conftest -Qunused-arguments conftest.c 1>&5 0:11.63 DEBUG: gcc: error: unrecognized command line option '-Qunused-arguments'; did you mean '-Wunused-parameter'? 0:11.63 DEBUG: configure: failed program was: 0:11.63 DEBUG: #line 5022 "configure" 0:11.63 DEBUG: #include "confdefs.h" 0:11.63 DEBUG: 0:11.63 DEBUG: int main() { 0:11.63 DEBUG: 0:11.63 DEBUG: ; return 0; } 0:11.63 DEBUG: configure: error: compiler is incompatible with sanitize options 0:11.64 ERROR: old-configure failed 0:11.67 *** Fix above errors and then restart with\ 0:11.67"/usr/bin/make -f client.mk build" 0:11.67 make[1]: *** [/projects/mozilla-unified/client.mk:250: configure] Error 1 0:11.67 make: *** [client.mk:263: /projects/mozilla-unified/obj-x86_64-pc-linux-gnu/config.status] Error 2 0:11.71 0 compiler warnings present. 0:11.72 ccache (direct) hit rate: 0.0%; (preprocessed) hit rate: 0.0%; miss rate: 100.0% ``` Any idea what's causing it? I'm on arch. zb. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building mozilla-central with clang + icecream
Hello, On 10/11/2017 06:17, Zibi Braniecki wrote: > 0:11.63 DEBUG: configure:5029: /usr/bin/ccache /usr/bin/gcc -std=gnu99 -o > conftest -Qunused-arguments conftest.c 1>&5 > 0:11.63 DEBUG: gcc: error: unrecognized command line option > '-Qunused-arguments'; did you mean '-Wunused-parameter'? Last time I had this issue, a clobber fixed this problem. Hope this helps, Sylvestre ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building mozilla-central with clang + icecream
Zibi Braniecki writes: > On Tuesday, November 7, 2017 at 2:54:45 AM UTC-8, pa...@paul.cx wrote: >> I'm using this setup daily (with clang trunk from some weeks ago, not >> 5.0, but it's the same really), here is my mozconfig: >> >> ``` >> export CC="icecc clang" >> export CXX="icecc clang++" >> mk_add_options MOZ_MAKE_FLAGS="-j100" # adjust, this is good for the >> paris office >> mk_add_options 'export RUSTC_WRAPPER=sccache' >> mk_add_options 'export CARGO_INCREMENTAL=1' >> ``` >> >> Cheers, >> Paul. > > Yeah, tried the same thing and got: > 0:12.70 DEBUG: Executing: `/usr/bin/ccache icecc /usr/bin/clang -std=gnu99 -c > /tmp/conftest.E5oBtT.c` > 0:12.70 DEBUG: The command returned non-zero exit status 127. > 0:12.70 DEBUG: Its error output was: > 0:12.70 DEBUG: | usr/bin/clang: error while loading shared libraries: > libLLVM-5.0.so: cannot open shared object file: No such file or directory > 0:12.70 DEBUG: | ICECC[8354] 18:03:45: Compiled on 10.251.25.45 Don't know whether this would result in "No such file or directory", or whether the clang and llvm could have been compiled for separate systems, but clang and llvm need to both be compiled with the same C++ ABI, either with C++11 compatibility or not. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building mozilla-central with clang + icecream
> On 7 Nov 2017, at 2:48 am, zbranie...@mozilla.com wrote: > > I tried to build m-c today with clang 5.0 and icecream using the following > mozconfig: > > > ``` > mk_add_options MOZ_MAKE_FLAGS="-j$(icecc-jobs)" > > mk_add_options 'export CCACHE_PREFIX=icecc' > mk_add_options "export RUSTC_WRAPPER=sccache" > > export CC=clang > export CXX=clang++ > > ac_add_options --with-ccache > > ``` Ensure you’re running the latest stable version of icecream. The version shipping with ubuntu in particular is rather old, and there’s a few bugs related to races causing intermittent failure. Those problems have almost all disappeared using icecream 1.1 for me. I still have intermittent build failures however. I often have a ./mach build following a ./mach clobber to completing successfully and restarting the build will then complete with no trouble. so there’s still races out there. I run icecream with clang as compiler… JY ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform