20
20
21
21
def _impl (ctx ):
22
22
toolchain_identifier = "osxcross"
23
- compiler = "gcc "
23
+ compiler = "clang "
24
24
abi_version = "darwin_x86_64"
25
25
abi_libc_version = "darwin_x86_64"
26
26
install = "/usr/x86_64-apple-darwin/"
@@ -31,12 +31,12 @@ def _impl(ctx):
31
31
osxcross_binprefix = osxcross + "bin/x86_64-apple-darwin14-"
32
32
sdkroot = osxcross + "SDK/MacOSX10.10.sdk/"
33
33
cross_system_include_dirs = [
34
- # "/usr/lib/clang/10.0.0/include",
34
+ "/usr/lib/clang/10.0.0/include" ,
35
35
osxcross + "include" ,
36
36
sdkroot + "usr/include" ,
37
- sdkroot + "usr/include/c++/v1/" ,
38
37
]
39
38
cross_system_lib_dirs = [
39
+ "/usr/x86_64-apple-darwin/lib" ,
40
40
sdkroot + "usr/lib" ,
41
41
osxcross + "/lib" ,
42
42
]
@@ -57,7 +57,7 @@ def _impl(ctx):
57
57
flag_groups = [
58
58
flag_group (
59
59
flags = [
60
- "-isysroot " + sdkroot ,
60
+ "-stdlib=libc++" ,
61
61
"-no-canonical-prefixes" ,
62
62
"-Wno-builtin-macro-redefined" ,
63
63
"-D__DATE__=\" redacted\" " ,
@@ -85,6 +85,7 @@ def _impl(ctx):
85
85
flag_group (
86
86
flags = [
87
87
"-mlinker-version=400" ,
88
+ "-B " + osxcross + "bin" ,
88
89
"-nostdinc" ,
89
90
"-U_FORTIFY_SOURCE" ,
90
91
"-fstack-protector" ,
@@ -134,7 +135,6 @@ def _impl(ctx):
134
135
flag_groups = [
135
136
flag_group (
136
137
flags = [
137
- #"-target x86_64-apple-darwin-macho",
138
138
"-v" ,
139
139
"-lm" ,
140
140
"-no-canonical-prefixes" ,
@@ -180,22 +180,6 @@ def _impl(ctx):
180
180
],
181
181
)
182
182
183
- sysroot_feature = feature (
184
- name = "sysroot" ,
185
- enabled = True ,
186
- flag_sets = [
187
- flag_set (
188
- actions = ALL_COMPILE_ACTIONS + ALL_LINK_ACTIONS ,
189
- flag_groups = [
190
- flag_group (
191
- expand_if_available = "sysroot" ,
192
- flags = ["--sysroot=%{sysroot}" ],
193
- ),
194
- ],
195
- ),
196
- ],
197
- )
198
-
199
183
coverage_feature = feature (
200
184
name = "coverage" ,
201
185
flag_sets = [
@@ -227,7 +211,6 @@ def _impl(ctx):
227
211
default_compile_flags_feature ,
228
212
objcopy_embed_flags_feature ,
229
213
user_compile_flags_feature ,
230
- #sysroot_feature,
231
214
coverage_feature ,
232
215
]
233
216
@@ -237,7 +220,6 @@ def _impl(ctx):
237
220
tool_path (name = "dwp" , path = "/usr/bin/dwp" ),
238
221
tool_path (name = "gcov" , path = "/usr/bin/gcov" ),
239
222
tool_path (name = "nm" , path = osxcross_binprefix + "nm" ),
240
- #tool_path(name = "objcopy", path = "/usr/bin/objcopy"),
241
223
tool_path (name = "objdump" , path = osxcross_binprefix + "ObjectDump" ),
242
224
tool_path (name = "strip" , path = osxcross_binprefix + "strip" ),
243
225
tool_path (name = "gcc" , path = osxcross + "bin/o64-clang" ),
@@ -249,7 +231,6 @@ def _impl(ctx):
249
231
features = features ,
250
232
abi_version = abi_version ,
251
233
abi_libc_version = abi_libc_version ,
252
- #builtin_sysroot = sysroot,
253
234
compiler = compiler ,
254
235
cxx_builtin_include_directories = cross_system_include_dirs ,
255
236
host_system_name = "x86_64-unknown-linux-gnu" ,
@@ -267,4 +248,4 @@ osx_cc_toolchain_config = rule(
267
248
"stdlib" : attr .string (),
268
249
},
269
250
provides = [CcToolchainConfigInfo ],
270
- )
251
+ )
0 commit comments