summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/new-array-init.cpp
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-05-06 01:22:28 +0000
committerPetr Hosek <phosek@chromium.org>2019-05-06 01:22:28 +0000
commit741f52ca627e64fdc7298b656cb635faeda8c69f (patch)
tree0d75c652f239017b0b24c07e2730ad393005a88d /clang/test/CodeGenCXX/new-array-init.cpp
parentee1431072e3d139beef4aadd751bd9be0eb114c8 (diff)
downloadbcm5719-llvm-741f52ca627e64fdc7298b656cb635faeda8c69f.tar.gz
bcm5719-llvm-741f52ca627e64fdc7298b656cb635faeda8c69f.zip
[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
Diffstat (limited to 'clang/test/CodeGenCXX/new-array-init.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud