Skip to content

Commit

Permalink
.cargo/config.toml: remove
Browse files Browse the repository at this point in the history
When compiling on an aarch64 host, the override of the linker to the
cross "compiler" (uses the gcc frontend) causes a build failure. Theirs
no reason to set these globally for all developers as their build host
may be different as well as their toolchain preference and naming
conventions.

Instead override the target specific linker variable in a --config
option string in the cross compilation tests.

Signed-off-by: Bill Roberts <[email protected]>
  • Loading branch information
billatarm authored and gowthamsk-arm committed Dec 7, 2023
1 parent c8a8eaa commit bfa6341
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 0 additions & 7 deletions .cargo/config.toml

This file was deleted.

8 changes: 6 additions & 2 deletions test/cross-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ export PKG_CONFIG=$(pwd)/test/pkg-config
export SYSROOT=/tmp/arm-linux-gnueabihf
# Add the correct libcrypto to the linking process
export RUSTFLAGS="-lcrypto -L/tmp/arm-linux-gnueabihf/lib"
cargo build --features "pkcs11-provider, mbed-crypto-provider, tpm-provider, unix-peer-credentials-authenticator, direct-authenticator" --target armv7-unknown-linux-gnueabihf
cargo build --features "pkcs11-provider, mbed-crypto-provider, tpm-provider, unix-peer-credentials-authenticator, direct-authenticator" \
--target armv7-unknown-linux-gnueabihf \
--config 'target.armv7-unknown-linux-gnueabihf.linker="arm-linux-gnueabihf-gcc"'

export SYSROOT=/tmp/aarch64-linux-gnu
export RUSTFLAGS="-lcrypto -L/tmp/aarch64-linux-gnu/lib"
# Pull in the TS code
git submodule update --init
cargo build --features "pkcs11-provider, mbed-crypto-provider, tpm-provider, trusted-service-provider, unix-peer-credentials-authenticator, direct-authenticator" --target aarch64-unknown-linux-gnu
cargo build --features "pkcs11-provider, mbed-crypto-provider, tpm-provider, trusted-service-provider, unix-peer-credentials-authenticator, direct-authenticator" \
--target aarch64-unknown-linux-gnu \
--config 'target.aarch64-unknown-linux-gnu.linker="aarch64-linux-gnu-gcc"'

# This is needed because for some reason the i686/i386 libs aren't picked up if we don't toss them around just before...
apt install -y libc6-dev-i386-amd64-cross
Expand Down

0 comments on commit bfa6341

Please sign in to comment.