Skip to content

Commit

Permalink
prepare-cross-toolchain-unix: Update for musl
Browse files Browse the repository at this point in the history
Don't execute the source clang to check the resource directory;
when assembling a toolchain on a different system, we can't
assume that the source toolchain is executable. And when cross
building a toolchain for a foreign target, we can't assume we can
execute the target toolchain either.
  • Loading branch information
mstorsjo committed Aug 5, 2024
1 parent bdc0d6c commit c1a7e91
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions prepare-cross-toolchain-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ DEST="$2"

: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}

CLANG_RESOURCE_DIR="$("$SRC/bin/clang" --print-resource-dir)"
CLANG_RESOURCE_DIR="$(echo "$SRC/lib/clang/"*)"
CLANG_VERSION=$(basename "$CLANG_RESOURCE_DIR")

# Copy the clang resource files (include, lib, share). The clang cross
Expand All @@ -44,10 +44,8 @@ CLANG_VERSION=$(basename "$CLANG_RESOURCE_DIR")
rm -rf $DEST/lib/clang/$CLANG_VERSION
cp -a $CLANG_RESOURCE_DIR $DEST/lib/clang/$CLANG_VERSION

# Copy all arch-specific subdirectories plus the "generic" one, as is.
for arch in generic $ARCHS; do
cp -a $SRC/$arch-w64-mingw32 $DEST/$arch-w64-mingw32
done
# Copy the sysroot
cp -a $SRC/generic-linux-musl $DEST

# Copy the libc++ module sources
rm -rf $DEST/share/libc++
Expand Down

0 comments on commit c1a7e91

Please sign in to comment.