Force PIC as the final x64 compiler flag.
Some checks failed
Tagged release / prepare-release (push) Successful in 3m0s
Tagged release / build-linux-x64 (push) Failing after 12m8s
Tagged release / build-macos (push) Has been skipped
Tagged release / build-linux-arm64 (push) Has been skipped
Tagged release / build-windows (push) Has been skipped
Tagged release / publish-release (push) Has been skipped
Some checks failed
Tagged release / prepare-release (push) Successful in 3m0s
Tagged release / build-linux-x64 (push) Failing after 12m8s
Tagged release / build-macos (push) Has been skipped
Tagged release / build-linux-arm64 (push) Has been skipped
Tagged release / build-windows (push) Has been skipped
Tagged release / publish-release (push) Has been skipped
This commit is contained in:
2
.gitea/scripts/x86_64-linux-gnu-g++-pic
Executable file
2
.gitea/scripts/x86_64-linux-gnu-g++-pic
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec x86_64-linux-gnu-g++ "$@" -fPIC
|
||||||
2
.gitea/scripts/x86_64-linux-gnu-gcc-pic
Executable file
2
.gitea/scripts/x86_64-linux-gnu-gcc-pic
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec x86_64-linux-gnu-gcc "$@" -fPIC
|
||||||
@@ -136,8 +136,6 @@ jobs:
|
|||||||
runs-on: linux-arm64
|
runs-on: linux-arm64
|
||||||
env:
|
env:
|
||||||
AR_x86_64_unknown_linux_gnu: x86_64-linux-gnu-ar
|
AR_x86_64_unknown_linux_gnu: x86_64-linux-gnu-ar
|
||||||
CC_x86_64_unknown_linux_gnu: x86_64-linux-gnu-gcc -fPIC
|
|
||||||
CXX_x86_64_unknown_linux_gnu: x86_64-linux-gnu-g++ -fPIC
|
|
||||||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: x86_64-linux-gnu-gcc
|
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: x86_64-linux-gnu-gcc
|
||||||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=--sysroot=/opt/ruds-x64-sysroot -C link-arg=-Wl,-rpath,$ORIGIN -L native=/opt/ruds-x64-sysroot/usr/lib/x86_64-linux-gnu -L native=/opt/ruds-x64-sysroot/lib/x86_64-linux-gnu
|
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=--sysroot=/opt/ruds-x64-sysroot -C link-arg=-Wl,-rpath,$ORIGIN -L native=/opt/ruds-x64-sysroot/usr/lib/x86_64-linux-gnu -L native=/opt/ruds-x64-sysroot/lib/x86_64-linux-gnu
|
||||||
PKG_CONFIG_ALLOW_CROSS: "1"
|
PKG_CONFIG_ALLOW_CROSS: "1"
|
||||||
@@ -168,6 +166,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
target=x86_64-unknown-linux-gnu
|
target=x86_64-unknown-linux-gnu
|
||||||
|
export CC="$PWD/.gitea/scripts/x86_64-linux-gnu-gcc-pic"
|
||||||
|
export CC_x86_64_unknown_linux_gnu="$PWD/.gitea/scripts/x86_64-linux-gnu-gcc-pic"
|
||||||
|
export CXX="$PWD/.gitea/scripts/x86_64-linux-gnu-g++-pic"
|
||||||
|
export CXX_x86_64_unknown_linux_gnu="$PWD/.gitea/scripts/x86_64-linux-gnu-g++-pic"
|
||||||
unset ZSTD_SYS_USE_PKG_CONFIG
|
unset ZSTD_SYS_USE_PKG_CONFIG
|
||||||
cargo +${RUST_TOOLCHAIN} build --release --locked --target "$target" \
|
cargo +${RUST_TOOLCHAIN} build --release --locked --target "$target" \
|
||||||
--package bds-ui --package bds-cli --package bds-mcp
|
--package bds-ui --package bds-cli --package bds-mcp
|
||||||
|
|||||||
@@ -148,8 +148,8 @@ fn tagged_releases_are_built_and_packaged_with_rust_tools() {
|
|||||||
"publish",
|
"publish",
|
||||||
"PKG_CONFIG_ALLOW_CROSS",
|
"PKG_CONFIG_ALLOW_CROSS",
|
||||||
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER",
|
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER",
|
||||||
"CC_x86_64_unknown_linux_gnu: x86_64-linux-gnu-gcc -fPIC",
|
"export CC_x86_64_unknown_linux_gnu=\"$PWD/.gitea/scripts/x86_64-linux-gnu-gcc-pic\"",
|
||||||
"CXX_x86_64_unknown_linux_gnu: x86_64-linux-gnu-g++ -fPIC",
|
"export CXX_x86_64_unknown_linux_gnu=\"$PWD/.gitea/scripts/x86_64-linux-gnu-g++-pic\"",
|
||||||
"unset ZSTD_SYS_USE_PKG_CONFIG",
|
"unset ZSTD_SYS_USE_PKG_CONFIG",
|
||||||
] {
|
] {
|
||||||
assert!(
|
assert!(
|
||||||
@@ -260,3 +260,22 @@ fn tagged_releases_are_built_and_packaged_with_rust_tools() {
|
|||||||
assert!(release_source.contains("rewrite_macho_rpaths"));
|
assert!(release_source.contains("rewrite_macho_rpaths"));
|
||||||
assert!(!release_source.contains("Linux releases contain the portable CLI tools"));
|
assert!(!release_source.contains("Linux releases contain the portable CLI tools"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn x64_cross_compiler_wrappers_append_pic_last() {
|
||||||
|
for (script, compiler) in [
|
||||||
|
("x86_64-linux-gnu-gcc-pic", "x86_64-linux-gnu-gcc"),
|
||||||
|
("x86_64-linux-gnu-g++-pic", "x86_64-linux-gnu-g++"),
|
||||||
|
] {
|
||||||
|
let contents = fs::read_to_string(
|
||||||
|
Path::new(CRATE_DIR)
|
||||||
|
.join("../../.gitea/scripts")
|
||||||
|
.join(script),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
assert_eq!(
|
||||||
|
contents,
|
||||||
|
format!("#!/bin/sh\nexec {compiler} \"$@\" -fPIC\n")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user