@@ -12,9 +12,9 @@ def _impl(ctx):
12
12
tool_path (name = "cpp" , path = "run_konan_clang.sh" ),
13
13
tool_path (name = "ar" , path = "run_konan_ar.sh" ),
14
14
tool_path (name = "ld" , path = "/usr/bin/false" ),
15
- tool_path (name = "nm" , path = "/usr/bin/true " ),
16
- tool_path (name = "objdump" , path = "/usr/bin/true " ),
17
- tool_path (name = "strip" , path = "/usr/bin/true " ),
15
+ tool_path (name = "nm" , path = "/usr/bin/false " ),
16
+ tool_path (name = "objdump" , path = "/usr/bin/false " ),
17
+ tool_path (name = "strip" , path = "/usr/bin/false " ),
18
18
]
19
19
20
20
deps = ctx .var .get ("KONAN_DEPS" )
@@ -46,3 +46,42 @@ cc_toolchain_config = rule(
46
46
attrs = {},
47
47
provides = [CcToolchainConfigInfo ],
48
48
)
49
+
50
+ def _impl_exec_macos (ctx ):
51
+ tool_paths = [
52
+ tool_path (name = "gcc" , path = "run_konan_host_clang.sh" ),
53
+ tool_path (name = "cpp" , path = "run_konan_host_clang.sh" ),
54
+ tool_path (name = "ar" , path = "run_konan_host_ar.sh" ),
55
+ tool_path (name = "ld" , path = "/usr/bin/false" ),
56
+ tool_path (name = "nm" , path = "/usr/bin/true" ),
57
+ tool_path (name = "objdump" , path = "/usr/bin/true" ),
58
+ tool_path (name = "strip" , path = "/usr/bin/true" ),
59
+ ]
60
+
61
+ deps = ctx .var .get ("KONAN_DEPS" )
62
+ if not deps :
63
+ fail ("Set --define=KONAN_DEPS=/path/to/.konan/dependencies" )
64
+
65
+ return cc_common .create_cc_toolchain_config_info (
66
+ ctx = ctx ,
67
+ toolchain_identifier = "konan_exec_macos" ,
68
+ compiler = "clang" ,
69
+ host_system_name = "local" ,
70
+ target_system_name = "darwin" ,
71
+ target_cpu = "darwin" ,
72
+ abi_version = "none" ,
73
+ abi_libc_version = "none" ,
74
+ tool_paths = tool_paths ,
75
+ cxx_builtin_include_directories = [
76
+ deps + "/llvm-19-aarch64-macos-essentials-75/lib/clang/19/include" ,
77
+ deps + "/apple-llvm-20200714-macos-aarch64-essentials/lib/clang/11.1.0/include" ,
78
+ deps + "/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/sysroot/usr/include" ,
79
+ deps + "/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/include/" ,
80
+ ],
81
+ )
82
+
83
+ cc_toolchain_config_exec = rule (
84
+ implementation = _impl_exec_macos ,
85
+ attrs = {},
86
+ provides = [CcToolchainConfigInfo ],
87
+ )
0 commit comments