From 1843f1251517fe5bd6013b76cd8439fb85436a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 16 Jun 2021 11:42:08 +0300 Subject: [PATCH] build-libcxx: Stop setting one unnecessary visibility define Since libcxx includes libcxxabi with _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS defined, the libcxxabi declarations contain neither dllimport nor dllexport. Earlier, we didn't use to include the libcxxabi headers with _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS defined, but defining _LIBCXXABI_BUILDING_LIBRARY instead. This caused libcxxabi declarations to be marked dllexport. If any such functions would end up emitted as part of the libcxx object files, this would have been necessary to get them properly exported. In practice libcxxabi functions aren't generated while included in libcxx (they aren't templates and/or header inline functions), _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS gets defined by the cmake files, so we don't need to set this at all any longer. --- build-libcxx.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build-libcxx.sh b/build-libcxx.sh index ebc5a89..436c474 100755 --- a/build-libcxx.sh +++ b/build-libcxx.sh @@ -132,11 +132,6 @@ build_all() { [ -z "$CLEAN" ] || rm -rf build-$arch-$type mkdir -p build-$arch-$type cd build-$arch-$type - if [ "$type" = "shared" ]; then - LIBCXX_VISIBILITY_FLAGS="-D_LIBCXXABI_BUILDING_LIBRARY" - else - LIBCXX_VISIBILITY_FLAGS="" - fi cmake \ ${CMAKE_GENERATOR+-G} "$CMAKE_GENERATOR" \ -DCMAKE_BUILD_TYPE=Release \ @@ -166,7 +161,6 @@ build_all() { -DLIBCXX_CXX_ABI_LIBRARY_PATH=../../libcxxabi/build-$arch-$type/lib \ -DLIBCXX_LIBDIR_SUFFIX="" \ -DLIBCXX_INCLUDE_TESTS=FALSE \ - -DCMAKE_CXX_FLAGS="$LIBCXX_VISIBILITY_FLAGS" \ -DCMAKE_SHARED_LINKER_FLAGS="-lunwind" \ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=FALSE \ ..