-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated rollback of commit 48881f1.
*** Reason for rollback *** Broke a test *** Original change description *** The auto-configured toolchains provided by Bazel itself have diverged heavily from the version maintained in this repo. There is no need to maintain this duplication until Starlarkification has progressed succiciently for rules_cc to be the source of truth for them. This is particularly relevant for Bzlmod, which currently uses the toolchains defined in rules_cc. As a result, Bazel C++ builds will use subtly different toolchains depending on whether --enable_bzlmod is used or not. This is fixed... *** PiperOrigin-RevId: 501228335 Change-Id: I858dc3ea44df7ae70b5603f6dc2e082b4540c42a
- Loading branch information
1 parent
48881f1
commit bc665f9
Showing
32 changed files
with
7,737 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,100 @@ | ||
load("//cc:defs.bzl", "cc_flags_supplier", "cc_library", "compiler_flag") | ||
|
||
# Copyright 2018 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
licenses(["notice"]) # Apache 2.0 | ||
|
||
# It is frequently necessary to constrain platforms based on the cc compiler type. | ||
constraint_setting(name = "cc_compiler") | ||
|
||
constraint_value( | ||
name = "clang", | ||
constraint_setting = ":cc_compiler", | ||
) | ||
|
||
constraint_value( | ||
name = "gcc", | ||
constraint_setting = ":cc_compiler", | ||
) | ||
|
||
constraint_value( | ||
name = "msvc", | ||
constraint_setting = ":cc_compiler", | ||
) | ||
|
||
constraint_value( | ||
name = "clang-cl", | ||
constraint_setting = ":cc_compiler", | ||
) | ||
|
||
constraint_value( | ||
name = "mingw", | ||
constraint_setting = ":cc_compiler", | ||
) | ||
|
||
constraint_value( | ||
name = "msys", | ||
constraint_setting = ":cc_compiler", | ||
) | ||
|
||
cc_library( | ||
name = "malloc", | ||
) | ||
|
||
filegroup( | ||
name = "grep-includes", | ||
srcs = ["grep-includes.sh"], | ||
) | ||
|
||
filegroup( | ||
name = "empty", | ||
srcs = [], | ||
) | ||
|
||
filegroup( | ||
name = "bzl_srcs", | ||
srcs = glob(["**/*.bzl"]), | ||
) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["**"]), | ||
) | ||
|
||
filegroup( | ||
name = "interface_library_builder", | ||
srcs = ["build_interface_so"], | ||
) | ||
|
||
filegroup( | ||
name = "osx_wrapper", | ||
srcs = ["osx_cc_wrapper.sh"], | ||
) | ||
|
||
filegroup( | ||
name = "link_dynamic_library", | ||
srcs = ["link_dynamic_library.sh"], | ||
) | ||
|
||
filegroup( | ||
name = "lib_cc_configure", | ||
srcs = ["lib_cc_configure.bzl"], | ||
) | ||
|
||
compiler_flag(name = "compiler") | ||
|
||
cc_flags_supplier(name = "cc_flags") |
This file contains 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,52 @@ | ||
# Copyright 2018 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load(":cc_toolchain_config.bzl", "cc_toolchain_config") | ||
|
||
cc_library( | ||
name = "malloc", | ||
) | ||
|
||
filegroup( | ||
name = "empty", | ||
srcs = [], | ||
) | ||
|
||
cc_toolchain_suite( | ||
name = "toolchain", | ||
toolchains = { | ||
"local": ":local", | ||
"local|local": ":local", | ||
}, | ||
) | ||
|
||
cc_toolchain( | ||
name = "local", | ||
all_files = ":empty", | ||
ar_files = ":empty", | ||
as_files = ":empty", | ||
compiler_files = ":empty", | ||
dwp_files = ":empty", | ||
linker_files = ":empty", | ||
objcopy_files = ":empty", | ||
strip_files = ":empty", | ||
toolchain_config = ":local_config", | ||
toolchain_identifier = "local", | ||
) | ||
|
||
cc_toolchain_config(name = "local_config") |
This file contains 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,112 @@ | ||
# Copyright 2018 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This becomes the BUILD file for @local_config_cc// under FreeBSD. | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite") | ||
load(":cc_toolchain_config.bzl", "cc_toolchain_config") | ||
|
||
cc_library( | ||
name = "malloc", | ||
) | ||
|
||
filegroup( | ||
name = "empty", | ||
srcs = [], | ||
) | ||
|
||
# Hardcoded toolchain, legacy behaviour. | ||
cc_toolchain_suite( | ||
name = "toolchain", | ||
toolchains = { | ||
"armeabi-v7a": ":cc-compiler-armeabi-v7a", | ||
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a", | ||
"freebsd": ":cc-compiler-freebsd", | ||
"freebsd|compiler": ":cc-compiler-freebsd", | ||
}, | ||
) | ||
|
||
cc_toolchain( | ||
name = "cc-compiler-freebsd", | ||
all_files = ":empty", | ||
ar_files = ":empty", | ||
as_files = ":empty", | ||
compiler_files = ":empty", | ||
dwp_files = ":empty", | ||
linker_files = ":empty", | ||
objcopy_files = ":empty", | ||
strip_files = ":empty", | ||
supports_param_files = 0, | ||
toolchain_config = ":local_freebsd", | ||
toolchain_identifier = "local_freebsd", | ||
) | ||
|
||
cc_toolchain_config( | ||
name = "local_freebsd", | ||
cpu = "freebsd", | ||
) | ||
|
||
toolchain( | ||
name = "cc-toolchain-freebsd", | ||
exec_compatible_with = [ | ||
"@platforms//cpu:x86_64", | ||
"@platforms//os:freebsd", | ||
], | ||
target_compatible_with = [ | ||
"@platforms//cpu:x86_64", | ||
"@platforms//os:freebsd", | ||
], | ||
toolchain = ":cc-compiler-freebsd", | ||
toolchain_type = "@rules_cc//cc:toolchain_type", | ||
) | ||
|
||
cc_toolchain( | ||
name = "cc-compiler-armeabi-v7a", | ||
all_files = ":empty", | ||
ar_files = ":empty", | ||
as_files = ":empty", | ||
compiler_files = ":empty", | ||
dwp_files = ":empty", | ||
linker_files = ":empty", | ||
objcopy_files = ":empty", | ||
strip_files = ":empty", | ||
supports_param_files = 0, | ||
toolchain_config = ":stub_armeabi-v7a", | ||
toolchain_identifier = "stub_armeabi-v7a", | ||
) | ||
|
||
cc_toolchain_config( | ||
name = "stub_armeabi-v7a", | ||
cpu = "armeabi-v7a", | ||
) | ||
|
||
toolchain( | ||
name = "cc-toolchain-armeabi-v7a", | ||
exec_compatible_with = [ | ||
"@platforms//cpu:arm", | ||
], | ||
target_compatible_with = [ | ||
"@platforms//cpu:arm", | ||
"@platforms//os:android", | ||
], | ||
toolchain = ":cc-compiler-armeabi-v7a", | ||
toolchain_type = "@rules_cc//cc:toolchain_type", | ||
) | ||
|
||
filegroup( | ||
name = "link_dynamic_library", | ||
srcs = ["link_dynamic_library.sh"], | ||
) |
This file contains 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,20 @@ | ||
load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS") | ||
|
||
toolchain( | ||
name = "cc-toolchain-%{name}", | ||
exec_compatible_with = HOST_CONSTRAINTS, | ||
target_compatible_with = HOST_CONSTRAINTS, | ||
toolchain = "@local_config_cc//:cc-compiler-%{name}", | ||
toolchain_type = "@rules_cc//cc:toolchain_type", | ||
) | ||
|
||
toolchain( | ||
name = "cc-toolchain-armeabi-v7a", | ||
exec_compatible_with = HOST_CONSTRAINTS, | ||
target_compatible_with = [ | ||
"@platforms//cpu:arm", | ||
"@platforms//os:android", | ||
], | ||
toolchain = "@local_config_cc//:cc-compiler-armeabi-v7a", | ||
toolchain_type = "@rules_cc//cc:toolchain_type", | ||
) |
Oops, something went wrong.