forked from mirrors/gecko-dev
Bug 1737733 - Update rlbox wasm configuration to use direct function calls r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D128566
This commit is contained in:
parent
8d60c280a7
commit
2a11cb1f78
11 changed files with 21 additions and 15 deletions
|
|
@ -217,6 +217,7 @@ endif
|
||||||
ifdef MOZ_USING_WASM_SANDBOXING
|
ifdef MOZ_USING_WASM_SANDBOXING
|
||||||
security/rlbox/target-objects: config/external/wasm2c_sandbox_compiler/host
|
security/rlbox/target-objects: config/external/wasm2c_sandbox_compiler/host
|
||||||
security/rlbox/target: security/rlbox/target-objects
|
security/rlbox/target: security/rlbox/target-objects
|
||||||
|
dom/media/ogg/target-objects extensions/spellcheck/hunspell/glue/target-objects gfx/thebes/target-objects: security/rlbox/target-objects
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Most things are built during compile (target/host), but some things happen during export
|
# Most things are built during compile (target/host), but some things happen during export
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,7 @@ OggDemuxer::nsAutoOggSyncState::~nsAutoOggSyncState() {
|
||||||
rlbox_sandbox_ogg* OggDemuxer::CreateSandbox() {
|
rlbox_sandbox_ogg* OggDemuxer::CreateSandbox() {
|
||||||
rlbox_sandbox_ogg* sandbox = new rlbox_sandbox_ogg();
|
rlbox_sandbox_ogg* sandbox = new rlbox_sandbox_ogg();
|
||||||
#ifdef MOZ_WASM_SANDBOXING_OGG
|
#ifdef MOZ_WASM_SANDBOXING_OGG
|
||||||
bool success = sandbox->create_sandbox(
|
bool success = sandbox->create_sandbox(false /* infallible */);
|
||||||
mozilla::ipc::GetSandboxedRLBoxPath().get(), false /* infallible */);
|
|
||||||
#else
|
#else
|
||||||
bool success = sandbox->create_sandbox();
|
bool success = sandbox->create_sandbox();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,12 @@
|
||||||
#include "mozilla/rlbox/rlbox_config.h"
|
#include "mozilla/rlbox/rlbox_config.h"
|
||||||
|
|
||||||
#ifdef MOZ_WASM_SANDBOXING_OGG
|
#ifdef MOZ_WASM_SANDBOXING_OGG
|
||||||
|
// Include the generated header file so that we are able to resolve the symbols
|
||||||
|
// in the wasm binary
|
||||||
|
# include "rlbox.wasm.h"
|
||||||
|
# define RLBOX_USE_STATIC_CALLS() rlbox_wasm2c_sandbox_lookup_symbol
|
||||||
# include "mozilla/rlbox/rlbox_wasm2c_sandbox.hpp"
|
# include "mozilla/rlbox/rlbox_wasm2c_sandbox.hpp"
|
||||||
#else
|
#else
|
||||||
// Extra configuration for no-op sandbox
|
|
||||||
# define RLBOX_USE_STATIC_CALLS() rlbox_noop_sandbox_lookup_symbol
|
# define RLBOX_USE_STATIC_CALLS() rlbox_noop_sandbox_lookup_symbol
|
||||||
# include "mozilla/rlbox/rlbox_noop_sandbox.hpp"
|
# include "mozilla/rlbox/rlbox_noop_sandbox.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ UNIFIED_SOURCES += [
|
||||||
"OpusParser.cpp",
|
"OpusParser.cpp",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
LOCAL_INCLUDES += ["!/security/rlbox"]
|
||||||
|
|
||||||
FINAL_LIBRARY = "xul"
|
FINAL_LIBRARY = "xul"
|
||||||
|
|
||||||
# Add libFuzzer configuration directives
|
# Add libFuzzer configuration directives
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,7 @@ RLBoxHunspell::RLBoxHunspell(const nsAutoCString& affpath,
|
||||||
const nsAutoCString& dpath)
|
const nsAutoCString& dpath)
|
||||||
: mHandle(nullptr) {
|
: mHandle(nullptr) {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread());
|
MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread());
|
||||||
#ifdef MOZ_WASM_SANDBOXING_HUNSPELL
|
|
||||||
mSandbox.create_sandbox(mozilla::ipc::GetSandboxedRLBoxPath().get());
|
|
||||||
#else
|
|
||||||
mSandbox.create_sandbox();
|
mSandbox.create_sandbox();
|
||||||
#endif
|
|
||||||
|
|
||||||
// Add the aff and dict files to allow list
|
// Add the aff and dict files to allow list
|
||||||
if (!affpath.IsEmpty()) {
|
if (!affpath.IsEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,12 @@
|
||||||
#include "mozilla/rlbox/rlbox_config.h"
|
#include "mozilla/rlbox/rlbox_config.h"
|
||||||
|
|
||||||
#ifdef MOZ_WASM_SANDBOXING_HUNSPELL
|
#ifdef MOZ_WASM_SANDBOXING_HUNSPELL
|
||||||
|
// Include the generated header file so that we are able to resolve the symbols
|
||||||
|
// in the wasm binary
|
||||||
|
# include "rlbox.wasm.h"
|
||||||
|
# define RLBOX_USE_STATIC_CALLS() rlbox_wasm2c_sandbox_lookup_symbol
|
||||||
# include "mozilla/rlbox/rlbox_wasm2c_sandbox.hpp"
|
# include "mozilla/rlbox/rlbox_wasm2c_sandbox.hpp"
|
||||||
#else
|
#else
|
||||||
// Extra configuration for no-op sandbox
|
|
||||||
# define RLBOX_USE_STATIC_CALLS() rlbox_noop_sandbox_lookup_symbol
|
# define RLBOX_USE_STATIC_CALLS() rlbox_noop_sandbox_lookup_symbol
|
||||||
# include "mozilla/rlbox/rlbox_noop_sandbox.hpp"
|
# include "mozilla/rlbox/rlbox_noop_sandbox.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ DEFINES["HUNSPELL_STATIC"] = True
|
||||||
FINAL_LIBRARY = "xul"
|
FINAL_LIBRARY = "xul"
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
"!/security/rlbox",
|
||||||
"../src",
|
"../src",
|
||||||
"/dom/base",
|
"/dom/base",
|
||||||
"/extensions/spellcheck/src",
|
"/extensions/spellcheck/src",
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,12 @@
|
||||||
#include "mozilla/rlbox/rlbox_config.h"
|
#include "mozilla/rlbox/rlbox_config.h"
|
||||||
|
|
||||||
#ifdef MOZ_WASM_SANDBOXING_GRAPHITE
|
#ifdef MOZ_WASM_SANDBOXING_GRAPHITE
|
||||||
|
// Include the generated header file so that we are able to resolve the symbols
|
||||||
|
// in the wasm binary
|
||||||
|
# include "rlbox.wasm.h"
|
||||||
|
# define RLBOX_USE_STATIC_CALLS() rlbox_wasm2c_sandbox_lookup_symbol
|
||||||
# include "mozilla/rlbox/rlbox_wasm2c_sandbox.hpp"
|
# include "mozilla/rlbox/rlbox_wasm2c_sandbox.hpp"
|
||||||
#else
|
#else
|
||||||
// Extra configuration for no-op sandbox
|
|
||||||
# define RLBOX_USE_STATIC_CALLS() rlbox_noop_sandbox_lookup_symbol
|
# define RLBOX_USE_STATIC_CALLS() rlbox_noop_sandbox_lookup_symbol
|
||||||
# include "mozilla/rlbox/rlbox_noop_sandbox.hpp"
|
# include "mozilla/rlbox/rlbox_noop_sandbox.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -631,11 +631,7 @@ struct gfxFontEntry::GrSandboxData {
|
||||||
grGetGlyphAdvanceCallback;
|
grGetGlyphAdvanceCallback;
|
||||||
|
|
||||||
GrSandboxData() {
|
GrSandboxData() {
|
||||||
#ifdef MOZ_WASM_SANDBOXING_GRAPHITE
|
|
||||||
sandbox.create_sandbox(mozilla::ipc::GetSandboxedRLBoxPath().get());
|
|
||||||
#else
|
|
||||||
sandbox.create_sandbox();
|
sandbox.create_sandbox();
|
||||||
#endif
|
|
||||||
grGetTableCallback = sandbox.register_callback(GrGetTable);
|
grGetTableCallback = sandbox.register_callback(GrGetTable);
|
||||||
grReleaseTableCallback = sandbox.register_callback(GrReleaseTable);
|
grReleaseTableCallback = sandbox.register_callback(GrReleaseTable);
|
||||||
grGetGlyphAdvanceCallback =
|
grGetGlyphAdvanceCallback =
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,7 @@ include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
FINAL_LIBRARY = "xul"
|
FINAL_LIBRARY = "xul"
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
"!/security/rlbox",
|
||||||
"/dom/base",
|
"/dom/base",
|
||||||
"/dom/media/platforms/apple",
|
"/dom/media/platforms/apple",
|
||||||
"/dom/xml",
|
"/dom/xml",
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ SOURCES += [
|
||||||
"/third_party/wasm2c/wasm2c/wasm-rt-wasi.c",
|
"/third_party/wasm2c/wasm2c/wasm-rt-wasi.c",
|
||||||
]
|
]
|
||||||
|
|
||||||
FINAL_LIBRARY = "xul"
|
# Configuration that removes the wasm2c functions from shared library exports
|
||||||
|
DEFINES["WASM_DONT_EXPORT_FUNCS"] = True
|
||||||
|
|
||||||
NoVisibilityFlags()
|
FINAL_LIBRARY = "xul"
|
||||||
|
|
||||||
# Allow compiler warnings both in wasm compiles (because they're third-party
|
# Allow compiler warnings both in wasm compiles (because they're third-party
|
||||||
# libraries), and C compiles (because they're code generated by wasm2c).
|
# libraries), and C compiles (because they're code generated by wasm2c).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue