llvm-project/libcxx/src
Petr Hosek 741f52ca62 [libcxx] Don't use -fvisibility-global-new-delete-hidden when not defining them
When builing the hermetic static library, the compiler switch
-fvisibility-global-new-delete-hidden is necessary to get the new and
delete operator definitions made correctly. However, when those
definitions are not included in the library, then this switch does harm.
With lld (though not all linkers) setting STV_HIDDEN on SHN_UNDEF
symbols makes it an error to leave them undefined or defined via dynamic
linking that should generate PLTs for -shared linking (lld makes this a
hard error even without -z defs). Though leaving the symbols undefined
would usually work in practice if the linker were to allow it (and the
user didn't pass -z defs), this actually indicates a real problem that
could bite some target configurations more subtly at runtime. For
example, x86-32 ELF -fpic code generation uses hidden visibility on
declarations in the caller's scope as a signal that the call will never
be resolved to a PLT entry and so doesn't have to meet the special ABI
requirements for PLT calls (setting %ebx). Since these functions might
actually be resolved to PLT entries at link time (we don't know what the
user is linking in when the hermetic library doesn't provide all the
symbols itself), it's not safe for the compiler to treat their
declarations at call sites as having hidden visibility.

Differential Revision: https://reviews.llvm.org/D61571

llvm-svn: 360003
2019-05-06 01:22:28 +00:00
..
experimental LWG 2843 "Unclear behavior of std::pmr::memory_resource::do_allocate()" 2019-03-09 00:38:19 +00:00
filesystem Handle cases where the dirent::d_type macros aren't defined 2019-02-01 23:52:17 +00:00
include [WebAssembly] WASI support for libcxx 2019-05-01 16:47:30 +00:00
support [libc++] Remove redundant conditionals for Apple platforms 2019-04-23 14:05:04 +00:00
CMakeLists.txt [libcxx] Don't use -fvisibility-global-new-delete-hidden when not defining them 2019-05-06 01:22:28 +00:00
algorithm.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
any.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
bind.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
charconv.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
chrono.cpp Fix typo that I introduced in r357413. Thanks to ensadc@mailnesia.com for the catch. 2019-04-02 14:00:36 +00:00
condition_variable.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
debug.cpp [libc++] Use the no_destroy attribute to avoid destroying debug DB statics 2019-04-17 18:20:19 +00:00
exception.cpp [libc++] Remove redundant conditionals for Apple platforms 2019-04-23 14:05:04 +00:00
functional.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
future.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
hash.cpp [libc++] Avoid UB in the no-exceptions mode in a few places 2019-02-12 16:06:02 +00:00
ios.cpp [libc++] Avoid UB in the no-exceptions mode in a few places 2019-02-12 16:06:02 +00:00
iostream.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
locale.cpp [libc++] Avoid UB in the no-exceptions mode in a few places 2019-02-12 16:06:02 +00:00
memory.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
mutex.cpp Fix r359229 which tried to fix r359159... 2019-04-26 05:04:33 +00:00
new.cpp [libc++][CMake] Remove unnecessary conditional for defining new handlers 2019-04-17 21:57:49 +00:00
optional.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
random.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
regex.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
shared_mutex.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
stdexcept.cpp Fix ABI compatibility of `<stdexcept>` with VCRuntime. 2019-03-06 20:31:57 +00:00
string.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
strstream.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
system_error.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
thread.cpp [WebAssembly] WASI support for libcxx 2019-05-01 16:47:30 +00:00
typeinfo.cpp [libc++] Remove redundant conditionals for Apple platforms 2019-04-23 14:05:04 +00:00
utility.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
valarray.cpp Remove incorrect explicit instantiation declarations for valarray 2019-04-25 21:31:58 +00:00
variant.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
vector.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00