Skip to content
Snippets Groups Projects
Verified Commit 3668ccc8 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Support i686 bootstrap

parent 73f39eb9
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,31 @@ git = "https://gitlab.redox-os.org/redox-os/bootstrap.git"
template = "custom"
script = """
ARCH="$(echo "${TARGET}" | cut -d - -f1)"
nasm -o "${COOKBOOK_BUILD}/asm.o" -f elf64 "${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"
ld -o "${COOKBOOK_STAGE}/bootstrap" --gc-sections -T "${COOKBOOK_SOURCE}/src/${ARCH}.ld" "${COOKBOOK_BUILD}/asm.o" "${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a"
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"
"""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment