File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -474,6 +474,12 @@ mod c_system {
474474 output
475475 }
476476
477+ // This can be obtained by adding the line:
478+ // message(STATUS "All builtin supported architectures: ${ALL_BUILTIN_SUPPORTED_ARCH}")
479+ // to the bottom of compiler-rt/cmake/builtin-config-ix.cmake, then running
480+ // cmake and looking at the output.
481+ const ALL_SUPPORTED_ARCHES : & ' static str = "i386;x86_64;arm;armhf;armv6m;armv7m;armv7em;armv7;armv7s;armv7k;aarch64;hexagon;mips;mipsel;mips64;mips64el;powerpc64;powerpc64le;riscv32;riscv64;wasm32;wasm64" ;
482+
477483 // This function recreates the logic of getArchNameForCompilerRTLib,
478484 // defined in clang/lib/Driver/ToolChain.cpp.
479485 fn get_arch_name_for_compiler_rtlib ( ) -> String {
@@ -502,6 +508,10 @@ mod c_system {
502508 let target_os = env:: var ( "CARGO_CFG_TARGET_OS" ) . unwrap ( ) ;
503509 let compiler_rt_arch = get_arch_name_for_compiler_rtlib ( ) ;
504510
511+ if ALL_SUPPORTED_ARCHES . split ( ";" ) . find ( |x| * x == compiler_rt_arch) == None {
512+ return ;
513+ }
514+
505515 if let Ok ( clang) = env:: var ( "CLANG" ) {
506516 let output = success_output (
507517 "failed to find clang's compiler-rt" ,
You can’t perform that action at this time.
0 commit comments