@@ -80,6 +80,15 @@ static DEFAULT_VARIABLE_UPDATES: LazyLock<BTreeMap<String, ReplacementEntry>> =
8080 to : "cc" . to_string ( ) ,
8181 } ,
8282 ) ,
83+ (
84+ "CC" . to_string ( ) ,
85+ ReplacementEntry {
86+ mode : ReplacementMode :: Partial {
87+ from : "/usr/bin/aarch64-linux-gnu-gcc" . to_string ( ) ,
88+ } ,
89+ to : "cc" . to_string ( ) ,
90+ } ,
91+ ) ,
8392 (
8493 "CXX" . to_string ( ) ,
8594 ReplacementEntry {
@@ -89,6 +98,15 @@ static DEFAULT_VARIABLE_UPDATES: LazyLock<BTreeMap<String, ReplacementEntry>> =
8998 to : "c++" . to_string ( ) ,
9099 } ,
91100 ) ,
101+ (
102+ "CXX" . to_string ( ) ,
103+ ReplacementEntry {
104+ mode : ReplacementMode :: Partial {
105+ from : "/usr/bin/x86_64-linux-gnu-g++" . to_string ( ) ,
106+ } ,
107+ to : "c++" . to_string ( ) ,
108+ } ,
109+ ) ,
92110 (
93111 "BLDSHARED" . to_string ( ) ,
94112 ReplacementEntry {
@@ -434,15 +452,36 @@ mod tests {
434452 let real_prefix = Path :: new ( "/real/prefix" ) ;
435453 let data = patch_sysconfigdata ( sysconfigdata, real_prefix) ;
436454
437- insta:: assert_snapshot!( data. to_string_pretty( ) ?, @r### "
455+ insta:: assert_snapshot!( data. to_string_pretty( ) ?, @r##"
438456 # system configuration generated and used by the sysconfig module
439457 build_time_vars = {
440458 "AR": "ar",
441- "CC": "cc -pthread",
442- "CXX": "c ++ -pthread",
459+ "CC": "clang -pthread",
460+ "CXX": "clang ++ -pthread",
443461 "PYTHON_BUILD_STANDALONE": 1
444462 }
445- "### ) ;
463+ "## ) ;
464+
465+ // Cross-compiles use GNU
466+ let sysconfigdata = [
467+ ( "CC" , "/usr/bin/aarch64-linux-gnu-gcc" ) ,
468+ ( "CXX" , "/usr/bin/x86_64-linux-gnu-g++" ) ,
469+ ]
470+ . into_iter ( )
471+ . map ( |( k, v) | ( k. to_string ( ) , Value :: String ( v. to_string ( ) ) ) )
472+ . collect :: < SysconfigData > ( ) ;
473+
474+ let real_prefix = Path :: new ( "/real/prefix" ) ;
475+ let data = patch_sysconfigdata ( sysconfigdata, real_prefix) ;
476+
477+ insta:: assert_snapshot!( data. to_string_pretty( ) ?, @r##"
478+ # system configuration generated and used by the sysconfig module
479+ build_time_vars = {
480+ "CC": "cc",
481+ "CXX": "c++",
482+ "PYTHON_BUILD_STANDALONE": 1
483+ }
484+ "## ) ;
446485
447486 Ok ( ( ) )
448487 }
0 commit comments