From 585c767ee47f9de9d6cd8a21f097cca9be37e968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 3 Dec 2018 11:18:57 +0200 Subject: [PATCH] Use llvm-ar with the flag 'L' instead of a helper MRI script for merging archives --- Dockerfile | 2 +- Dockerfile.dev | 2 +- build-libcxx.sh | 7 +++---- merge-archives.sh | 36 ------------------------------------ 4 files changed, 5 insertions(+), 42 deletions(-) delete mode 100755 merge-archives.sh diff --git a/Dockerfile b/Dockerfile index 55292bd..de59e87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN ./build-mingw-w64.sh $TOOLCHAIN_PREFIX && \ rm -rf /build/* # Build libunwind/libcxxabi/libcxx -COPY build-libcxx.sh merge-archives.sh ./ +COPY build-libcxx.sh ./ RUN ./build-libcxx.sh $TOOLCHAIN_PREFIX && \ rm -rf /build/* diff --git a/Dockerfile.dev b/Dockerfile.dev index 81f2695..01aa2b7 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -65,7 +65,7 @@ RUN cd test && \ done # Build libunwind/libcxxabi/libcxx -COPY build-libcxx.sh merge-archives.sh ./ +COPY build-libcxx.sh ./ RUN ./build-libcxx.sh $TOOLCHAIN_PREFIX # Build C++ test applications diff --git a/build-libcxx.sh b/build-libcxx.sh index 72f0389..81681e1 100755 --- a/build-libcxx.sh +++ b/build-libcxx.sh @@ -66,7 +66,6 @@ if [ -n "$SYNC" ] || [ -n "$CHECKOUT_LIBCXX" ]; then fi LIBCXX=$(pwd)/libcxx -MERGE_ARCHIVES=$(pwd)/merge-archives.sh case $(uname) in MINGW*) @@ -125,7 +124,7 @@ build_all() { else # Merge libpsapi.a into the static library libunwind.a, to # avoid having to specify -lpsapi when linking to it. - $MERGE_ARCHIVES \ + llvm-ar qcsL \ $PREFIX/$arch-w64-mingw32/lib/libunwind.a \ $PREFIX/$arch-w64-mingw32/lib/libpsapi.a fi @@ -219,12 +218,12 @@ build_all() { make -j$CORES make install if [ "$type" = "shared" ]; then - $MERGE_ARCHIVES \ + llvm-ar qcsL \ $PREFIX/$arch-w64-mingw32/lib/libc++.dll.a \ $PREFIX/$arch-w64-mingw32/lib/libunwind.dll.a cp lib/libc++.dll $PREFIX/$arch-w64-mingw32/bin else - $MERGE_ARCHIVES \ + llvm-ar qcsL \ $PREFIX/$arch-w64-mingw32/lib/libc++.a \ $PREFIX/$arch-w64-mingw32/lib/libunwind.a fi diff --git a/merge-archives.sh b/merge-archives.sh deleted file mode 100755 index e6d455a..0000000 --- a/merge-archives.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -set -e - -if [ $# -lt 2 ]; then - echo $0 lib add1 [add2...] - exit 1 -fi - -: ${AR:=llvm-ar} -: ${RANLIB:=llvm-ranlib} - -SCRIPT=merge.mri -OUT=tmp.a -TARGET=$1 - -rm -f $SCRIPT - -echo "CREATE $OUT" >> $SCRIPT -while [ $# -gt 0 ]; do - case $(uname) in - MINGW*) - echo "ADDLIB $(cygpath -w $1)" >> $SCRIPT - ;; - *) - echo "ADDLIB $1" >> $SCRIPT - ;; - esac - shift -done -echo "SAVE" >> $SCRIPT -echo "END" >> $SCRIPT -$AR -M < $SCRIPT -rm -f $SCRIPT -$RANLIB $OUT -mv $OUT $TARGET