diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -42,4 +42,8 @@ API Changes ----------- -- ... +- By default, libc++abi will not include the definition for new and delete, + since those are provided in libc++. Vendors wishing to provide new and + delete in libc++abi can build the library with ``-DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON`` + to get back the old behavior. + diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -386,6 +386,10 @@ self.cxx.link_flags += ['-nostdlib'] self.configure_link_flags_cxx_library() self.configure_link_flags_abi_library() + # With GCC's linker, re-linking libc++ after libc++abi is necessary + # since libc++abi depends on new/delete, which is provided in libc++. + # With other linkers, this is redundant but harmless. + self.configure_link_flags_cxx_library() self.configure_extra_library_flags() elif self.cxx_stdlib_under_test == 'libstdc++': self.cxx.link_flags += ['-lstdc++fs', '-lm', '-pthread'] diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -72,13 +72,9 @@ library to try comparing the type_info names to see if they are equal \ instead." OFF) -# FIXME: This option should default to off. Unfortunatly GCC 4.9 fails to link -# programs to due undefined references to new/delete in libc++abi. Once this -# has been fixed or worked around the default value should be changed. -# See https://reviews.llvm.org/D68269 for more details. option(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS "Build libc++abi with definitions for operator new/delete. Normally libc++ - provides these definitions" ON) + provides these definitions" OFF) option(LIBCXXABI_BUILD_32_BITS "Build 32 bit libc++abi." ${LLVM_BUILD_32_BITS}) option(LIBCXXABI_INCLUDE_TESTS "Generate build targets for the libc++abi unit tests." ${LLVM_INCLUDE_TESTS}) set(LIBCXXABI_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING