feat: support targetting i686

This commit is contained in:
Maxim De Clercq 2022-01-23 15:10:42 +01:00
parent cd9902637d
commit fd67cd7450
No known key found for this signature in database
GPG key ID: D35643779C52BA70
3 changed files with 26 additions and 11 deletions

View file

@ -17,8 +17,10 @@ ENV TARGET_PREFIX="/usr/local/$(echo "${TARGET:?}" | sed -e 's/armv7/arm/' -e 's
# Make sure that cc-rs links libc/libstdc++ statically when cross-compiling
# See https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables for more information
ENV RUSTFLAGS="-L\$TARGET_PREFIX/lib" CXXSTDLIB="static=stdc++"
# Forcefully linking against libatomic, libc and libgcc is required for arm32, otherwise symbols are missing
$([[ $TARGET =~ arm ]] && echo 'ENV RUSTFLAGS="$RUSTFLAGS -Clink-arg=-lgcc -Clink-arg=-latomic -lstatic=c"')
# Forcefully linking against libatomic and libgcc is required for arm32, otherwise symbols are missing
$([[ $TARGET =~ arm ]] && echo 'ENV RUSTFLAGS="$RUSTFLAGS -Clink-arg=-lgcc -Clink-arg=-latomic"')
# Forcefully linking against libc is required for 32-bit, otherwise symbols are missing
$([[ $TARGET =~ arm|i686 ]] && echo 'ENV RUSTFLAGS="$RUSTFLAGS -lstatic=c"')
# Strip symbols while compiling in release mode
$([[ $@ =~ -r ]] && echo 'ENV RUSTFLAGS="$RUSTFLAGS -Clink-arg=-s"')