diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/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