mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1569370 - add mozconfig fragments for declaring wasm sandboxing bits; r=firefox-build-system-reviewers,rstewart
This patch is not ideal: if would be better to do the defaulting in `toolkit/moz.configure`, but doing it there runs into problems with base toolchain configurations, as the clang there is not new enough. So we have this, doing everything with environment variables, which is easily turned on or off, depending on the needs of the specific configuration. The `mozconfig.no-compile` change is not really needed, as the wasm sandboxing detection bits are not conditional on `--enable-compile-environment`. Those bits should be, and I will tackle doing that after the holidays. Differential Revision: https://phabricator.services.mozilla.com/D58102 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
9b65f62ce1
commit
52c254b0e6
@ -9,6 +9,7 @@ MOZ_REQUIRE_SIGNING=0
|
|||||||
ac_add_options "MOZ_ALLOW_LEGACY_EXTENSIONS=1"
|
ac_add_options "MOZ_ALLOW_LEGACY_EXTENSIONS=1"
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
# ASan specific options on Linux
|
# ASan specific options on Linux
|
||||||
ac_add_options --enable-valgrind
|
ac_add_options --enable-valgrind
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# This file is sourced by the nightly, beta, and release mozconfigs.
|
# This file is sourced by the nightly, beta, and release mozconfigs.
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||||
ac_add_options --with-google-location-service-api-keyfile=/builds/gls-gapi.data
|
ac_add_options --with-google-location-service-api-keyfile=/builds/gls-gapi.data
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
ac_add_options --enable-debug
|
ac_add_options --enable-debug
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
MOZ_AUTOMATION_L10N_CHECK=0
|
MOZ_AUTOMATION_L10N_CHECK=0
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ ac_add_options --enable-debug
|
|||||||
ac_add_options --enable-optimize="-O1"
|
ac_add_options --enable-optimize="-O1"
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
# ASan specific options on Linux
|
# ASan specific options on Linux
|
||||||
ac_add_options --enable-valgrind
|
ac_add_options --enable-valgrind
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
ac_add_options --enable-debug
|
ac_add_options --enable-debug
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
MOZ_AUTOMATION_L10N_CHECK=0
|
MOZ_AUTOMATION_L10N_CHECK=0
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ MOZ_AUTOMATION_CHECK=0
|
|||||||
ac_add_options --enable-debug
|
ac_add_options --enable-debug
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
# Use Clang as specified in manifest
|
# Use Clang as specified in manifest
|
||||||
export CC="$MOZ_FETCHES_DIR/clang/bin/clang"
|
export CC="$MOZ_FETCHES_DIR/clang/bin/clang"
|
||||||
|
@ -7,6 +7,7 @@ MOZ_AUTOMATION_L10N_CHECK=0
|
|||||||
ac_add_options --enable-debug
|
ac_add_options --enable-debug
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
# Use Clang as specified in manifest
|
# Use Clang as specified in manifest
|
||||||
export CC="$MOZ_FETCHES_DIR/clang/bin/clang"
|
export CC="$MOZ_FETCHES_DIR/clang/bin/clang"
|
||||||
|
@ -3,6 +3,7 @@ ac_add_options --disable-debug
|
|||||||
ac_add_options --enable-optimize="-O2 -gline-tables-only"
|
ac_add_options --enable-optimize="-O2 -gline-tables-only"
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
# ASan specific options on Linux
|
# ASan specific options on Linux
|
||||||
ac_add_options --enable-valgrind
|
ac_add_options --enable-valgrind
|
||||||
|
@ -8,6 +8,7 @@ MOZ_REQUIRE_SIGNING=0
|
|||||||
ac_add_options "MOZ_ALLOW_LEGACY_EXTENSIONS=1"
|
ac_add_options "MOZ_ALLOW_LEGACY_EXTENSIONS=1"
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
# ASan specific options on Linux
|
# ASan specific options on Linux
|
||||||
ac_add_options --enable-valgrind
|
ac_add_options --enable-valgrind
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
export TOOLTOOL_DIR="$topsrcdir"
|
export TOOLTOOL_DIR="$topsrcdir"
|
||||||
export LLVM_CONFIG="${MOZ_FETCHES_DIR}/clang/bin/llvm-config"
|
export LLVM_CONFIG="${MOZ_FETCHES_DIR}/clang/bin/llvm-config"
|
||||||
|
|
||||||
|
export WASM_SANDBOXED_LIBRARIES=graphite
|
||||||
|
export LUCETC="${MOZ_FETCHES_DIR}/lucetc/lucetc"
|
||||||
|
export WASI_SYSROOT="${MOZ_FETCHES_DIR}/wasi-sysroot/share/wasi-sysroot"
|
||||||
|
export WASM_CC="${MOZ_FETCHES_DIR}/clang/bin/clang --target=wasm32-wasi"
|
||||||
|
export WASM_CXX="${MOZ_FETCHES_DIR}/clang/bin/clang++ --target=wasm32-wasi"
|
||||||
|
|
||||||
CARGO="${MOZ_FETCHES_DIR}/rustc/bin/cargo"
|
CARGO="${MOZ_FETCHES_DIR}/rustc/bin/cargo"
|
||||||
RUSTC="${MOZ_FETCHES_DIR}/rustc/bin/rustc"
|
RUSTC="${MOZ_FETCHES_DIR}/rustc/bin/rustc"
|
||||||
RUSTDOC="${MOZ_FETCHES_DIR}/rustc/bin/rustdoc"
|
RUSTDOC="${MOZ_FETCHES_DIR}/rustc/bin/rustdoc"
|
||||||
|
@ -3,6 +3,7 @@ ac_add_options --disable-debug
|
|||||||
ac_add_options --enable-optimize="-O2 -gline-tables-only"
|
ac_add_options --enable-optimize="-O2 -gline-tables-only"
|
||||||
|
|
||||||
. $topsrcdir/build/mozconfig.stylo
|
. $topsrcdir/build/mozconfig.stylo
|
||||||
|
. $topsrcdir/build/mozconfig.wasm-sandboxing
|
||||||
|
|
||||||
. $topsrcdir/build/unix/mozconfig.tsan
|
. $topsrcdir/build/unix/mozconfig.tsan
|
||||||
ac_add_options --disable-elf-hack
|
ac_add_options --disable-elf-hack
|
||||||
|
@ -38,3 +38,9 @@ unset AR
|
|||||||
unset NM
|
unset NM
|
||||||
unset RANLIB
|
unset RANLIB
|
||||||
unset NASM
|
unset NASM
|
||||||
|
|
||||||
|
unset WASM_SANDBOXED_LIBRARIES
|
||||||
|
unset WASM_CC
|
||||||
|
unset WASM_CXX
|
||||||
|
unset LUCETC
|
||||||
|
unset WASI_SYSROOT
|
||||||
|
13
build/mozconfig.wasm-sandboxing
Normal file
13
build/mozconfig.wasm-sandboxing
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Tell the build system about bits to build sandboxed wasm libraries.
|
||||||
|
case "$PERFHERDER_EXTRA_OPTIONS" in
|
||||||
|
base-toolchains*)
|
||||||
|
# Clang versions < 8.0 don't support wasm.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
export WASM_SANDBOXED_LIBRARIES=graphite
|
||||||
|
export WASM_CC="${MOZ_FETCHES_DIR}/clang/bin/clang --target=wasm32-wasi"
|
||||||
|
export WASM_CXX="${MOZ_FETCHES_DIR}/clang/bin/clang++ --target=wasm32-wasi"
|
||||||
|
export LUCETC="${MOZ_FETCHES_DIR}/lucetc/lucetc"
|
||||||
|
export WASI_SYSROOT="${MOZ_FETCHES_DIR}/wasi-sysroot/share/wasi-sysroot"
|
||||||
|
;;
|
||||||
|
esac
|
@ -1774,6 +1774,7 @@ def wasm_sandboxing_libraries():
|
|||||||
return ('graphite',)
|
return ('graphite',)
|
||||||
|
|
||||||
option('--with-wasm-sandboxed-libraries',
|
option('--with-wasm-sandboxed-libraries',
|
||||||
|
env='WASM_SANDBOXED_LIBRARIES',
|
||||||
help='Enable wasm sandboxing for the selected libraries',
|
help='Enable wasm sandboxing for the selected libraries',
|
||||||
nargs='+',
|
nargs='+',
|
||||||
choices=dependable(wasm_sandboxing_libraries))
|
choices=dependable(wasm_sandboxing_libraries))
|
||||||
|
Loading…
Reference in New Issue
Block a user