96da04403d
rustc_llvm compiles llvm-wrapper/*.cpp, which include "llvm/Config/llvm-config.h". Those headers ship in the .dev package, and rust-native listed only llvm-native and llvm-native.runtime, so the build failed with LLVMWrapper.h:6:10: fatal error: llvm/Config/llvm-config.h: No such file or directory even though the header was staged at llvm-native/target/<triple>/stage.dev/usr/include/. recipes/dev/rust declares the equivalent llvm21.dev for the same reason. Latent because rust-native was commented out of the config and had never been built.
47 lines
1.6 KiB
TOML
47 lines
1.6 KiB
TOML
[source]
|
|
same_as = "../../../../recipes/dev/rust"
|
|
|
|
[build]
|
|
template = "custom"
|
|
dependencies = [
|
|
"zlib",
|
|
"curl",
|
|
"openssl3",
|
|
"llvm-native",
|
|
"llvm-native.runtime",
|
|
# rustc_llvm compiles llvm-wrapper/*.cpp, which #include
|
|
# "llvm/Config/llvm-config.h". Those headers are staged by the .dev
|
|
# package, so without it the build fails with
|
|
# LLVMWrapper.h:6:10: fatal error: llvm/Config/llvm-config.h:
|
|
# No such file or directory
|
|
# recipes/dev/rust declares the equivalent llvm21.dev for the same reason.
|
|
"llvm-native.dev",
|
|
]
|
|
script = """
|
|
DYNAMIC_INIT
|
|
ARCH="${TARGET%%-*}"
|
|
export CARGO_TARGET_${ARCH^^}_UNKNOWN_REDOX_RUSTFLAGS="${RUSTFLAGS}"
|
|
cat "${COOKBOOK_ROOT}/bin/${TARGET}-llvm-config" > "${COOKBOOK_SYSROOT}/bin/llvm-config"
|
|
export LD_LIBRARY_PATH="${COOKBOOK_HOST_SYSROOT}/lib:${LD_LIBRARY_PATH}"
|
|
|
|
cat ${COOKBOOK_RECIPE}/config.toml > config.toml
|
|
sed -i "s|COOKBOOK_SYSROOT|${COOKBOOK_SYSROOT}|g" config.toml
|
|
sed -i "s|COOKBOOK_TOOLCHAIN|${COOKBOOK_HOST_SYSROOT}|g" config.toml
|
|
sed -i "s|COOKBOOK_TARGET|${TARGET}|g" config.toml
|
|
sed -i "s|COOKBOOK_GNU_TARGET|${GNU_TARGET}|g" config.toml
|
|
|
|
unset AR AS CC CXX LD LDFLAGS NM OBJCOPY OBJDUMP RANLIB READELF RUSTFLAGS CARGO_ENCODED_RUSTFLAGS STRIP
|
|
|
|
python3 "${COOKBOOK_SOURCE}/x.py" install \
|
|
--config config.toml \
|
|
--jobs ${COOKBOOK_MAKE_JOBS}
|
|
|
|
mkdir -p "${COOKBOOK_STAGE}"/usr
|
|
rsync -av --delete "${COOKBOOK_BUILD}"/install/* "${COOKBOOK_STAGE}"/usr/
|
|
rm -rf "${COOKBOOK_STAGE}"/usr/lib/rustlib/*.log
|
|
"""
|
|
|
|
[package]
|
|
description = "Native Rust toolchain for Red Bear OS (rustc + cargo running on redox)"
|
|
dependencies = ["llvm-native.runtime"]
|