mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-24 22:04:19 +08:00
Merge branch 'reexport-clangs' into 'master'
Reexport flags for cc crate See merge request redox-os/redox!1977
This commit is contained in:
commit
cf717dc830
@ -29,7 +29,6 @@ else
|
||||
DYNAMIC_INIT
|
||||
# Linker flags for stage2 compiler (host -> target)
|
||||
ARCH="${TARGET%%-*}"
|
||||
export LDFLAGS_${ARCH}_unknown_redox="${LDFLAGS}" # LLVM
|
||||
export CARGO_TARGET_${ARCH^^}_UNKNOWN_REDOX_RUSTFLAGS="${RUSTFLAGS}" # Rust
|
||||
# Hack for Rust errorneusly running `llvm-config --version` on cross compiled llvm-config
|
||||
cat "${COOKBOOK_ROOT}/bin/${TARGET}-llvm-config" > "${COOKBOOK_SYSROOT}/bin/llvm-config"
|
||||
|
||||
@ -37,6 +37,7 @@ function DYNAMIC_INIT {
|
||||
export LDFLAGS="${USER_LDFLAGS}-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib -L${COOKBOOK_SYSROOT}/lib"
|
||||
export RUSTFLAGS="-C target-feature=-crt-static -L native=${COOKBOOK_SYSROOT}/lib -C link-arg=-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib"
|
||||
export COOKBOOK_DYNAMIC=1
|
||||
reexport_flags
|
||||
}
|
||||
|
||||
COOKBOOK_AUTORECONF="autoreconf"
|
||||
@ -102,6 +103,14 @@ export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I${COOKBOOK_SYSROOT}/include"
|
||||
USER_LDFLAGS="${LDFLAGS:+$LDFLAGS }"
|
||||
export LDFLAGS="${USER_LDFLAGS}-L${COOKBOOK_SYSROOT}/lib --static"
|
||||
|
||||
# This reexport C variables into custom build script that can be consumed by cc crate
|
||||
function reexport_flags {
|
||||
target=${TARGET//-/_}
|
||||
export CFLAGS_${target}="${CFLAGS:+$CFLAGS }${CPPFLAGS}"
|
||||
export CXXFLAGS_${target}="${CXXFLAGS:+$CXXFLAGS }${CPPFLAGS}"
|
||||
export LDFLAGS_${target}="${LDFLAGS}"
|
||||
}
|
||||
|
||||
# These ensure that pkg-config gets the right flags from the sysroot
|
||||
if [ "${TARGET}" != "${COOKBOOK_HOST_TARGET}" ]
|
||||
then
|
||||
@ -131,6 +140,8 @@ build_flags+=" --offline"
|
||||
install_flags+=" --offline"
|
||||
fi
|
||||
|
||||
reexport_flags
|
||||
|
||||
# cargo template
|
||||
COOKBOOK_CARGO="${COOKBOOK_REDOXER}"
|
||||
function cookbook_cargo {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user