Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSet the cpp flag on the cc builder in build.rs #427
Merged
Conversation
|
r? @jdm |
|
@bors-servo r+ |
|
|
bors-servo
added a commit
that referenced
this pull request
May 29, 2018
Set the cpp flag on the cc builder in build.rs
Fixes a build error when cross-compiling from linux to android:
```
CC_armv7-linux-androideabi = None
CC_armv7_linux_androideabi = None
HOST_CC = None
CC = None
CFLAGS_armv7-linux-androideabi = None
CFLAGS_armv7_linux_androideabi = None
HOST_CFLAGS = None
CFLAGS = Some("--sysroot /home/servo/android/ndk/r12b/android-ndk-r12b/platforms/android-18/arch-arm -I/home/servo/android/ndk/r12b/android-ndk-r12b/sources/android/support/include")
running: "arm-linux-androideabi-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "--sysroot" "/home/servo/android/ndk/r12b/android-ndk-r12b/platforms/android-18/arch-arm" "-I/home/servo/android/ndk/r12b/android-ndk-r12b/sources/android/support/include" "-g" "-march=armv7-a" "-march=armv7-a" "-mthumb" "-mfpu=vfpv3-d16" "-mfloat-abi=softfp" "-I" "/home/servo/servo/target/armv7-linux-androideabi/debug/build/mozjs_sys-6ea9cc1d03743689/out/dist/include" "-Wall" "-Wextra" "-fPIC" "-fno-rtti" "-std=c++11" "-include" "/home/servo/servo/target/armv7-linux-androideabi/debug/build/mozjs_sys-6ea9cc1d03743689/out/js/src/js-confdefs.h" "-Wno-c++0x-extensions" "-Wno-return-type-c-linkage" "-Wno-unused-parameter" "-DJS_NO_JSVAL_JSID_STRUCT_TYPES=" "-o" "/home/servo/servo/target/armv7-linux-androideabi/debug/build/mozjs-3864977b9602d849/out/src/jsglue.o" "-c" "src/jsglue.cpp"
cargo:warning=In file included from /home/servo/servo/target/armv7-linux-androideabi/debug/build/mozjs_sys-6ea9cc1d03743689/out/dist/include/mozilla/Attributes.h:12:0,
cargo:warning= from /home/servo/servo/target/armv7-linux-androideabi/debug/build/mozjs_sys-6ea9cc1d03743689/out/dist/include/mozilla/Assertions.h:16,
cargo:warning= from /home/servo/servo/target/armv7-linux-androideabi/debug/build/mozjs_sys-6ea9cc1d03743689/out/dist/include/mozilla/AlreadyAddRefed.h:12,
cargo:warning= from /home/servo/servo/target/armv7-linux-androideabi/debug/build/mozjs_sys-6ea9cc1d03743689/out/dist/include/jsapi.h:12,
cargo:warning= from src/jsglue.cpp:15:
cargo:warning=/home/servo/servo/target/armv7-linux-androideabi/debug/build/mozjs_sys-6ea9cc1d03743689/out/dist/include/mozilla/Compiler.h:49:21: fatal error: cstddef: No such file or directory
cargo:warning= # include <cstddef>
cargo:warning= ^
cargo:warning=compilation terminated.
exit code: 1
```
The error shows that the C compiler chain rather than the C++ compiler chain is being used, even though it's compiling a `.cpp` file.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/427)
<!-- Reviewable:end -->
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
asajeffrey commentedMay 29, 2018
•
edited by larsbergstrom
Fixes a build error when cross-compiling from linux to android:
The error shows that the C compiler chain rather than the C++ compiler chain is being used, even though it's compiling a
.cppfile.This change is