File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -314,5 +314,35 @@ fn is_gnu_time64_abi() -> bool {
314
314
}
315
315
Err ( _) => panic ! ( "CARGO_CFG_TARGET_POINTER_WIDTH not set" ) ,
316
316
} ;
317
+ // At this point, we _know_ it is *-*-linux-gnu* with 32 bit
318
+ // pointers. Some 64 bit arch still have 32 bit pointers though.
319
+ match env:: var ( "TARGET" ) {
320
+ Ok ( target) => {
321
+ // x86_64-unknown-linux-gnux32 and similar
322
+ if target. contains ( "x86_64" ) && target. contains ( "x32" ) {
323
+ return false ;
324
+ }
325
+ }
326
+ Err ( _) => panic ! ( "TARGET not set" ) ,
327
+ }
328
+ // let _arch = match env::var("CARGO_CFG_TARGET_ARCH") {
329
+ // Ok(arch) => match &arch[..] {
330
+ // "aarch64" | "loongarch64" | "mips64" | "mips64r6" | "powerpc64" | "riscv64"
331
+ // | "s390x" | "sparc64" | "x86_64"
332
+ // if ptrbits == "32" =>
333
+ // {
334
+ // panic!(
335
+ // "Unexpected 32 bit pointer arch {} target {}",
336
+ // arch,
337
+ // &env::var("TARGET").unwrap()
338
+ // );
339
+ // }
340
+ // // "x86_64" => {
341
+ // // return false;
342
+ // // }
343
+ // _ => arch,
344
+ // },
345
+ // Err(_) => panic!("CARGO_CFG_TARGET_ARCH not set"),
346
+ // };
317
347
return true ;
318
348
}
You can’t perform that action at this time.
0 commit comments