gecko-dev/security/rlbox/moz.build
Mike Hommey e2a1db5178 Bug 1713735 - Add the bits necessary to build wasm sandbox libs with wasm2c. r=firefox-build-system-reviewers,mhentges
For the moment, it's opt-in via explicitly setting `LUCETC` to an empty
string.

Differential Revision: https://phabricator.services.mozilla.com/D119939
2021-07-16 02:38:41 +00:00

61 lines
1.9 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG["LUCETC"]:
WASM_SOURCES += [
"/third_party/rust/rlbox_lucet_sandbox/c_src/lucet_sandbox_wrapper.c",
]
else:
WASM_SOURCES += [
"/third_party/rlbox_wasm2c_sandbox/c_src/wasm2c_sandbox_wrapper.c",
]
LOCAL_INCLUDES += ["/third_party/wasm2c/wasm2c/"]
EXPORTS += ["/third_party/wasm2c/wasm2c/wasm-rt.h"]
SOURCES += [
"/third_party/wasm2c/wasm2c/wasm-rt-impl.c",
"/third_party/wasm2c/wasm2c/wasm-rt-os-unix.c",
"/third_party/wasm2c/wasm2c/wasm-rt-os-win.c",
"/third_party/wasm2c/wasm2c/wasm-rt-wasi.c",
]
NoVisibilityFlags()
CFLAGS += [
"-Wno-error=unused-function",
]
WASM_DEFINES["MOZILLA_CLIENT"] = True
SANDBOXED_WASM_LIBRARY_NAME = "rlbox"
if CONFIG["MOZ_WASM_SANDBOXING_HUNSPELL"]:
include("/extensions/spellcheck/hunspell/src/sources.mozbuild")
WASM_SOURCES += [
"/extensions/spellcheck/hunspell/src/" + s for s in hunspell_sources
]
LOCAL_INCLUDES += [
"/extensions/spellcheck/hunspell/glue",
"/extensions/spellcheck/hunspell/src",
]
if CONFIG["MOZ_WASM_SANDBOXING_GRAPHITE"]:
include("/gfx/graphite2/src/sources.mozbuild")
WASM_SOURCES += ["/gfx/graphite2/src/" + s for s in graphite_sources]
WASM_SOURCES += [
"/gfx/graphite2/src/call_machine.cpp",
]
for k, v in graphite_defines:
WASM_DEFINES[k] = v
LOCAL_INCLUDES += ["/gfx/graphite2/src"]
if CONFIG["MOZ_WASM_SANDBOXING_OGG"]:
include("/media/libogg/sources.mozbuild")
WASM_SOURCES += ["/media/libogg/" + s for s in ogg_sources]
LOCAL_INCLUDES += ["/media/libogg"]