If supported, relocate the main wine binary to a higher address to

leave more space for the Win32 executable.
This commit is contained in:
Alexandre Julliard 2003-03-24 19:33:20 +00:00
parent a993df861c
commit 4d52d37924
3 changed files with 72 additions and 6 deletions

58
configure vendored
View File

@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h> # include <unistd.h>
#endif" #endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS OPTIONS WIN16_FILES WIN16_INSTALL build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP TOOLSDIR X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS YACC LEX LEXLIB LEX_OUTPUT_ROOT XYACC XLEX AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN C2MAN LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS DB2HTML DB2PDF DB2PS JPEGLIB EGREP GIFLIB XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ft_devel ft_devel2 FREETYPEINCL ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS DLLEXT DLLFLAGS DLLIBS LDDLLFLAGS LDSHARED LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP CROSSTEST CROSSCC LDPATH CRTLIBS LDD ALLOCA LIBOBJS LTLIBOBJS' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS OPTIONS WIN16_FILES WIN16_INSTALL build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP TOOLSDIR X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS YACC LEX LEXLIB LEX_OUTPUT_ROOT XYACC XLEX AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN C2MAN LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS DB2HTML DB2PDF DB2PS JPEGLIB EGREP GIFLIB XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ft_devel ft_devel2 FREETYPEINCL ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS DLLEXT DLLFLAGS DLLIBS LDDLLFLAGS LDSHARED LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS CROSSTEST CROSSCC LDPATH CRTLIBS LDD ALLOCA LIBOBJS LTLIBOBJS'
ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_TEST_RULES MAKE_PROG_RULES' ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_TEST_RULES MAKE_PROG_RULES'
# Initialize some variables set by options. # Initialize some variables set by options.
@ -10832,7 +10832,7 @@ echo "${ECHO_T}$ac_cv_c_gcc_gstabs" >&6
CFLAGS="$CFLAGS -gstabs+" CFLAGS="$CFLAGS -gstabs+"
fi fi
saved_CFLAGS=$CFLAGS saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wpointer-arith -Werror" CFLAGS="$CFLAGS -Wpointer-arith -Werror"
echo "$as_me:$LINENO: checking for broken string.h that generates warnings" >&5 echo "$as_me:$LINENO: checking for broken string.h that generates warnings" >&5
echo $ECHO_N "checking for broken string.h that generates warnings... $ECHO_C" >&6 echo $ECHO_N "checking for broken string.h that generates warnings... $ECHO_C" >&6
@ -10878,7 +10878,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi fi
echo "$as_me:$LINENO: result: $ac_cv_c_string_h_warnings" >&5 echo "$as_me:$LINENO: result: $ac_cv_c_string_h_warnings" >&5
echo "${ECHO_T}$ac_cv_c_string_h_warnings" >&6 echo "${ECHO_T}$ac_cv_c_string_h_warnings" >&6
CFLAGS=$saved_CFLAGS CFLAGS="$saved_CFLAGS"
if test "$ac_cv_c_string_h_warnings" = "no" if test "$ac_cv_c_string_h_warnings" = "no"
then then
CFLAGS="$CFLAGS -Wpointer-arith" CFLAGS="$CFLAGS -Wpointer-arith"
@ -11850,6 +11850,57 @@ echo "${ECHO_T}$ac_cv_c_dll_zdefs" >&6
then then
LDDLLFLAGS="$LDDLLFLAGS,-z,defs" LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
fi fi
echo "$as_me:$LINENO: checking whether we can relocate the executable to 0x3c000000" >&5
echo $ECHO_N "checking whether we can relocate the executable to 0x3c000000... $ECHO_C" >&6
if test "${ac_cv_ld_reloc_exec+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x3c000100"
if test "$cross_compiling" = yes; then
ac_cv_ld_reloc_exec="no"
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <unistd.h>
int main() { return (sbrk(32*1024*1024) == (void *)-1); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_ld_reloc_exec="yes"
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_ld_reloc_exec="no"
fi
rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
CFLAGS="$saved_CFLAGS"
fi
echo "$as_me:$LINENO: result: $ac_cv_ld_reloc_exec" >&5
echo "${ECHO_T}$ac_cv_ld_reloc_exec" >&6
if test "$ac_cv_ld_reloc_exec" = "yes"
then
LDEXECFLAGS="-Wl,--section-start,.interp=0x3c000100"
fi
else else
echo "$as_me:$LINENO: checking whether we can build a UnixWare (Solaris) dll" >&5 echo "$as_me:$LINENO: checking whether we can build a UnixWare (Solaris) dll" >&5
echo $ECHO_N "checking whether we can build a UnixWare (Solaris) dll... $ECHO_C" >&6 echo $ECHO_N "checking whether we can build a UnixWare (Solaris) dll... $ECHO_C" >&6
@ -16710,6 +16761,7 @@ s,@DLLTOOL@,$DLLTOOL,;t t
s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t
s,@DLLWRAP@,$DLLWRAP,;t t s,@DLLWRAP@,$DLLWRAP,;t t
s,@ac_ct_DLLWRAP@,$ac_ct_DLLWRAP,;t t s,@ac_ct_DLLWRAP@,$ac_ct_DLLWRAP,;t t
s,@LDEXECFLAGS@,$LDEXECFLAGS,;t t
s,@CROSSTEST@,$CROSSTEST,;t t s,@CROSSTEST@,$CROSSTEST,;t t
s,@CROSSCC@,$CROSSCC,;t t s,@CROSSCC@,$CROSSCC,;t t
s,@LDPATH@,$LDPATH,;t t s,@LDPATH@,$LDPATH,;t t

View File

@ -680,12 +680,12 @@ int main(void) {
fi fi
dnl Check for noisy string.h dnl Check for noisy string.h
saved_CFLAGS=$CFLAGS saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wpointer-arith -Werror" CFLAGS="$CFLAGS -Wpointer-arith -Werror"
AC_CACHE_CHECK([for broken string.h that generates warnings], ac_cv_c_string_h_warnings, AC_CACHE_CHECK([for broken string.h that generates warnings], ac_cv_c_string_h_warnings,
AC_TRY_COMPILE([#include <string.h>],[], AC_TRY_COMPILE([#include <string.h>],[],
[ac_cv_c_string_h_warnings=no],[ac_cv_c_string_h_warnings=yes])) [ac_cv_c_string_h_warnings=no],[ac_cv_c_string_h_warnings=yes]))
CFLAGS=$saved_CFLAGS CFLAGS="$saved_CFLAGS"
if test "$ac_cv_c_string_h_warnings" = "no" if test "$ac_cv_c_string_h_warnings" = "no"
then then
CFLAGS="$CFLAGS -Wpointer-arith" CFLAGS="$CFLAGS -Wpointer-arith"
@ -813,6 +813,19 @@ case $host_os in
then then
LDDLLFLAGS="$LDDLLFLAGS,-z,defs" LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
fi fi
AC_CACHE_CHECK([whether we can relocate the executable to 0x3c000000], ac_cv_ld_reloc_exec,
[saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x3c000100"
AC_TRY_RUN([#include <unistd.h>
int main() { return (sbrk(32*1024*1024) == (void *)-1); }],
ac_cv_ld_reloc_exec="yes",
ac_cv_ld_reloc_exec="no",
ac_cv_ld_reloc_exec="no")
CFLAGS="$saved_CFLAGS"])
if test "$ac_cv_ld_reloc_exec" = "yes"
then
AC_SUBST(LDEXECFLAGS,["-Wl,--section-start,.interp=0x3c000100"])
fi
else else
AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll, ac_cv_c_dll_unixware, AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll, ac_cv_c_dll_unixware,
[WINE_TRY_CFLAGS([-fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic], [WINE_TRY_CFLAGS([-fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic],

View File

@ -14,9 +14,10 @@ all: $(MODULE)
@MAKE_RULES@ @MAKE_RULES@
ALL_OBJS = $(MODULE).spec.o $(OBJS) ALL_OBJS = $(MODULE).spec.o $(OBJS)
LDEXECFLAGS = @LDEXECFLAGS@
$(MODULE): $(ALL_OBJS) $(MODULE): $(ALL_OBJS)
$(CC) -o $@ $(ALL_OBJS) -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(LIBWINE) $(LIBUNICODE) $(LIBPORT) $(LIBS) $(LDFLAGS) $(CC) -o $@ $(LDEXECFLAGS) $(ALL_OBJS) -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(LIBWINE) $(LIBUNICODE) $(LIBPORT) $(LIBS) $(LDFLAGS)
$(MODULE).spec.c: $(WINEBUILD) $(MODULE).spec.c: $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --exe $(MODULE) --exe-mode gui --entry wine_initial_task -L$(DLLDIR) $(IMPORTS:%=-l%) $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --exe $(MODULE) --exe-mode gui --entry wine_initial_task -L$(DLLDIR) $(IMPORTS:%=-l%)