[libcxx-commits] [PATCH] D121164: [libcxx] [ci] Check that Windows static libraries don't contain dllexports

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 7 14:13:23 PST 2022


mstorsjo created this revision.
mstorsjo added a reviewer: ldionne.
Herald added a subscriber: arichardson.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121164

Files:
  libcxx/utils/ci/run-buildbot


Index: libcxx/utils/ci/run-buildbot
===================================================================
--- libcxx/utils/ci/run-buildbot
+++ libcxx/utils/ci/run-buildbot
@@ -143,6 +143,14 @@
     ${NINJA} -vC "${BUILD_DIR}" check-cxx-benchmarks
 }
 
+function check-static-dllexports() {
+    echo "+++ Inspecting the built library"
+    if llvm-readobj --coff-directives "$1" | grep -i "export:" > /dev/null; then
+        echo "Static library $1 in ${BUILDER} configuration contains dllexport directives"
+        exit 1
+    fi
+}
+
 # Print the version of a few tools to aid diagnostics in some cases
 ${CMAKE} --version
 ${NINJA} --version
@@ -584,6 +592,8 @@
                               -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-clangcl.cfg.in"
     echo "+++ Running the libc++ tests"
     ${NINJA} -vC "${BUILD_DIR}" check-cxx
+    # TODO: The static library does contain dllexports here.
+    # check-static-dllexports "${BUILD_DIR}/lib/libc++.lib"
 ;;
 clang-cl-static)
     clean
@@ -591,6 +601,7 @@
                               -DLIBCXX_TEST_CONFIG="llvm-libc++-static-clangcl.cfg.in"
     echo "+++ Running the libc++ tests"
     ${NINJA} -vC "${BUILD_DIR}" check-cxx
+    check-static-dllexports "${BUILD_DIR}/lib/libc++.lib"
 ;;
 mingw-dll)
     clean
@@ -606,6 +617,8 @@
           -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
     echo "+++ Running the libc++ tests"
     ${NINJA} -vC "${BUILD_DIR}" check-cxx
+    # TODO: The static library does contain dllexports here.
+    # check-static-dllexports "${BUILD_DIR}/lib/libc++.a"
 ;;
 mingw-static)
     clean
@@ -618,6 +631,7 @@
           -DLIBUNWIND_ENABLE_SHARED=OFF
     echo "+++ Running the libc++ tests"
     ${NINJA} -vC "${BUILD_DIR}" check-cxx
+    check-static-dllexports "${BUILD_DIR}/lib/libc++.a"
 ;;
 aix)
     export CC=ibm-clang


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121164.413632.patch
Type: text/x-patch
Size: 1828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220307/0273269b/attachment.bin>


More information about the libcxx-commits mailing list