[newlib-cygwin] cygcheck: expand common_apps list

2019-06-04 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5c2a3661c1aeefb0591ce46e8ab3274f0c6d9112

commit 5c2a3661c1aeefb0591ce46e8ab3274f0c6d9112
Author: Yaakov Selkowitz 
Date:   Thu May 23 11:47:36 2019 -0400

cygcheck: expand common_apps list

An increasing number of tools are being included in Windows which have the
same names as those included in Cygwin packages.  Indicating which one is
first in PATH can be helpful in diagnosing behavioural discrepencies
between them.

Also, fix the alphabetization of ssh.

Diff:
---
 winsup/utils/cygcheck.cc | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index d5972c0..2cc25d9 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -99,28 +99,43 @@ static common_apps[] = {
   {"awk", 0},
   {"bash", 0},
   {"cat", 0},
+  {"certutil", 0},
+  {"clinfo", 0},
+  {"comp", 0},
+  {"convert", 0},
   {"cp", 0},
   {"cpp", 1},
   {"crontab", 0},
+  {"curl", 0},
+  {"expand", 0},
   {"find", 0},
+  {"ftp", 0},
   {"gcc", 0},
   {"gdb", 0},
   {"grep", 0},
+  {"hostname", 0},
   {"kill", 0},
+  {"klist", 0},
   {"ld", 0},
   {"ls", 0},
   {"make", 0},
   {"mv", 0},
+  {"nslookup", 0},
   {"patch", 0},
   {"perl", 0},
+  {"replace", 0},
   {"rm", 0},
   {"sed", 0},
-  {"ssh", 0},
   {"sh", 0},
+  {"shutdown", 0},
+  {"sort", 0},
+  {"ssh", 0},
   {"tar", 0},
   {"test", 0},
+  {"timeout", 0},
   {"vi", 0},
   {"vim", 0},
+  {"whoami", 0},
   {0, 0}
 };


[newlib-cygwin] Cygwin: Allow accessing 48 bit address space in Windows 8.1 or later

2019-06-04 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e1254add73b1fb834933b38a5163d72c30c2330b

commit e1254add73b1fb834933b38a5163d72c30c2330b
Author: Corinna Vinschen 
Date:   Tue Jun 4 16:58:53 2019 +0200

Cygwin: Allow accessing 48 bit address space in Windows 8.1 or later

64 bit Windows started out with a 44 bit address space due to a
restriction of the AMD64 CPUs at the time.  Starting with Windows
8.1, these CPUs are not supported anymore and Windows switched to
the full 48 bit address space supported by AMD64.

Cygwin didn't follow suit yet so mmaps are still restricted to
the lower 44 bit address space.  Fix that by using a system-specific
upper address for mmap allocations, 44 bit up to Windows 8, 48 bit
starting with Windows 8.1.

While at it, move the heap by another 8 Gigs to leave some space
for a potential extension of DLL address space, and restrict the
mmap lower address so the heap can grow to 32 Gigs before colliding
with mmaps.

Diff:
---
 winsup/cygwin/heap.cc   | 6 +++---
 winsup/cygwin/mmap.cc   | 6 --
 winsup/cygwin/wincap.cc | 9 +
 winsup/cygwin/wincap.h  | 4 
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/winsup/cygwin/heap.cc b/winsup/cygwin/heap.cc
index e18cd55..b839c8c 100644
--- a/winsup/cygwin/heap.cc
+++ b/winsup/cygwin/heap.cc
@@ -34,9 +34,9 @@ eval_start_address ()
  executable starts at 0x1:0040L, the Cygwin DLL starts at
  0x1:8004L, other rebased DLLs are located in the region from
  0x2:L up to 0x4:L, -auto-image-based DLLs are located
- in the region from 0x4:L up to 0x6:L.
- So we let the heap start at 0x6:L. */
-  uintptr_t start_address = 0x6L;
+ in the region from 0x4:L up to 0x6:L.  Leave another
+ 8 Gigs slack space, so lets start the heap at 0x8:L. */
+  uintptr_t start_address = 0x8L;
 #else
   /* Windows performs heap ASLR.  This spoils the entire region below
  0x2000 for us, because that region is used by Windows to randomize
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 9eb1643..8b1aedc 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -801,8 +801,10 @@ mmap_worker (mmap_list *map_list, fhandler_base *fh, 
caddr_t base, size_t len,
 #ifdef __x86_64__
 
 /* The memory region used for memory maps */
-#define MMAP_STORAGE_LOW   0x008L  /* Leave 8 Gigs for heap. */
-#define MMAP_STORAGE_HIGH  0x700L  /* Leave enough room for OS. */
+#define MMAP_STORAGE_LOW   0x0010L /* Leave 32 Gigs for heap. */
+/* Up to Win 8 only supporting 44 bit address space, starting with Win 8.1
+   48 bit address space. */
+#define MMAP_STORAGE_HIGH  wincap.mmap_storage_high ()
 
 /* FIXME?  Unfortunately the OS doesn't support a top down allocation with
   a ceiling value.  The ZeroBits mechanism only works for
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index 17e0cf1..5c6e642 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -20,6 +20,7 @@ details. */
 
 wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = 
{
   def_guard_pages:1,
+  mmap_storage_high:0x0700LL,
   {
 is_server:false,
 needs_count_in_si_lpres2:true,
@@ -46,6 +47,7 @@ wincaps wincap_vista __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 
 wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
   def_guard_pages:1,
+  mmap_storage_high:0x0700LL,
   {
 is_server:false,
 needs_count_in_si_lpres2:false,
@@ -72,6 +74,7 @@ wincaps wincap_7 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 
 wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
   def_guard_pages:2,
+  mmap_storage_high:0x0700LL,
   {
 is_server:false,
 needs_count_in_si_lpres2:false,
@@ -98,6 +101,7 @@ wincaps wincap_8 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 
 wincaps wincap_8_1 __attribute__((section (".cygwin_dll_common"), shared)) = {
   def_guard_pages:2,
+  mmap_storage_high:0x7000LL,
   {
 is_server:false,
 needs_count_in_si_lpres2:false,
@@ -124,6 +128,7 @@ wincaps wincap_8_1 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 
 wincaps  wincap_10_1507 __attribute__((section (".cygwin_dll_common"), 
shared)) = {
   def_guard_pages:2,
+  mmap_storage_high:0x7000LL,
   {
 is_server:false,
 needs_count_in_si_lpres2:false,
@@ -150,6 +155,7 @@ wincaps  wincap_10_1507 __attribute__((section 
(".cygwin_dll_common"), shared))
 
 wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shared)) 
= {
   def_guard_pages:2,
+  mmap_storage_high:0x7000LL,
   {
 is_server:false,
 needs_count_in_si_lpres2:false,
@@ -176,6 +182,7 @@ wincaps wincap_10_1703 __attribute__((section