This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Cygwin: Treat PROCESSOR_ARCHITECTURE_INTEL as running under WOW64 on ARM64


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5ed8f2354fd6476deb68845174f53fa8f13b42b7

commit 5ed8f2354fd6476deb68845174f53fa8f13b42b7
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Jul 12 15:28:13 2018 +0200

    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>

Diff:
---
 winsup/cygwin/path.cc | 33 ++++++++++++++++++++++++---------
 1 file 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"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]