diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2018-07-12 15:28:13 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2018-07-12 15:28:13 +0200 |
commit | 5ed8f2354fd6476deb68845174f53fa8f13b42b7 (patch) | |
tree | ddc6ee7760ba894a084acb4b598033a38f820d7c | |
parent | 430b52911102a2ee48f1857954f2aeacc5b56dc6 (diff) | |
download | newlib-5ed8f2354fd6476deb68845174f53fa8f13b42b7.zip newlib-5ed8f2354fd6476deb68845174f53fa8f13b42b7.tar.gz newlib-5ed8f2354fd6476deb68845174f53fa8f13b42b7.tar.bz2 |
Cygwin: Treat PROCESSOR_ARCHITECTURE_INTEL as running under WOW64 on ARM64
Bug in current ARM64 WOW64: GetNativeSystemInfo returns
PROCESSOR_ARCHITECTURE_INTEL rather than PROCESSOR_ARCHITECTURE_ARM64.
Provide for this.
Make code better readable.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/path.cc | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 3936b10..6d8f76d 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -4306,19 +4306,34 @@ find_fast_cwd () fcwd_access_t **f_cwd_ptr = find_fast_cwd_pointer (); if (!f_cwd_ptr) { + bool warn = 1; + #ifndef __x86_64__ -#ifndef PROCESSOR_ARCHITECTURE_ARM64 -#define PROCESSOR_ARCHITECTURE_ARM64 12 -#endif + #ifndef PROCESSOR_ARCHITECTURE_ARM64 + #define PROCESSOR_ARCHITECTURE_ARM64 12 + #endif + SYSTEM_INFO si; /* Check if we're running in WOW64 on ARM64. Skip the warning as long as - there's no solution for finding the FAST_CWD pointer on that system. */ - if (wincap.is_wow64 () - && (GetNativeSystemInfo (&si), - si.wProcessorArchitecture != PROCESSOR_ARCHITECTURE_ARM64)) -#endif - small_printf ("Cygwin WARNING:\n" + there's no solution for finding the FAST_CWD pointer on that system. + + 2018-07-12: Apparently current ARM64 WOW64 has a bug: + It's GetNativeSystemInfo returns PROCESSOR_ARCHITECTURE_INTEL in + wProcessorArchitecture. Since that's an invalid value (a 32 bit + host system hosting a 32 bit emulator for itself?) we can use this + value as an indicator to skip the message as well. */ + if (wincap.is_wow64 ()) + { + GetNativeSystemInfo (&si); + if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64 + || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) + warn = 0; + } +#endif /* !__x86_64__ */ + + if (warn) + small_printf ("Cygwin WARNING:\n" " Couldn't compute FAST_CWD pointer. This typically occurs if you're using\n" " an older Cygwin version on a newer Windows. Please update to the latest\n" " available Cygwin version from https://cygwin.com/. If the problem persists,\n" |