diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ae1ed55..4c44ac9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,8 +57,16 @@ jobs: os: ubuntu-20.04 target: i586-unknown-linux-musl expect_file_re: "ELF.+80386" - expect_cross: "--no-expect-cross" - expect_stripped: "--expect-stripped" + expect_cross: "--expect-cross" + expect_stripped: "--no-expect-stripped" + can_test: true + + - platform_name: Linux-i686 + os: ubuntu-20.04 + target: i686-unknown-linux-musl + expect_file_re: "ELF.+80386" + expect_cross: "--expect-cross" + expect_stripped: "--no-expect-stripped" can_test: true - platform_name: Linux-mips diff --git a/Changes.md b/Changes.md index 1e9c877..63c3eef 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,7 @@ +- Use `cross` when compiling for 32-bit Linux targets. While in theory this should work without + `cross`, compiling `openssl` with the `vendored` feature fails when we run + `cargo build --target i686-unknown-linux-musl`. + ## 0.0.10 - 2023-12-10 - Fixed handling of crates with multiple binaries. Attempting to strip binaries for such a crate diff --git a/set-cross-compile.sh b/set-cross-compile.sh index 29f7ce3..a8119b6 100755 --- a/set-cross-compile.sh +++ b/set-cross-compile.sh @@ -10,7 +10,11 @@ if uname -a | grep --quiet --extended-regexp -i "darwin|msys|windows"; then exit 0 fi -if echo "$TARGET" | grep --quiet --extended-regexp -i '(x86_64|586|686).+linux-(gnu|musl)'; then +# On Linux, we should be able to cross-compile to i586 and i686, but in +# practice this fails with some crates, notably openssl with the "vendored" +# feature. This feature makes it compile openssl itself, which fails without +# cross. +if echo "$TARGET" | grep --quiet --extended-regexp -i 'x86_64.+linux-(gnu|musl)'; then echo "needs-cross=false" >> $GITHUB_OUTPUT exit 0 fi