Add bootstrap recipe.

This commit is contained in:
4lDO2 2022-07-18 11:52:15 +02:00
parent bf72bf38d3
commit e1f7024dba
No known key found for this signature in database
GPG Key ID: 996A1DBA676A00C0

View File

@ -0,0 +1,11 @@
[recipe]
[build]
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 obj="${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a"
compiler_builtins=`find "${COOKBOOK_BUILD}/x86_64-unknown-redox/release/deps/" -name "*libcompiler_builtins*.rlib"`
ld -o "${COOKBOOK_STAGE}/bootstrap" --gc-sections -T "${COOKBOOK_SOURCE}/src/${ARCH}.ld" "${COOKBOOK_BUILD}/asm.o" "${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a" "${COOKBOOK_SYSROOT}/lib/libc.a" "$compiler_builtins"
"""
dependencies = ["relibc"]