llvm-project/libcxx
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
..
benchmarks [libc++][CMake] Refactor how we link against system libraries 2019-04-30 15:44:19 +00:00
cmake [libc++][CMake] Link against libSystem on Apple platforms 2019-05-02 17:43:48 +00:00
docs Implement midpoint for floating point types. Reviewed as https://reviews.llvm.org/D61014. 2019-04-25 12:11:43 +00:00
fuzzing Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
include [WebAssembly] WASI support for libcxx 2019-05-01 16:47:30 +00:00
lib [libcxx] Move CMake file to src, avoid using globs 2019-05-01 06:40:36 +00:00
src [libcxx] Don't use -fvisibility-global-new-delete-hidden when not defining them 2019-05-06 01:22:28 +00:00
test Mark is_trivially_destructible as unsupported with apple-clang-9 2019-05-03 17:26:17 +00:00
utils Fix permission error while running bots 2019-04-28 17:00:46 +00:00
www Implement LWG 2960: nonesuch is insufficiently useless 2019-04-30 00:54:38 +00:00
.arcconfig [libcxx] Set up .arcconfig to point to new Diffusion CXX repository 2017-12-04 17:55:28 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore
CMakeLists.txt [gn] Support for building libc++ 2019-05-02 17:29:41 +00:00
CREDITS.TXT Try again, this time with the correct address 2017-12-29 19:26:53 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
NOTES.TXT Reland "Use custom command and target to install libc++ headers" 2018-06-12 03:10:02 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00
appveyor-reqs-install.cmd Attempt to upgrade compiler used by appveyor builds 2019-04-03 20:40:01 +00:00
appveyor.yml disable appveyor config for MSVC 2015 2019-04-03 20:36:51 +00:00