diff --git a/.cargo/config.toml b/.cargo/config.toml index b3058a680..68d431141 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -20,3 +20,7 @@ rustflags = [] [env] CFLAGS_riscv64gc_unknown_redox="-march=rv64gc -mabi=lp64d" + +[target.x86_64-unknown-linux-gnu] +linker = "x86_64-linux-gnu-gcc" +rustflags = [] diff --git a/Cargo.lock b/Cargo.lock index 3be770652..2598919cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1067,9 +1067,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" @@ -1367,7 +1367,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" dependencies = [ "equivalent", - "hashbrown 0.16.0", + "hashbrown 0.16.1", ] [[package]] @@ -1821,7 +1821,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.27", + "zerocopy 0.8.28", ] [[package]] @@ -2163,9 +2163,9 @@ dependencies = [ [[package]] name = "redoxer" -version = "0.2.57" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2495808593af68ef1267347d23b5c95e682e0260c9512bd7295d6806d0f9237a" +checksum = "2ef2d308648e7006723774da783dd5d9a6c931387b3dc7f903a10fa1c2026d0d" dependencies = [ "anyhow", "dirs 6.0.0", @@ -3567,11 +3567,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "43fa6694ed34d6e57407afbccdeecfa268c470a7d2a5b0cf49ce9fcc345afb90" dependencies = [ - "zerocopy-derive 0.8.27", + "zerocopy-derive 0.8.28", ] [[package]] @@ -3587,9 +3587,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "c640b22cd9817fae95be82f0d2f90b11f7605f6c319d16705c459b27ac2cbc26" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 8874c2ddc..62e8eeaa1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ pkgar-core = { path = "pkgar/pkgar-core" } pkgar-keys = { path = "pkgar/pkgar-keys" } redox-pkg = "0.2.8" redox_installer = "0.2.37" -redoxer = "0.2.57" +redoxer = "0.2.60" regex = "1.11" serde = { version = "=1.0.197", features = ["derive"] } termion = "4" diff --git a/src/cook/cook_build.rs b/src/cook/cook_build.rs index 5d5ae6e3d..fde4d0687 100644 --- a/src/cook/cook_build.rs +++ b/src/cook/cook_build.rs @@ -344,6 +344,7 @@ pub fn build( command.current_dir(&cookbook_build); command.env("COOKBOOK_BUILD", &cookbook_build); command.env("COOKBOOK_NAME", name.as_str()); + command.env("COOKBOOK_HOST_TARGET", redoxer::host_target()); command.env("COOKBOOK_RECIPE", &cookbook_recipe); command.env("COOKBOOK_ROOT", &cookbook_root); command.env("COOKBOOK_STAGE", &cookbook_stage); diff --git a/src/cook/script.rs b/src/cook/script.rs index 8f9730365..a5b221259 100644 --- a/src/cook/script.rs +++ b/src/cook/script.rs @@ -9,11 +9,16 @@ function DYNAMIC_INIT { done } - if [ "${TARGET}" != "x86_64-unknown-redox" ] - then - [ -z "${COOKBOOK_VERBOSE}" ] || echo "WARN: ${TARGET} does not support dynamic linking." >&2 - return - fi + case "${TARGET}" in + "x86_64-unknown-redox") + ;; + "x86_64-unknown-linux-gnu") + ;; + *) + [ -z "${COOKBOOK_VERBOSE}" ] || echo "WARN: ${TARGET} does not support dynamic linking." >&2 + return + ;; + esac [ -z "${COOKBOOK_VERBOSE}" ] || echo "DEBUG: Program is being compiled dynamically." @@ -97,10 +102,13 @@ export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib --static" # These ensure that pkg-config gets the right flags from the sysroot -export PKG_CONFIG_ALLOW_CROSS=1 -export PKG_CONFIG_PATH= -export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig" -export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}" +if [ "${TARGET}" != "${COOKBOOK_HOST_TARGET}" ] +then + export PKG_CONFIG_ALLOW_CROSS=1 + export PKG_CONFIG_PATH= + export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig" + export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}" +fi # To build the debug version of a Cargo program, add COOKBOOK_DEBUG=true, and # to not strip symbols from the final package, add COOKBOOK_NOSTRIP=true to the recipe