From 89af3e6a710c5b3acde33f26801166a931b18a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 5 Nov 2021 14:37:06 +0200 Subject: [PATCH] Remove the workaround with the initial, dummy empty libunwind.a This reverts parts of commit e35ef3b7d796a174eeb35fc2595281a3285a38ea. This is now handled better upstream, since 7af584ed87cc6eddb6adbc451c90fb8867469e06 in llvm-project (November 5th 2021). --- build-compiler-rt.sh | 17 +---------------- build-libcxx.sh | 10 ---------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/build-compiler-rt.sh b/build-compiler-rt.sh index c9f335b..e9e677a 100755 --- a/build-compiler-rt.sh +++ b/build-compiler-rt.sh @@ -100,22 +100,7 @@ for arch in $ARCHS; do $BUILDCMD ${CORES+-j$CORES} $BUILDCMD install mkdir -p "$PREFIX/$arch-w64-mingw32/bin" - if [ -z "$SANITIZERS" ]; then - # Building builtins only. If libunwind isn't built yet, linking of any - # executable will still fail as we're using -unwindlib=libunwind. - # Therefore, create a dummy libunwind.a (unless there's a real - # libunwind installed already) to let linking succeed. - # - # This is a workaround to avoid needing to specify -unwindlib=none - # for all linking until libunwind has been built. This avoids - # needing to build libunwind right away (allowing building plain C - # executables already now) and avoids needing to pass -unwindlib=none - # when configuring the libunwind build. - if [ ! -f $PREFIX/$arch-w64-mingw32/lib/libunwind.a ] && [ ! -f $PREFIX/$arch-w64-mingw32/lib/libunwind.dll.a ]; then - # Create an archive, don't add any members. - llvm-ar rcs $PREFIX/$arch-w64-mingw32/lib/libunwind.a - fi - else + if [ -n "$SANITIZERS" ]; then mv "$PREFIX/lib/clang/$CLANG_VERSION/lib/windows/"*.dll "$PREFIX/$arch-w64-mingw32/bin" fi cd .. diff --git a/build-libcxx.sh b/build-libcxx.sh index 561ae00..8c1bbff 100755 --- a/build-libcxx.sh +++ b/build-libcxx.sh @@ -194,13 +194,3 @@ build_all() { # work when linking against the DLL, but not vice versa. [ -z "$BUILD_SHARED" ] || build_all shared [ -z "$BUILD_STATIC" ] || build_all static - -# Remove dummy placeholder libunwind.a. If we've built a static version, it -# already was overwritten with a proper one, but if only building a shared -# version, remove the dummy one to avoid surprises. -for arch in $ARCHS; do - # Only remove the file if it contains no members. - if [ -f $PREFIX/$arch-w64-mingw32/lib/libunwind.a ] && [ "$(llvm-ar t $PREFIX/$arch-w64-mingw32/lib/libunwind.a)" = "" ]; then - rm $PREFIX/$arch-w64-mingw32/lib/libunwind.a - fi -done