File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,14 @@ platform(
22
22
],
23
23
)
24
24
25
+ platform (
26
+ name = "none-x86_64" ,
27
+ constraint_values = [
28
+ "@platforms//os:none" ,
29
+ "@platforms//cpu:x86_64" ,
30
+ ],
31
+ )
32
+
25
33
platform (
26
34
name = "linux-aarch64" ,
27
35
constraint_values = [
Original file line number Diff line number Diff line change @@ -97,6 +97,14 @@ def cc_toolchain_config(
97
97
"clang" ,
98
98
"glibc_unknown" ,
99
99
),
100
+ "none-x86_64" : (
101
+ "clang-x86_64-none" ,
102
+ "k8" ,
103
+ "unknown" ,
104
+ "clang" ,
105
+ "unknown" ,
106
+ "unknown" ,
107
+ ),
100
108
"wasm32" : (
101
109
"clang-wasm32" ,
102
110
"wasm32" ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ SUPPORTED_TARGETS = [
20
20
("darwin" , "aarch64" ),
21
21
("none" , "wasm32" ),
22
22
("none" , "wasm64" ),
23
+ ("none" , "x86_64" ),
23
24
("wasip1" , "wasm32" ),
24
25
("wasip1" , "wasm64" ),
25
26
]
@@ -118,7 +119,7 @@ def os(rctx):
118
119
119
120
name = rctx .attr .exec_os
120
121
if name :
121
- if name in ("linux" , "darwin" ):
122
+ if name in ("linux" , "darwin" , "none" ):
122
123
return name
123
124
else :
124
125
fail ("Unsupported value for exec_os: %s" % name )
Original file line number Diff line number Diff line change @@ -300,9 +300,12 @@ def _cc_toolchain_str(
300
300
if exec_os == target_os and exec_arch == target_arch :
301
301
# For darwin -> darwin, we can use the macOS SDK path.
302
302
sysroot_path = _default_sysroot_path (rctx , exec_os )
303
+ elif target_os == "none" :
304
+ # If we are targeting bare metal, we don't need a sysroot.
305
+ sysroot_path = ""
303
306
else :
304
307
# We are trying to cross-compile without a sysroot, let's bail.
305
- # TODO: Are there situations where we can continue?
308
+ # TODO: Are there other situations where we can continue?
306
309
return ""
307
310
308
311
extra_files_str = "\" :internal-use-files\" "
@@ -323,6 +326,7 @@ def _cc_toolchain_str(
323
326
"linux-aarch64" : "aarch64-unknown-linux-gnu" ,
324
327
"linux-armv7" : "armv7-unknown-linux-gnueabihf" ,
325
328
"linux-x86_64" : "x86_64-unknown-linux-gnu" ,
329
+ "none-x86_64" : "x86_64-unknown-none" ,
326
330
"wasm32" : "wasm32-unknown-unknown" ,
327
331
"wasm64" : "wasm64-unknown-unknown" ,
328
332
"wasip1-wasm32" : "wasm32-wasip1" ,
You can’t perform that action at this time.
0 commit comments