@@ -1200,7 +1200,15 @@ void parseEnvironment()
12001200
12011201 // detect Model
12021202 auto model = env.setDefault(" MODEL" , detectModel);
1203- env[" MODEL_FLAG" ] = " -m" ~ env[" MODEL" ];
1203+ if (env.getDefault(" DFLAGS" , " " ).canFind(" -mtriple" , " -march" ))
1204+ {
1205+ // Don't pass `-m32|64` flag when explicitly passing triple or arch.
1206+ env[" MODEL_FLAG" ] = " " ;
1207+ }
1208+ else
1209+ {
1210+ env[" MODEL_FLAG" ] = " -m" ~ env[" MODEL" ];
1211+ }
12041212
12051213 // detect PIC
12061214 version (Posix )
@@ -1690,7 +1698,7 @@ string detectModel()
16901698 else
16911699 uname = [" uname" , " -m" ].execute.output;
16921700
1693- if (uname.canFind(" x86_64" , " amd64" , " 64-bit" , " 64-Bit" , " 64 bit" ))
1701+ if (uname.canFind(" x86_64" , " amd64" , " arm64 " , " 64-bit" , " 64-Bit" , " 64 bit" ))
16941702 return " 64" ;
16951703 if (uname.canFind(" i386" , " i586" , " i686" , " 32-bit" , " 32-Bit" , " 32 bit" ))
16961704 return " 32" ;
@@ -2348,31 +2356,5 @@ void copyAndTouch(const string from, const string to)
23482356 to.setTimes(now, now);
23492357}
23502358
2351- version (OSX )
2352- {
2353- // FIXME: Parallel executions hangs reliably on Mac (esp. the 'macair'
2354- // host used by the autotester) for unknown reasons outside of this script.
2355- pragma (msg, " Warning: Syncing file access because of OSX!" );
2356-
2357- // Wrap standard library functions to ensure mutually exclusive file access
2358- alias readText = fileAccess! (std.file.readText , string );
2359- alias writeText = fileAccess! (std.file.write , string , string );
2360- alias timeLastModified = fileAccess! (std.file.timeLastModified , string );
2361-
2362- import core.sync.mutex ;
2363- __gshared Mutex fileAccessMutex;
2364- shared static this () {
2365- fileAccessMutex = new Mutex ();
2366- }
2367-
2368- auto fileAccess (alias dg, T... )(T args)
2369- {
2370- fileAccessMutex.lock_nothrow();
2371- scope (exit) fileAccessMutex.unlock_nothrow();
2372- return dg (args);
2373- }
2374- }
2375- else
2376- {
2377- alias writeText = std.file.write ;
2378- }
2359+ // Wrap standard library functions
2360+ alias writeText = std.file.write ;
0 commit comments