Skip to content

Commit

Permalink
env-setup.sh: Remove GNU tools in the Docker image before building
Browse files Browse the repository at this point in the history
This will help ensure that the GNU tools aren't hard coded anywhere as
the goal of the LLVM tools is to be as compatible as possible.

Closes: ClangBuiltLinux#122
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
  • Loading branch information
nathanchance committed Apr 22, 2019
1 parent 5df0988 commit bc2b0db
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions env-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,17 @@ ccache --set-config=cache_dir=/travis/.ccache

# Clear out the stats so we actually know the cache stats
ccache -z

# Ensure that GNU tools are not available when using LLVM tools
function remove() {
type -a "${@}" | awk '{print $3}' | while IFS=$'\n' read -r line; do rm -vf "${line}"; done
}
case ${ARCH:=arm64} in
arm32*) CROSS_COMPILE=arm-linux-gnueabi- ;;
arm64) CROSS_COMPILE=aarch64-linux-gnu- ;;
ppc32) CROSS_COMPILE=powerpc-linux-gnu- ;;
ppc64le) CROSS_COMPILE=powerpc64le-linux-gnu- ;;
esac
remove "${CROSS_COMPILE:-}"ar
remove "${CROSS_COMPILE:-}"gcc
[[ ${LD} =~ ld.lld ]] && remove ${CROSS_COMPILE:-}{ld,ld.bfd,ld.gold}

0 comments on commit bc2b0db

Please sign in to comment.