File tree 3 files changed +22
-1
lines changed
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ cc_binary(
179
179
linkopts = LINK_OPTS ,
180
180
features = select ({
181
181
# This isn't possible on mac because there is no static library for lcrt0.o
182
- "@platforms//os:osx " : [],
182
+ "//build_defs:config_osx " : [],
183
183
# When cross-compiling we need to statically link all C++ libraries.
184
184
"//conditions:default" : ["fully_static_link" ],
185
185
}),
Original file line number Diff line number Diff line change 1
1
# Internal Starlark definitions for Protobuf.
2
2
3
+ load ("@bazel_skylib//lib:selects.bzl" , "selects" )
3
4
load ("@rules_cc//cc:defs.bzl" , starlark_cc_proto_library = "cc_proto_library" )
4
5
load ("@rules_pkg//:mappings.bzl" , "pkg_files" , "strip_prefix" )
5
6
load (":cc_proto_blacklist_test.bzl" , "cc_proto_blacklist_test" )
@@ -83,6 +84,25 @@ config_setting(
83
84
},
84
85
)
85
86
87
+ config_setting (
88
+ name = "config_osx_aarch64" ,
89
+ values = {"cpu" : "osx-aarch_64" },
90
+ )
91
+
92
+ config_setting (
93
+ name = "config_osx_x86_64" ,
94
+ values = {"cpu" : "osx-aarch_64" },
95
+ )
96
+
97
+ selects .config_setting_group (
98
+ name = "config_osx" ,
99
+ match_any = [
100
+ "@platforms//os:osx" ,
101
+ ":config_osx_aarch64" ,
102
+ ":config_osx_x86_64" ,
103
+ ]
104
+ )
105
+
86
106
# Internal testing:
87
107
88
108
starlark_cc_proto_library (
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ def _impl(ctx):
98
98
flags = [
99
99
"-B" + ctx .attr .linker_path ,
100
100
"-lstdc++" ,
101
+ "-lm" ,
101
102
"--target=" + ctx .attr .target_full_name ,
102
103
] + ctx .attr .extra_linker_flags ,
103
104
),
You can’t perform that action at this time.
0 commit comments