-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] Return to using DYLD_LIBRARY_PATH for the system libc++ tests #98070
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2,656 changes: 2,656 additions & 0 deletions
2,656
libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.typedalloc.abilist
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2,690 changes: 2,690 additions & 0 deletions
2,690
libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.typedalloc.abilist
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Testing configuration for Apple's system libc++. | ||
# | ||
# This configuration differs from a normal LLVM shared library configuration in | ||
# that we must use DYLD_LIBRARY_PATH to run the tests against the just-built library, | ||
# since Apple's libc++ has an absolute install_name. | ||
# | ||
# We also don't use a per-target include directory layout, so we have only one | ||
# include directory for the libc++ headers. | ||
|
||
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') | ||
|
||
config.substitutions.append(('%{flags}', | ||
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '' | ||
)) | ||
config.substitutions.append(('%{compile_flags}', | ||
'-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support' | ||
)) | ||
config.substitutions.append(('%{link_flags}', | ||
'-nostdlib++ -L %{lib-dir} -lc++' | ||
)) | ||
config.substitutions.append(('%{exec}', | ||
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib-dir} -- ' | ||
)) | ||
|
||
config.stdlib = 'apple-libc++' | ||
|
||
import os, site | ||
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) | ||
import libcxx.test.params, libcxx.test.config | ||
libcxx.test.config.configure( | ||
libcxx.test.params.DEFAULT_PARAMETERS, | ||
libcxx.test.features.DEFAULT_FEATURES, | ||
config, | ||
lit_config | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
__ZdaPvmSt19__type_descriptor_t | ||
__ZdaPvRKSt9nothrow_tSt19__type_descriptor_t | ||
__ZdaPvSt19__type_descriptor_t | ||
__ZdlPvmSt19__type_descriptor_t | ||
__ZdlPvRKSt9nothrow_tSt19__type_descriptor_t | ||
__ZdlPvSt19__type_descriptor_t | ||
__ZnamRKSt9nothrow_tSt19__type_descriptor_t | ||
__ZnamSt19__type_descriptor_t | ||
__ZnwmRKSt9nothrow_tSt19__type_descriptor_t | ||
__ZnwmSt19__type_descriptor_t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// | ||
// These shims implement symbols that are present in the system libc++ on Apple platforms | ||
// but are not implemented in upstream libc++. This allows testing libc++ under a system | ||
// library configuration, which requires the just-built libc++ to be ABI compatible with | ||
// the system library it is replacing. | ||
// | ||
|
||
#include <cstddef> | ||
#include <new> | ||
|
||
namespace std { // purposefully not versioned, like align_val_t | ||
enum class __type_descriptor_t : unsigned long long; | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::__type_descriptor_t) { | ||
return ::operator new(__sz); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t& __nt, | ||
std::__type_descriptor_t) noexcept { | ||
return ::operator new(__sz, __nt); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::__type_descriptor_t) { | ||
return ::operator new[](__sz); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t& __nt, | ||
std::__type_descriptor_t) noexcept { | ||
return ::operator new(__sz, __nt); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::__type_descriptor_t) noexcept { | ||
return ::operator delete(__p); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t& __nt, | ||
std::__type_descriptor_t) noexcept { | ||
return ::operator delete(__p, __nt); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::__type_descriptor_t) noexcept { | ||
return ::operator delete[](__p); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t& __nt, | ||
std::__type_descriptor_t) noexcept { | ||
return ::operator delete[](__p, __nt); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz, std::__type_descriptor_t) noexcept { | ||
return ::operator delete(__p, __sz); | ||
} | ||
|
||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz, std::__type_descriptor_t) noexcept { | ||
return ::operator delete[](__p, __sz); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Testing configuration for Apple's system libc++abi. | ||
|
||
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') | ||
|
||
config.substitutions.append(('%{flags}', | ||
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '' | ||
)) | ||
config.substitutions.append(('%{compile_flags}', | ||
'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS ' + | ||
'-I %{libcxx}/test/support -I %{libcxx}/src' | ||
)) | ||
config.substitutions.append(('%{link_flags}', | ||
'-nostdlib++ -L %{lib} -lc++' | ||
)) | ||
config.substitutions.append(('%{exec}', | ||
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib} -- ' | ||
)) | ||
|
||
config.stdlib = 'apple-libc++' | ||
|
||
import os, site | ||
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils')) | ||
import libcxx.test.params, libcxx.test.config | ||
libcxx.test.config.configure( | ||
libcxx.test.params.DEFAULT_PARAMETERS, | ||
libcxx.test.features.DEFAULT_FEATURES, | ||
config, | ||
lit_config | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
From Mark: We could look into use
DYLD_INSERT_LIBRARIES
instead to preload a library that only contains the shims. That would make the fix a lot more localized.