mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
113 lines
4.1 KiB
Diff
113 lines
4.1 KiB
Diff
diff --git a/toolchain/BUILD.bazel b/toolchain/BUILD.bazel
|
|
index cb79620..218988c 100644
|
|
--- a/toolchain/BUILD.bazel
|
|
+++ b/toolchain/BUILD.bazel
|
|
@@ -1,4 +1,5 @@
|
|
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
|
|
+load("@bazel_skylib//lib:selects.bzl", "selects")
|
|
load("@bazel_skylib//rules:common_settings.bzl", "string_flag", "string_setting")
|
|
load("@rules_cc//cc/toolchains:actions.bzl", "cc_action_type_set")
|
|
load("@rules_cc//cc/toolchains:artifacts.bzl", "cc_artifact_name_pattern")
|
|
@@ -64,6 +65,24 @@ config_setting(
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
+config_setting(
|
|
+ name = "rusty_v8_custom_libcxx_disabled",
|
|
+ flag_values = {
|
|
+ "@@v8+//:v8_use_rusty_v8_custom_libcxx": "False",
|
|
+ },
|
|
+)
|
|
+
|
|
+# Only expose LLVM's libc++ headers for complete-runtime builds that do not opt
|
|
+# into rusty_v8's custom libc++.
|
|
+selects.config_setting_group(
|
|
+ name = "runtimes_all_without_rusty_v8_custom_libcxx",
|
|
+ match_all = [
|
|
+ ":runtimes_all",
|
|
+ ":rusty_v8_custom_libcxx_disabled",
|
|
+ ],
|
|
+ visibility = ["//visibility:public"],
|
|
+)
|
|
+
|
|
config_setting(
|
|
name = "runtimes_stage1",
|
|
flag_values = {
|
|
@@ -252,11 +271,16 @@ cc_args_list(
|
|
|
|
# TODO(cerisier): extract those into proper semantic args list.
|
|
# TODO(zbarsky): This must match llvm/toolchains/llvm.bzl
|
|
+_DEFAULT_CXXSTDLIB_HEADER_ARGS = select({
|
|
+ ":runtimes_all_without_rusty_v8_custom_libcxx": [
|
|
+ "//toolchain/args:cxxstdlib_headers_include_search_paths",
|
|
+ ],
|
|
+ "//conditions:default": [],
|
|
+})
|
|
+
|
|
cc_args_list(
|
|
name = "linux_toolchain_args",
|
|
- args = [
|
|
- "//toolchain/args:cxxstdlib_headers_include_search_paths",
|
|
- ] + select({
|
|
+ args = _DEFAULT_CXXSTDLIB_HEADER_ARGS + select({
|
|
"//platforms/config:musl": [
|
|
"//toolchain/args/linux:kernel_headers_include_search_paths",
|
|
"//toolchain/args/linux:musl_libc_headers_include_search_paths",
|
|
@@ -282,8 +306,7 @@ cc_args_list(
|
|
# TODO(zbarsky): This must match llvm/toolchains/llvm.bzl
|
|
cc_args_list(
|
|
name = "windows_toolchain_args",
|
|
- args = [
|
|
- "//toolchain/args:cxxstdlib_headers_include_search_paths",
|
|
+ args = _DEFAULT_CXXSTDLIB_HEADER_ARGS + [
|
|
"//toolchain/args/windows:mingw_headers_include_search_paths",
|
|
],
|
|
)
|
|
diff --git a/toolchain/llvm/llvm.bzl b/toolchain/llvm/llvm.bzl
|
|
index ffbc139..ad6aa20 100644
|
|
--- a/toolchain/llvm/llvm.bzl
|
|
+++ b/toolchain/llvm/llvm.bzl
|
|
@@ -219,18 +219,20 @@ def declare_llvm_targets(*, suffix = ""):
|
|
],
|
|
)
|
|
|
|
+ default_cxxstdlib_target_headers = select({
|
|
+ "@llvm//toolchain:runtimes_all_without_rusty_v8_custom_libcxx": [
|
|
+ "@llvm//runtimes/cxxstdlib:headers_include_search_directory",
|
|
+ "@llvm//runtimes/cxxstdlib:abi_headers_include_search_directory",
|
|
+ ],
|
|
+ "//conditions:default": [],
|
|
+ })
|
|
+
|
|
# This must match //toolchain:linux_toolchain_args
|
|
include_path(
|
|
name = "linux_target_headers",
|
|
srcs = [
|
|
":builtin_resource_dir",
|
|
- ] + select({
|
|
- "@llvm//toolchain:runtimes_all": [
|
|
- "@llvm//runtimes/cxxstdlib:headers_include_search_directory",
|
|
- "@llvm//runtimes/cxxstdlib:abi_headers_include_search_directory",
|
|
- ],
|
|
- "//conditions:default": [],
|
|
- }) + [
|
|
+ ] + default_cxxstdlib_target_headers + [
|
|
"@kernel_headers//:kernel_headers_directory",
|
|
"@llvm//sanitizers:sanitizers_headers_include_search_directory",
|
|
] + select({
|
|
@@ -248,13 +250,7 @@ def declare_llvm_targets(*, suffix = ""):
|
|
name = "windows_target_headers",
|
|
srcs = [
|
|
":builtin_resource_dir",
|
|
- ] + select({
|
|
- "@llvm//toolchain:runtimes_all": [
|
|
- "@llvm//runtimes/cxxstdlib:headers_include_search_directory",
|
|
- "@llvm//runtimes/cxxstdlib:abi_headers_include_search_directory",
|
|
- ],
|
|
- "//conditions:default": [],
|
|
- }) + [
|
|
+ ] + default_cxxstdlib_target_headers + [
|
|
"@mingw//:mingw_generated_headers_crt_directory",
|
|
"@mingw//:mingw_w64_headers_include_directory",
|
|
"@mingw//:mingw_w64_headers_crt_directory",
|