diff --git a/config/rules.mk b/config/rules.mk index ab0bc251da0d..5abfcc17936a 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -501,7 +501,7 @@ $(LIBRARY): $(OBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS) $(WASM_ARCHIVE): $(CWASMOBJS) $(CPPWASMOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS) $(REPORT_BUILD_VERBOSE) $(RM) $(WASM_ARCHIVE) - $(WASM_CXX) -o $@ -Wl,--export-all -Wl,--stack-first -Wl,-z,stack-size=$(if $(MOZ_OPTIMIZE),262144,1048576) -Wl,--no-entry -Wl,--growable-table $(CWASMOBJS) $(CPPWASMOBJS) + $(WASM_CXX) $(OUTOPTION)$@ -Wl,--export-all -Wl,--stack-first -Wl,-z,stack-size=$(if $(MOZ_OPTIMIZE),262144,1048576) -Wl,--no-entry -Wl,--growable-table $(CWASMOBJS) $(CPPWASMOBJS) $(addsuffix .c,$(WASM_ARCHIVE)): $(WASM_ARCHIVE) $(DIST)/host/bin/wasm2c -o $@ $< @@ -597,7 +597,7 @@ $(COBJS): $(CWASMOBJS): $(REPORT_BUILD_VERBOSE) - $(WASM_CC) -o $@ -c $(WASM_CFLAGS) $($(notdir $<)_FLAGS) $< + $(WASM_CC) $(OUTOPTION)$@ -c $(WASM_CFLAGS) $($(notdir $<)_FLAGS) $< WINEWRAP = $(if $(and $(filter %.exe,$1),$(WINE)),$(WINE) $1,$1) @@ -677,7 +677,7 @@ $(CPPOBJS): $(CPPWASMOBJS): $(REPORT_BUILD_VERBOSE) $(call BUILDSTATUS,OBJECT_FILE $@) - $(WASM_CXX) -o $@ -c $(WASM_CXXFLAGS) $($(notdir $<)_FLAGS) $< + $(WASM_CXX) $(OUTOPTION)$@ -c $(WASM_CXXFLAGS) $($(notdir $<)_FLAGS) $< $(CMMOBJS): $(REPORT_BUILD_VERBOSE) diff --git a/ipc/glue/LibrarySandboxPreload.cpp b/ipc/glue/LibrarySandboxPreload.cpp index 847d9db80da2..ba5952f17025 100644 --- a/ipc/glue/LibrarySandboxPreload.cpp +++ b/ipc/glue/LibrarySandboxPreload.cpp @@ -27,15 +27,10 @@ PathString GetSandboxedRLBoxPath() { return libFile->NativePath(); } -PRLibrary* PreloadLibrary(const PathString& path) { +PRLibrary* PreloadLibrary(const nsCString& path) { PRLibSpec libSpec; -#ifdef XP_WIN - libSpec.type = PR_LibSpec_PathnameU; - libSpec.value.pathname_u = path.get(); -#else libSpec.type = PR_LibSpec_Pathname; libSpec.value.pathname = path.get(); -#endif PRLibrary* ret = PR_LoadLibraryWithFlags(libSpec, PR_LD_LAZY); return ret; } @@ -43,9 +38,9 @@ PRLibrary* PreloadLibrary(const PathString& path) { void PreloadSandboxedDynamicLibrary() { // The process level sandbox does not allow loading of dynamic libraries. // This preloads wasm sandboxed libraries before the process level sandbox is - // enabled. Technically, this is only needed for Linux, but also allows to - // avoid loading/unloading the library repeatedly on other platforms. -#if defined(MOZ_USING_WASM_SANDBOXING) + // enabled. Currently, this is only needed for Linux as Mac allows loading + // libraries from the package file. +#if defined(XP_LINUX) && defined(MOZ_USING_WASM_SANDBOXING) if (!PreloadLibrary(GetSandboxedRLBoxPath())) { MOZ_CRASH("Library preload failure: Failed to load librlbox\n"); } diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py index 31ae525b50a5..3d3634282165 100644 --- a/python/mozbuild/mozbuild/frontend/context.py +++ b/python/mozbuild/mozbuild/frontend/context.py @@ -720,6 +720,7 @@ class WasmFlags(TargetCompileFlags): ), ("WASM_CXXFLAGS", "WASM_CFLAGS"), ), + ("RTL", None, ("WASM_CXXFLAGS", "WASM_CFLAGS")), ("DEBUG", self._debug_flags(), ("WASM_CFLAGS", "WASM_CXXFLAGS")), ( "CLANG_PLUGIN", @@ -727,6 +728,11 @@ class WasmFlags(TargetCompileFlags): ("WASM_CFLAGS", "WASM_CXXFLAGS"), ), ("OPTIMIZE", self._optimize_flags(), ("WASM_CFLAGS", "WASM_CXXFLAGS")), + ( + "FRAMEPTR", + context.config.substs.get("MOZ_FRAMEPTR_FLAGS"), + ("WASM_CFLAGS", "WASM_CXXFLAGS"), + ), ( "WARNINGS_AS_ERRORS", self._warnings_as_errors(), @@ -757,12 +763,6 @@ class WasmFlags(TargetCompileFlags): TargetCompileFlags.__init__(self, context) - def _debug_flags(self): - substs = self._context.config.substs - if substs.get("MOZ_DEBUG") or substs.get("MOZ_DEBUG_SYMBOLS"): - return ["-g"] - return [] - def _optimize_flags(self): if not self._context.config.substs.get("MOZ_OPTIMIZE"): return [] diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index bf47dc853a8a..1bed84df1708 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -1289,6 +1289,7 @@ class TreeMetadataEmitter(LoggingMixin): computed_flags.resolve_flags("RTL", [rtl_flag]) if not context.config.substs.get("CROSS_COMPILE"): computed_host_flags.resolve_flags("RTL", [rtl_flag]) + computed_wasm_flags.resolve_flags("RTL", [rtl_flag]) generated_files = set() localized_generated_files = set() diff --git a/taskcluster/ci/build/windows.yml b/taskcluster/ci/build/windows.yml index 26736d5f5e36..7b6136f93f97 100644 --- a/taskcluster/ci/build/windows.yml +++ b/taskcluster/ci/build/windows.yml @@ -169,7 +169,6 @@ win64/debug: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -224,7 +223,6 @@ win64-fuzzing/debug: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -268,7 +266,6 @@ win64-plain/debug: - win64-cbindgen - win64-winchecksec - win64-mozmake - - sysroot-wasm32-wasi optimization: skip-unless-expanded: null @@ -326,7 +323,6 @@ win64/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -368,7 +364,6 @@ win64-plain/opt: - win64-cbindgen - win64-winchecksec - win64-mozmake - - sysroot-wasm32-wasi optimization: skip-unless-expanded: null @@ -493,7 +488,6 @@ win64-shippable/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -596,7 +590,6 @@ win64-add-on-devel/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -648,7 +641,6 @@ win64-noopt/debug: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -830,7 +822,6 @@ win64-rusttests/opt: - win64-node - win64-winchecksec - win64-mozmake - - sysroot-wasm32-wasi optimization: test-inclusive: [rusttests] @@ -872,7 +863,6 @@ win64-rusttests/debug: - win64-node - win64-winchecksec - win64-mozmake - - sysroot-wasm32-wasi optimization: test-inclusive: [rusttests] @@ -922,7 +912,6 @@ win64-ccov/opt: - win64-node - win64-winchecksec - win64-mozmake - - sysroot-wasm32-wasi win64-asan/debug: description: "Win64 Debug ASAN" @@ -971,7 +960,6 @@ win64-asan/debug: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi - win64-llvm-symbolizer fetch: - nsis-3.01-win @@ -1027,7 +1015,6 @@ win64-asan/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi - win64-llvm-symbolizer fetch: - nsis-3.01-win @@ -1092,7 +1079,6 @@ win64-asan-reporter-shippable/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi - win64-llvm-symbolizer fetch: - nsis-3.01-win @@ -1273,7 +1259,6 @@ win64-devedition/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -1327,7 +1312,6 @@ win64-aarch64/debug: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -1389,7 +1373,6 @@ win64-aarch64/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -1595,7 +1578,6 @@ win64-aarch64-shippable-no-eme/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win @@ -1758,7 +1740,6 @@ win64-aarch64-devedition-no-eme/opt: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win diff --git a/taskcluster/ci/instrumented-build/kind.yml b/taskcluster/ci/instrumented-build/kind.yml index 0db145f77dfd..a821f2910a63 100644 --- a/taskcluster/ci/instrumented-build/kind.yml +++ b/taskcluster/ci/instrumented-build/kind.yml @@ -306,7 +306,6 @@ jobs: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win diff --git a/taskcluster/ci/searchfox/kind.yml b/taskcluster/ci/searchfox/kind.yml index 60d4114633db..e73b850f6e5c 100644 --- a/taskcluster/ci/searchfox/kind.yml +++ b/taskcluster/ci/searchfox/kind.yml @@ -148,7 +148,6 @@ jobs: - linux64-liblowercase - linux64-winchecksec - sysroot-x86_64-linux-gnu - - sysroot-wasm32-wasi fetch: - nsis-3.01-win - upx-3.95-win diff --git a/taskcluster/ci/static-analysis-autotest/kind.yml b/taskcluster/ci/static-analysis-autotest/kind.yml index 59ff1cabdd90..d57c2030af4f 100644 --- a/taskcluster/ci/static-analysis-autotest/kind.yml +++ b/taskcluster/ci/static-analysis-autotest/kind.yml @@ -100,4 +100,3 @@ jobs: - win64-node - win64-dump_syms - win64-winchecksec - - sysroot-wasm32-wasi diff --git a/toolkit/moz.configure b/toolkit/moz.configure index f4a9447bc32d..fe170b9bd0f1 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -2073,7 +2073,6 @@ def default_wasm_sandboxing_libraries(libraries, target, automation): (target.kernel == "Linux" and target.os == "GNU" and target.cpu == "x86_64") or (target.os == "Android" and target.bitness == 64) or (target.kernel == "Darwin" and target.bitness == 64) - or (target.kernel == "WINNT" and target.bitness == 64) ): return libraries