mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-29 08:08:41 +08:00
36 lines
913 B
TOML
36 lines
913 B
TOML
[source]
|
|
git = "https://gitlab.redox-os.org/redox-os/bootstrap.git"
|
|
|
|
[build]
|
|
template = "custom"
|
|
script = """
|
|
ARCH="$(echo "${TARGET}" | cut -d - -f1)"
|
|
case "${ARCH}" in
|
|
i686)
|
|
NASM_FORMAT=elf32
|
|
;;
|
|
*)
|
|
NASM_FORMAT=elf64
|
|
;;
|
|
esac
|
|
nasm \
|
|
-o "${COOKBOOK_BUILD}/asm.o" \
|
|
-f "${NASM_FORMAT}" \
|
|
"${COOKBOOK_SOURCE}/src/${ARCH}.asm"
|
|
cargo \
|
|
-Zbuild-std=core,alloc,compiler_builtins \
|
|
-Zbuild-std-features=compiler-builtins-mem rustc \
|
|
--target "${TARGET}" \
|
|
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
|
|
--release \
|
|
--target-dir "${COOKBOOK_BUILD}" \
|
|
-- \
|
|
--emit link="${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a"
|
|
"${TARGET}-ld" \
|
|
-o "${COOKBOOK_STAGE}/bootstrap" \
|
|
--gc-sections \
|
|
-T "${COOKBOOK_SOURCE}/src/${ARCH}.ld" \
|
|
"${COOKBOOK_BUILD}/asm.o" \
|
|
"${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a"
|
|
"""
|