Skip to content

Commit

Permalink
Use cross to compile mmtk-v8
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsoon committed Sep 21, 2022
1 parent 973b6d2 commit 976e347
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/args-debug.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ v8_third_party_heap_files = [
"$the_root/v8/third_party/heap/mmtk/mmtkUpcalls.h",
"$the_root/v8/third_party/heap/mmtk/mmtkUpcalls.cc"
]
v8_third_party_heap_libs = [ "$the_root/mmtk/target/debug/libmmtk_v8.so" ]
v8_third_party_heap_libs = [ "$the_root/mmtk/target/x86_64-unknown-linux-gnu/debug/libmmtk_v8.so" ]
2 changes: 1 addition & 1 deletion .github/scripts/args-optdebug.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ v8_third_party_heap_files = [
"$the_root/v8/third_party/heap/mmtk/mmtkUpcalls.h",
"$the_root/v8/third_party/heap/mmtk/mmtkUpcalls.cc"
]
v8_third_party_heap_libs = [ "$the_root/mmtk/target/debug/libmmtk_v8.so" ]
v8_third_party_heap_libs = [ "$the_root/mmtk/target/x86_64-unknown-linux-gnu/debug/libmmtk_v8.so" ]
11 changes: 10 additions & 1 deletion .github/scripts/build-mmtk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ set -xe

. $(dirname "$0")/common.sh

export PATH=~/.cargo/bin:$PATH
# Check if we have cross available
if ! [ -x "$(command -v cross)" ]; then
echo 'Cross is not available. Will install cross.' >&2
# lock to version 0.2.4. This version uses libc 2.31 for x86_64.
# This matches the version in the sysroot used by V8 (debian bullseye)
cargo install [email protected] --git https://github.com/cross-rs/cross
fi

# simply build mmtk-v8 with nogc
cd $THE_ROOT/mmtk
rustup run $RUSTUP_TOOLCHAIN cargo build --features nogc
cross build --target x86_64-unknown-linux-gnu --features nogc
4 changes: 2 additions & 2 deletions .github/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export THE_ROOT=`realpath $(dirname "$0")/../..`
export V8_ROOT=$THE_ROOT/deps

# Test with a specific revision.
export V8_VERSION=`cargo read-manifest --manifest-path=$THE_ROOT/mmtk/Cargo.toml | python -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["v8"]["v8_version"])'`
export V8_VERSION=`cargo read-manifest --manifest-path=$THE_ROOT/mmtk/Cargo.toml | python3 -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["v8"]["v8_version"])'`
# The commit after this requires python 3.7. This is the only reason we fix to this revision.
export DEPOT_TOOLS_VERSION=`cargo read-manifest --manifest-path=$THE_ROOT/mmtk/Cargo.toml | python -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["v8"]["depot_tools_version"])'`
export DEPOT_TOOLS_VERSION=`cargo read-manifest --manifest-path=$THE_ROOT/mmtk/Cargo.toml | python3 -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["v8"]["depot_tools_version"])'`

export RUSTUP_TOOLCHAIN=`cat $THE_ROOT/mmtk/rust-toolchain`

0 comments on commit 976e347

Please sign in to comment.