-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gecko: Use stdenv's clang for clang paths. #196
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,14 +109,23 @@ let | |
(if stdenv.isAarch64 then null else rr) | ||
]; | ||
|
||
# bindgen.configure now has a rule to check that with-libclang-path matches CC | ||
# or CXX. Default to the stdenv compiler if we are compiling with clang. | ||
clang_path = | ||
if stdenv.cc.isGNU then "${llvmPackages.clang}/bin/clang" | ||
else "${stdenv.cc}/bin/cc"; | ||
libclang_path = | ||
if stdenv.cc.isGNU then "${llvmPackages.clang.cc.lib}/lib" | ||
else "${stdenv.cc.cc.lib}/lib"; | ||
|
||
genMozConfig = '' | ||
cxxLib=$( echo -n ${gcc}/include/c++/* ) | ||
archLib=$cxxLib/$( ${gcc}/bin/gcc -dumpmachine ) | ||
|
||
cat - > $MOZCONFIG <<EOF | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least when i try to build within |
||
ac_add_options --with-clang-path=${clang_path} | ||
export BINDGEN_CFLAGS="-cxx-isystem $cxxLib -isystem $archLib" | ||
export CC="${stdenv.cc}/bin/cc" | ||
export CXX="${stdenv.cc}/bin/c++" | ||
|
@@ -129,7 +138,7 @@ let | |
export CC="${stdenv.cc}/bin/cc"; | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one |
||
cxxLib=$( echo -n ${gcc}/include/c++/* ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also changed it here. I'm not sure if both were really necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is mostly needed for me, where I use this environment variable for only compiling SpiderMonkey using the |
||
archLib=$cxxLib/$( ${gcc}/bin/gcc -dumpmachine ) | ||
export BINDGEN_CFLAGS="-cxx-isystem $cxxLib -isystem $archLib" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
andclang
are supported.