Skip to content

Commit

Permalink
add support for gcc cross-build for linux targets
Browse files Browse the repository at this point in the history
[UNTESTED]
  • Loading branch information
vszakats committed Aug 31, 2023
1 parent 290fa6c commit 644e9b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
12 changes: 9 additions & 3 deletions _build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,17 @@ build_single_target() {
# Include CRT type in Linux triplets, to make it visible in
# the curl version banner.
_TRIPLET="${_machine}-pc-linux-${_CRT}"
# Short triplet used on the Linux filesystem
_TRIPLETSH="${_machine}-linux-gnu"

if [ "${unamem}" != "${_machine}" ] && [ "${_CC}" = 'gcc' ]; then
# TODO: Implement cross-builds with gcc
echo "! WARNING: Linux cross-buils require llvm/clang. Skipping."
return
# https://packages.debian.org/testing/arm64/gcc-x86-64-linux-gnu/filelist
# https://packages.debian.org/testing/arm64/binutils-x86-64-linux-gnu/filelist
# /usr/bin/x86_64-linux-gnu-gcc
# https://packages.debian.org/testing/amd64/gcc-aarch64-linux-gnu/filelist
# https://packages.debian.org/testing/amd64/binutils-aarch64-linux-gnu/filelist
# /usr/bin/aarch64-linux-gnu-gcc
_CCPREFIX="${_TRIPLETSH}-"
fi

_RUN_BIN='echo'
Expand Down
12 changes: 10 additions & 2 deletions _ci-linux-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ extra=''
if [[ "${CW_CONFIG:-}" = *'linux'* ]]; then
extra="${extra} checksec"
if [ "$(uname -m)" = 'aarch64' ]; then
extra="${extra} libgcc-13-dev-amd64-cross libstdc++-13-dev-amd64-cross"
if [[ "${CW_CONFIG:-}" = *'gcc'* ]]; then
extra="${extra} gcc${CW_CCSUFFIX}-x86-64-linux-gnu"
else
extra="${extra} libgcc-13-dev-amd64-cross libstdc++-13-dev-amd64-cross"
fi
else
extra="${extra} libgcc-13-dev-arm64-cross libstdc++-13-dev-arm64-cross"
if [[ "${CW_CONFIG:-}" = *'gcc'* ]]; then
extra="${extra} gcc${CW_CCSUFFIX}-aarch64-linux-gnu"
else
extra="${extra} libgcc-13-dev-arm64-cross libstdc++-13-dev-arm64-cross"
fi
fi
fi

Expand Down

0 comments on commit 644e9b9

Please sign in to comment.