mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-25 06:14:18 +08:00
Adapt clang compiler from redoxer
This commit is contained in:
parent
7c1132a728
commit
45b28851e3
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -986,10 +986,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "redoxer"
|
||||
version = "0.2.62"
|
||||
source = "git+https://gitlab.redox-os.org/redox-os/redoxer.git#6bd1e4ddbcbc2d1facf70afd870335b870b19bb7"
|
||||
source = "git+https://gitlab.redox-os.org/redox-os/redoxer.git#1e193d68f329ecb20c75c41f190d58047f675db8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"dirs",
|
||||
"sha2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@ -52,6 +52,9 @@ else
|
||||
export CARGO="env -u CARGO cargo" $(PREFIX_CONFIG) && \
|
||||
./target/release/repo cook relibc
|
||||
cp -r "$(RELIBC_TARGET)/stage/usr/". "$@.partial/$(GNU_TARGET)"
|
||||
mkdir -p "$@.partial/$(GNU_TARGET)/usr"
|
||||
ln -s "../include" "$@.partial/$(GNU_TARGET)/usr/include"
|
||||
ln -s "../lib" "$@.partial/$(GNU_TARGET)/usr/lib"
|
||||
touch "$@.partial"
|
||||
mv "$@.partial" "$@"
|
||||
endif
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
// Scripts here is executed using "cookbook_redoxer env" where CC, RUSTFLAGS, etc. defined.
|
||||
// Look up redoxer env script if you want to see how they work.
|
||||
|
||||
pub(crate) static SHARED_PRESCRIPT: &str = r#"
|
||||
# Build dynamically
|
||||
function DYNAMIC_INIT {
|
||||
@ -32,7 +35,7 @@ function DYNAMIC_INIT {
|
||||
)
|
||||
|
||||
# TODO: check paths for spaces
|
||||
export LDFLAGS="-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib -L${COOKBOOK_SYSROOT}/lib"
|
||||
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
|
||||
}
|
||||
@ -94,11 +97,12 @@ export CARGO_TARGET_DIR="${COOKBOOK_BUILD}/target"
|
||||
|
||||
# This adds the sysroot includes for most C compilation
|
||||
#TODO: check paths for spaces!
|
||||
export CPPFLAGS="$CPPFLAGS -I${COOKBOOK_SYSROOT}/include"
|
||||
export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I${COOKBOOK_SYSROOT}/include"
|
||||
|
||||
# This adds the sysroot libraries and compiles binaries statically for most C compilation
|
||||
#TODO: check paths for spaces!
|
||||
export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib --static"
|
||||
USER_LDFLAGS="${LDFLAGS:+$LDFLAGS }"
|
||||
export LDFLAGS="${USER_LDFLAGS}-L${COOKBOOK_SYSROOT}/lib --static"
|
||||
|
||||
# These ensure that pkg-config gets the right flags from the sysroot
|
||||
if [ "${TARGET}" != "${COOKBOOK_HOST_TARGET}" ]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user