Gecko: Use stdenv's clang for clang paths.#196
Conversation
| else "${stdenv.cc.cc.lib}/lib"; | ||
|
|
||
| genMozConfig = '' | ||
| cxxLib=$( echo -n ${gcc}/include/c++/* ) |
There was a problem hiding this comment.
I also had to change this -- I got confusing errors which seemed to have to do with clang including GCC headers.
There was a problem hiding this comment.
The problem is that if we do not do that, then I think we default to libstdc++ from LLVM, which never worked for compiling Firefox, as far as I experienced.
There was a problem hiding this comment.
This might be a dumb question, but why not? It seems from https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Linux_Prerequisites#Other_distros_and_other_Unix-based_systems that both gcc and clang are supported.
| # To be used when building the JS Shell. | ||
| export NIX_EXTRA_CONFIGURE_ARGS="--with-libclang-path=${llvmPackages.clang.cc.lib}/lib --with-clang-path=${llvmPackages.clang}/bin/clang" | ||
| export NIX_EXTRA_CONFIGURE_ARGS="--with-libclang-path=${libclang_path}/lib --with-clang-path=${clang_path}" | ||
| cxxLib=$( echo -n ${gcc}/include/c++/* ) |
There was a problem hiding this comment.
I also changed it here. I'm not sure if both were really necessary.
There was a problem hiding this comment.
This is mostly needed for me, where I use this environment variable for only compiling SpiderMonkey using the ./configure $NIX_EXTRA_CONFIGURE_ARGS command line. (more complex in practice, but this is the idea)
| mk_add_options AUTOCONF=${autoconf213}/bin/autoconf | ||
| ac_add_options --with-libclang-path=${llvmPackages.clang.cc.lib}/lib | ||
| ac_add_options --with-clang-path=${llvmPackages.clang}/bin/clang | ||
| ac_add_options --with-libclang-path=${libclang_path}/lib |
There was a problem hiding this comment.
This /lib should be removed, because it ends in /lib/lib else.
There was a problem hiding this comment.
At least when i try to build within nix-shell ../../nixpkgs-overlays/nixpkgs-mozilla/release.nix -A gecko.x86_64-linux.gcc, that is.
| export CXX="${stdenv.cc}/bin/c++"; | ||
| # To be used when building the JS Shell. | ||
| export NIX_EXTRA_CONFIGURE_ARGS="--with-libclang-path=${llvmPackages.clang.cc.lib}/lib --with-clang-path=${llvmPackages.clang}/bin/clang" | ||
| export NIX_EXTRA_CONFIGURE_ARGS="--with-libclang-path=${libclang_path}/lib --with-clang-path=${clang_path}" |
There was a problem hiding this comment.
This one /lib is also extraneous. See above.
This change fixes the issue reported in #191 , by making sure that we use the same clang as the one provided in the
stdenvwhen building Gecko, and when usingbindgen.