@@ -110,7 +110,7 @@ def get_android_bin_path() -> Path:
110
110
111
111
112
112
def bind_gen (
113
- * , header_source : Path , output_file : Path , include_path : Path , dynamic_loading : bool
113
+ * , header_source : Path , output_file : Path , include_path : Path , dynamic_loading : bool
114
114
) -> None :
115
115
args = []
116
116
if dynamic_loading :
@@ -133,7 +133,7 @@ def bind_gen(
133
133
134
134
class Builder :
135
135
def __init__ (
136
- self , * , src_path : Path , build_profile : Profile , host_profile : Profile
136
+ self , * , src_path : Path , build_profile : Profile , host_profile : Profile
137
137
):
138
138
self .src_path = src_path
139
139
self .host_profile = host_profile
@@ -187,7 +187,9 @@ def _copy_includes(self, package_path: Path, depsConfig: DepsConfig) -> None:
187
187
# This is necessary on 64bit android archs, as Clang doesn't build them by default,
188
188
# and Google's NDK distribution doesn't take care of that either...
189
189
@staticmethod
190
- def _armerge_soft_float128_compiler_rt_builtins (compiler_rt_lib : Path , output_path : Path , env : dict [str , str ]):
190
+ def _armerge_soft_float128_compiler_rt_builtins (
191
+ compiler_rt_lib : Path , output_path : Path , env : dict [str , str ]
192
+ ) -> None :
191
193
f128_builtins = [
192
194
"__addtf3" ,
193
195
"__subtf3" ,
@@ -230,7 +232,7 @@ def _armerge_soft_float128_compiler_rt_builtins(compiler_rt_lib: Path, output_pa
230
232
"__multc3" ,
231
233
"__divtc3" ,
232
234
]
233
- keep_symbol_args = [e for sym_name in f128_builtins for e in ['-k' , sym_name ]]
235
+ keep_symbol_args = [e for sym_name in f128_builtins for e in ["-k" , sym_name ]]
234
236
235
237
tankerci .run (
236
238
"armerge" ,
@@ -243,7 +245,7 @@ def _armerge_soft_float128_compiler_rt_builtins(compiler_rt_lib: Path, output_pa
243
245
)
244
246
245
247
def _merge_all_libs (
246
- self , depsConfig : DepsConfig , package_path : Path , native_path : Path
248
+ self , depsConfig : DepsConfig , package_path : Path , native_path : Path
247
249
) -> None :
248
250
with tankerci .working_directory (package_path ):
249
251
env = os .environ .copy ()
@@ -266,18 +268,28 @@ def _merge_all_libs(
266
268
ndk_arch = NDK_ARCH_TARGETS [self .arch ]
267
269
android_lib_path = android_bin_path / f"../sysroot/usr/lib/{ ndk_arch } "
268
270
269
- # Starting with NDK r23, Google in its infinite wisdom has decided to make things more interesting
271
+ # Starting with NDK r23, Google in its infinite wisdom has decided to make things
272
+ # more interesting
270
273
# libgcc is gone, and now we use clang's libcxx and compiler-rt.
271
- # Unfortunately, the libcxx_static.a is currently missing soft float128 builtins for 64bit archs
272
- # (See https://reviews.llvm.org/D53608 and https://github.com/llvm/llvm-project/issues/51395)
274
+ # Unfortunately, the libcxx_static.a is currently missing soft float128 builtins
275
+ # for 64bit archs (See https://reviews.llvm.org/D53608 and
276
+ # https://github.com/llvm/llvm-project/issues/51395)
273
277
# It is possible to find those symbols in the separate libclang_rt.builtins libs
274
- # However, we can't pull in all of rt.builtins, or we will have duplicate symbols and fail linking
275
- if self .arch in ['x86_64' , 'armv8' ]:
278
+ # However, we can't pull in all of rt.builtins, or we will have duplicate symbols
279
+ # and fail linking
280
+ if self .arch in ["x86_64" , "armv8" ]:
276
281
compiler_rt_arch = CLANG_RT_ARCH_TARGETS [self .arch ]
277
- compiler_rt_dir = android_bin_path / f"../lib/clang/17/lib/linux/"
278
- compiler_rt_lib = compiler_rt_dir / f"libclang_rt.builtins-{ compiler_rt_arch } .a"
279
- out_path = cxx_package_libs / f"libclang_rt.builtins.float128-{ compiler_rt_arch } .a"
280
- self ._armerge_soft_float128_compiler_rt_builtins (compiler_rt_lib , out_path , env )
282
+ compiler_rt_dir = android_bin_path / "../lib/clang/17/lib/linux/"
283
+ compiler_rt_lib = (
284
+ compiler_rt_dir / f"libclang_rt.builtins-{ compiler_rt_arch } .a"
285
+ )
286
+ out_path = (
287
+ cxx_package_libs
288
+ / f"libclang_rt.builtins.float128-{ compiler_rt_arch } .a"
289
+ )
290
+ self ._armerge_soft_float128_compiler_rt_builtins (
291
+ compiler_rt_lib , out_path , env
292
+ )
281
293
282
294
for lib in android_lib_path .glob ("*.a" ):
283
295
# Rust already links some (non-C++) NDK libs, skip to avoid duplicate symbols
@@ -374,10 +386,10 @@ def _prepare_profile(self) -> None:
374
386
shutil .copyfile (native_path / "ctanker.rs" , mingw_path / "ctanker.rs" )
375
387
376
388
def prepare (
377
- self ,
378
- update : bool ,
379
- tanker_source : TankerSource ,
380
- tanker_ref : Optional [str ] = None ,
389
+ self ,
390
+ update : bool ,
391
+ tanker_source : TankerSource ,
392
+ tanker_ref : Optional [str ] = None ,
381
393
) -> None :
382
394
tanker_deployed_ref = tanker_ref
383
395
if tanker_source == TankerSource .DEPLOYED and not tanker_ref :
@@ -469,11 +481,11 @@ def test(self) -> None:
469
481
470
482
471
483
def prepare (
472
- tanker_source : TankerSource ,
473
- * ,
474
- profiles : List [Profile ],
475
- update : bool = False ,
476
- tanker_ref : Optional [str ] = None ,
484
+ tanker_source : TankerSource ,
485
+ * ,
486
+ profiles : List [Profile ],
487
+ update : bool = False ,
488
+ tanker_ref : Optional [str ] = None ,
477
489
) -> None :
478
490
build_profile = tankerci .conan .get_build_profile ()
479
491
for host_profile in profiles :
@@ -484,9 +496,9 @@ def prepare(
484
496
485
497
486
498
def build (
487
- * ,
488
- profiles : List [Profile ],
489
- test : bool = False ,
499
+ * ,
500
+ profiles : List [Profile ],
501
+ test : bool = False ,
490
502
) -> None :
491
503
build_profile = tankerci .conan .get_build_profile ()
492
504
if os .environ .get ("CI" ):
@@ -591,7 +603,7 @@ def main() -> None:
591
603
if args .command == "build" :
592
604
profiles = [Profile (p ) for p in args .profiles ]
593
605
with tankerci .conan .ConanContextManager (
594
- [args .remote , "conancenter" ], conan_home = user_home
606
+ [args .remote , "conancenter" ], conan_home = user_home
595
607
):
596
608
build (
597
609
profiles = profiles ,
@@ -601,7 +613,7 @@ def main() -> None:
601
613
deploy (args )
602
614
elif args .command == "prepare" :
603
615
with tankerci .conan .ConanContextManager (
604
- [args .remote , "conancenter" ], conan_home = user_home
616
+ [args .remote , "conancenter" ], conan_home = user_home
605
617
):
606
618
profiles = [Profile (p ) for p in args .profiles ]
607
619
prepare (
0 commit comments