mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-04 19:56:36 +08:00
Merge branch 'wasi' into 'master'
Add compiler wasm option See merge request redox-os/redox!2395
This commit is contained in:
commit
4338ac2413
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -918,7 +918,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "redoxer"
|
name = "redoxer"
|
||||||
version = "0.2.63"
|
version = "0.2.63"
|
||||||
source = "git+https://gitlab.redox-os.org/redox-os/redoxer.git#d448ee8b1640d91ed70c37c164ca994f0c0b4fe8"
|
source = "git+https://gitlab.redox-os.org/redox-os/redoxer.git#f2cdeaec39797213d8b6dc8f08d2a5ec1900ee11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"dirs",
|
"dirs",
|
||||||
|
|||||||
@ -451,6 +451,7 @@ else
|
|||||||
cp -r "$(LLD_TARGET)/stage/usr/". "$@.partial"
|
cp -r "$(LLD_TARGET)/stage/usr/". "$@.partial"
|
||||||
rm -rf "$@.partial/lib/"*.a
|
rm -rf "$@.partial/lib/"*.a
|
||||||
echo "--sysroot=$(ROOT)/$(PREFIX)/gcc-install" > "$@.partial/bin/$(GNU_TARGET).cfg"
|
echo "--sysroot=$(ROOT)/$(PREFIX)/gcc-install" > "$@.partial/bin/$(GNU_TARGET).cfg"
|
||||||
|
ln -s clang-21 "$@.partial/bin/wasm32-wasip1-clang"
|
||||||
ln -s clang-21 "$@.partial/bin/$(GNU_TARGET)-clang"
|
ln -s clang-21 "$@.partial/bin/$(GNU_TARGET)-clang"
|
||||||
ln -s clang++ "$@.partial/bin/$(GNU_TARGET)-clang++"
|
ln -s clang++ "$@.partial/bin/$(GNU_TARGET)-clang++"
|
||||||
export PATH="$(ROOT)/$@.partial/bin:$$PATH" $(PREFIX_CONFIG) \
|
export PATH="$(ROOT)/$@.partial/bin:$$PATH" $(PREFIX_CONFIG) \
|
||||||
|
|||||||
@ -470,7 +470,7 @@ pub fn build(
|
|||||||
BuildCompiler::Gcc | BuildCompiler::GccNoLTO => {
|
BuildCompiler::Gcc | BuildCompiler::GccNoLTO => {
|
||||||
command.env("REDOXER_USE_CLANG", "0");
|
command.env("REDOXER_USE_CLANG", "0");
|
||||||
}
|
}
|
||||||
BuildCompiler::Clang | BuildCompiler::ClangNoLTO => {
|
BuildCompiler::Clang | BuildCompiler::ClangNoLTO | BuildCompiler::Wasm => {
|
||||||
command.env("REDOXER_USE_CLANG", "1");
|
command.env("REDOXER_USE_CLANG", "1");
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
@ -481,6 +481,9 @@ pub fn build(
|
|||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
if matches!(compiler, BuildCompiler::Wasm) {
|
||||||
|
command.env("TARGET", "wasm32-wasip1");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
command.env("COOKBOOK_MAKE_JOBS", cli_jobs.to_string());
|
command.env("COOKBOOK_MAKE_JOBS", cli_jobs.to_string());
|
||||||
if cook_config.verbose_cmd {
|
if cook_config.verbose_cmd {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ pub(crate) static SHARED_PRESCRIPT: &str = r#"
|
|||||||
# Build dynamically
|
# Build dynamically
|
||||||
function DYNAMIC_INIT {
|
function DYNAMIC_INIT {
|
||||||
case "${TARGET}" in
|
case "${TARGET}" in
|
||||||
"riscv64gc-unknown-redox")
|
"riscv64gc-unknown-redox" | "wasm32-wasip1")
|
||||||
[ -z "${COOKBOOK_VERBOSE}" ] || echo "WARN: ${TARGET} does not support dynamic linking." >&2
|
[ -z "${COOKBOOK_VERBOSE}" ] || echo "WARN: ${TARGET} does not support dynamic linking." >&2
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -190,6 +190,8 @@ pub enum BuildCompiler {
|
|||||||
ClangNoLTO,
|
ClangNoLTO,
|
||||||
#[serde(rename = "no-lto")]
|
#[serde(rename = "no-lto")]
|
||||||
NoLTO,
|
NoLTO,
|
||||||
|
#[serde(rename = "wasm")]
|
||||||
|
Wasm,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BuildRecipe {
|
impl BuildRecipe {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user