@@ -54,22 +54,18 @@ CROSSTOOL_DEFAULT_WARNINGS = [
54
54
"-Wall" ,
55
55
]
56
56
57
- def _impl (ctx ):
57
+ def _emscripten_cc_toolchain_config (ctx ):
58
58
target_cpu = ctx .attr .cpu
59
59
toolchain_identifier = "emscripten-" + target_cpu
60
60
target_system_name = target_cpu + "-unknown-emscripten"
61
61
62
- host_system_name = "i686-unknown-linux-gnu"
63
-
64
62
target_libc = "musl/js"
65
63
66
64
abi_version = "emscripten_syscalls"
67
65
68
66
compiler = "emscripten"
69
67
abi_libc_version = "default"
70
68
71
- cc_target_os = "emscripten"
72
-
73
69
emscripten_dir = ctx .attr .emscripten_binaries .label .workspace_root
74
70
75
71
builtin_sysroot = emscripten_dir + "/emscripten/cache/sysroot"
@@ -150,8 +146,9 @@ def _impl(ctx):
150
146
flag_sets = [
151
147
flag_set (
152
148
flag_groups = [
149
+ flag_group (flags = ["rcsD" ]),
153
150
flag_group (
154
- flags = ["rcsD" , " %{output_execpath}" ],
151
+ flags = ["%{output_execpath}" ],
155
152
expand_if_available = "output_execpath" ,
156
153
),
157
154
],
@@ -323,11 +320,11 @@ def _impl(ctx):
323
320
implies = ["crosstool_cpu_" + target_cpu ],
324
321
),
325
322
feature (
326
- name = "crosstool_cpu_asmjs " ,
323
+ name = "crosstool_cpu_wasm64 " ,
327
324
provides = ["variant:crosstool_cpu" ],
328
325
),
329
326
feature (
330
- name = "crosstool_cpu_wasm " ,
327
+ name = "crosstool_cpu_wasm32 " ,
331
328
provides = ["variant:crosstool_cpu" ],
332
329
),
333
330
@@ -409,7 +406,6 @@ def _impl(ctx):
409
406
feature (name = "emcc_debug_link" ),
410
407
feature (
411
408
name = "llvm_backend" ,
412
- requires = [feature_set (features = ["crosstool_cpu_wasm" ])],
413
409
enabled = True ,
414
410
),
415
411
@@ -523,8 +519,8 @@ def _impl(ctx):
523
519
# Emscripten-specific settings:
524
520
flag_set (
525
521
actions = all_compile_actions + all_link_actions ,
526
- flags = ["-s" , "WASM=0 " ],
527
- features = ["crosstool_cpu_asmjs " ],
522
+ flags = ["-s" , "MEMORY64=1 " ],
523
+ features = ["crosstool_cpu_wasm64 " ],
528
524
),
529
525
flag_set (
530
526
actions = all_compile_actions +
@@ -1087,7 +1083,6 @@ def _impl(ctx):
1087
1083
artifact_name_patterns = artifact_name_patterns ,
1088
1084
cxx_builtin_include_directories = cxx_builtin_include_directories ,
1089
1085
toolchain_identifier = toolchain_identifier ,
1090
- host_system_name = host_system_name ,
1091
1086
target_system_name = target_system_name ,
1092
1087
target_cpu = target_cpu ,
1093
1088
target_libc = target_libc ,
@@ -1097,15 +1092,14 @@ def _impl(ctx):
1097
1092
tool_paths = tool_paths ,
1098
1093
make_variables = make_variables ,
1099
1094
builtin_sysroot = builtin_sysroot ,
1100
- cc_target_os = cc_target_os ,
1101
1095
)
1102
1096
1103
- emscripten_cc_toolchain_config_rule = rule (
1104
- implementation = _impl ,
1097
+ emscripten_cc_toolchain_config = rule (
1098
+ implementation = _emscripten_cc_toolchain_config ,
1105
1099
attrs = {
1106
- "cpu" : attr .string (mandatory = True , values = ["asmjs " , "wasm " ]),
1100
+ "cpu" : attr .string (mandatory = True , values = ["wasm32 " , "wasm64 " ]),
1107
1101
"em_config" : attr .label (mandatory = True , allow_single_file = True ),
1108
- "emscripten_binaries" : attr .label (mandatory = True ),
1102
+ "emscripten_binaries" : attr .label (mandatory = True , cfg = "exec" ),
1109
1103
"script_extension" : attr .string (mandatory = True , values = ["sh" , "bat" ]),
1110
1104
},
1111
1105
provides = [CcToolchainConfigInfo ],
0 commit comments