Francois Gouget : configure: Load wine lower in memory on FreeBSD to leave more space for mmap() and malloc().

Alexandre Julliard julliard at winehq.org
Thu Dec 2 16:30:55 CST 2010


Module: wine
Branch: stable
Commit: 365000ce5c158c758c4ff8cbcd3060f20fa1733b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=365000ce5c158c758c4ff8cbcd3060f20fa1733b

Author: Francois Gouget <fgouget at free.fr>
Date:   Fri Nov 26 16:18:32 2010 +0100

configure: Load wine lower in memory on FreeBSD to leave more space for mmap() and malloc().

If not provided an explicit address, FreeBSD won't mmap any memory
below the executable. In particularly this means any memory below that
is unavailable to dlopen() and malloc().  This fixes the bug where
large WineLib binaries, in particular winetest, failed to load because
there was not enough space left for them and the native libraries they
linked to.  The drawback is that we can no longer load very large
Windows executables (between about 1.5 and 2 GB).
(cherry picked from commit 5f694ddf4c211c1c167a15541c2654175ce42a62)

---

 configure    |    6 +++++-
 configure.ac |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index db44d4d..0ac4902 100755
--- a/configure
+++ b/configure
@@ -6922,7 +6922,11 @@ eval ac_res=\$$as_ac_var
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 if test `eval 'as_val=${'$as_ac_var'};$as_echo "$as_val"'` = yes; then :
-  LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"
+  case $host_os in
+                           freebsd*)  LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;;
+                           *) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;;
+                           esac
+
 fi
           ;;
       esac
diff --git a/configure.ac b/configure.ac
index 8181c4d..3372e87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -792,7 +792,11 @@ case $host_os in
       case $host_cpu in
         *i[[3456789]]86* | x86_64)
           WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7bf00400],
-                          [LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"])
+                          [case $host_os in
+                           freebsd*)  LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;;
+                           *) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;;
+                           esac
+                          ])
           ;;
       esac
 




More information about the wine-cvs mailing list