llvm-project/libcxxabi
Petr Hosek 6971a166d9 [libcxxabi] 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/D61572

llvm-svn: 360004
2019-05-06 01:25:31 +00:00
..
cmake [libcxxabi][CMake] Drop unused HandleOutOfTreeLLVM include 2019-02-18 20:58:06 +00:00
fuzz add cxa_demangle_fuzzer 2016-12-28 03:28:29 +00:00
include Fix PR41465 - Use __builtin_mul_overflow instead of hand-rolled check. 2019-04-11 17:16:35 +00:00
lib
src [libcxxabi] Don't use -fvisibility-global-new-delete-hidden when not defining them 2019-05-06 01:25:31 +00:00
test Attempt to fix flaky tests. 2019-05-02 13:22:55 +00:00
www Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
.arcconfig [libcxxabi] Set up .arcconfig to point to new Diffusion CXXA repository 2017-12-04 23:14:03 +00:00
.clang-format Fully Reformat fallback_malloc.cpp 2017-03-04 03:23:15 +00:00
.gitignore .gitignore: ignore vim swap files 2015-12-04 02:15:02 +00:00
CMakeLists.txt [gn] Support for building libcxxabi 2019-05-02 17:29:39 +00:00
CREDITS.TXT Try again, this time with the correct address 2017-12-29 19:26:28 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00