-
Notifications
You must be signed in to change notification settings - Fork 18.7k
[runtimes] Never define operator new in libc++ #218989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ | |
| # cmake -G Ninja ^ | ||
| # -DTOOLCHAIN_TARGET_TRIPLE=aarch64-unknown-linux-gnu ^ | ||
| # -DTOOLCHAIN_TARGET_SYSROOTFS=<path-to-develop-arm-linux-root-fs> ^ | ||
| # -DTOOLCHAIN_SHARED_LIBS=OFF ^ | ||
| # -DTOOLCHAIN_SHARED_LIBS=OFF ^ | ||
| # -DCMAKE_INSTALL_PREFIX=../install ^ | ||
| # -DCMAKE_CXX_FLAGS="-D__OPTIMIZE__" ^ | ||
| # -DREMOTE_TEST_HOST="<hostname>" ^ | ||
|
|
@@ -205,21 +205,19 @@ set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_COMPILER_RT_CXX_LIBRARY | |
| # The compiler-rt tests disable the clang configuration files during the execution by setting CLANG_NO_DEFAULT_CONFIG=1 | ||
| # and drops out the --sysroot from there. Provide it explicity via the test flags here if target sysroot has been specified. | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_COMPILER_RT_TEST_COMPILER_CFLAGS "--stdlib=libc++ ${sysroot_flags}" CACHE STRING "") | ||
|
|
||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBUNWIND_ENABLE_SHARED ${TOOLCHAIN_SHARED_LIBS} CACHE BOOL "") | ||
|
|
||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_ENABLE_STATIC_UNWINDER ${TOOLCHAIN_USE_STATIC_LIBS} CACHE BOOL "") | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the default is |
||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXXABI_ENABLE_SHARED ${TOOLCHAIN_SHARED_LIBS} CACHE BOOL "") | ||
|
|
||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_SHARED ${TOOLCHAIN_SHARED_LIBS} CACHE BOOL "") | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ABI_VERSION ${LIBCXX_ABI_VERSION} CACHE STRING "") | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_CXX_ABI "libcxxabi" CACHE STRING "") #!!! | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vvereschaka I am assuming that this change would not impact your configuration, since you seem to be merging libc++abi into libc++. Do you have a mechanism to re-export |
||
| # Merge libc++ and libc++abi libraries into the single libc++ library file. | ||
| set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ${TOOLCHAIN_USE_STATIC_LIBS} CACHE BOOL "") | ||
| # Forcely disable the libc++ benchmarks on Windows build hosts | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -282,7 +282,6 @@ if(FUCHSIA_SDK) | |
| set(RUNTIMES_${target}+asan_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "") | ||
| set(RUNTIMES_${target}+asan_LLVM_USE_SANITIZER "Address" CACHE STRING "") | ||
| set(RUNTIMES_${target}+asan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
| set(RUNTIMES_${target}+asan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @petrhosek This should be a no-op for you since you were already turning this off so they can be overridden by the sanitizer versions. |
||
|
|
||
| set(RUNTIMES_${target}+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "") | ||
| set(RUNTIMES_${target}+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | ||
|
|
@@ -291,7 +290,6 @@ if(FUCHSIA_SDK) | |
| set(RUNTIMES_${target}+asan+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "") | ||
| set(RUNTIMES_${target}+asan+noexcept_LLVM_USE_SANITIZER "Address" CACHE STRING "") | ||
| set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
| set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
| set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | ||
| set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | ||
|
|
||
|
|
@@ -307,13 +305,11 @@ if(FUCHSIA_SDK) | |
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "") | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LLVM_USE_SANITIZER "HWAddress" CACHE STRING "") | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
|
|
||
| # HWASan+noexcept | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "") | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LLVM_USE_SANITIZER "HWAddress" CACHE STRING "") | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | ||
| set(RUNTIMES_aarch64-unknown-fuchsia+hwasan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -269,11 +269,9 @@ foreach(target ${LLVM_RUNTIME_TARGETS}) | |
|
|
||
| set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") | ||
| set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") | ||
| set(RUNTIMES_${target}_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vvereschaka Similarly here, this should only move |
||
|
|
||
| set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") | ||
| set(RUNTIMES_${target}_LIBCXX_CXX_ABI "libcxxabi" CACHE STRING "") #!!! | ||
| set(RUNTIMES_${target}_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "") | ||
|
|
||
|
|
||
| if (DEFINED TOOLCHAIN_SHARED_LIBS) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | |
| set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_LOCALIZATION ON CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_MONOTONIC_CLOCK ON CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jhuber6 Since you're already merging libc++abi into libc++, I don't think it matters where those operators are defined. |
||
| set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_RTTI OFF CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "") | ||
|
|
@@ -22,7 +21,6 @@ set(RUNTIMES_USE_LIBC "llvm-libc" CACHE STRING "") | |
| # Configuration options for libcxxabi. | ||
| set(LIBCXXABI_BAREMETAL ON CACHE BOOL "") | ||
| set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | ||
| set(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
| set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") | ||
| set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "") | ||
| set(LIBCXXABI_USE_LLVM_UNWINDER OFF CACHE BOOL "") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,4 @@ set(LIBCXX_ABI_VERSION "1" CACHE STRING "") | |
| set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "") | ||
| set(LIBCXX_CXX_ABI libcxxrt CACHE STRING "") | ||
| set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @emaste @jrtc27 This change is the only one in this patch that I expect to cause problems. FreeBSD currently defines
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit of a pain, but probably a maintenance task that is overdue. cc @davidchisnall for possible libcxxrt input. :)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add the missing ones to libcxxrt quite easily. We didn't because it's mostly used with libc++, which defined them and we regarded them as a small set to be used with things that didn't link a standard library. |
||
| set(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") # defined in libcxxrt | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | |
| set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_LOCALIZATION ON CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_MONOTONIC_CLOCK ON CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jhuber6 Same here: since libc++abi and libc++ are merged, I don't think it matters where the operators are defined. So I expect this change makes no visible difference. |
||
| set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_RTTI OFF CACHE BOOL "") | ||
| set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "") | ||
|
|
@@ -22,7 +21,6 @@ set(RUNTIMES_USE_LIBC "llvm-libc" CACHE STRING "") | |
| # Configuration options for libcxxabi. | ||
| set(LIBCXXABI_BAREMETAL ON CACHE BOOL "") | ||
| set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") | ||
| set(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") | ||
| set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") | ||
| set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "") | ||
| set(LIBCXXABI_USE_LLVM_UNWINDER OFF CACHE BOOL "") | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just re-stating the defaults, so this is a no-op.