diff options
author | Louis Dionne <ldionne@apple.com> | 2019-09-04 16:41:31 +0000 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2019-09-04 16:41:31 +0000 |
commit | 5afc5a6c1b98f0c93eb1f9902d96e13b58b54a0c (patch) | |
tree | 4dda27894954e9bf6067e3f7428571706caa303d /libcxx/src | |
parent | 912edafcf146353997a40466606b730d60f9f8d2 (diff) | |
download | bcm5719-llvm-5afc5a6c1b98f0c93eb1f9902d96e13b58b54a0c.tar.gz bcm5719-llvm-5afc5a6c1b98f0c93eb1f9902d96e13b58b54a0c.zip |
[libc++] Only build with -fvisibility=hidden on Clang
The visibility annotations in libc++ are not quite right for GCC, which
results in symbols not being exported when -fvisibility=hidden is used.
To fix the GCC build bots, this commit reverts to the previous state of
not building with hidden visibility on GCC.
In the future, we can build with hidden visibility all the time and
export symbols explicitly using a list. See https://llvm.org/D66970
for one take at this.
llvm-svn: 370926
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index 11c911ac2dc..93be30b597e 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -204,7 +204,13 @@ function(cxx_set_common_defines name) if(LIBCXX_CXX_ABI_HEADER_TARGET) add_dependencies(${name} ${LIBCXX_CXX_ABI_HEADER_TARGET}) endif() - target_compile_options(${name} PRIVATE -fvisibility=hidden) + # Our visibility annotations are not quite right for non-Clang compilers, + # so we end up not exporting all the symbols we should. In the future, we + # can improve the situation by providing an explicit list of exported + # symbols on all compilers. + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(${name} PRIVATE -fvisibility=hidden) + endif() if(WIN32 AND NOT MINGW) target_compile_definitions(${name} PRIVATE |