Commit 655e5e8c authored by Alexandre Julliard's avatar Alexandre Julliard

configure: Add a separate variable for wineloader-specific flags.

And apply the common link flags also to the wineserver. Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 61d4ea17
...@@ -88,6 +88,7 @@ conf_manext = 5 ...@@ -88,6 +88,7 @@ conf_manext = 5
WINELOADER_PROGRAMS = @WINELOADER_PROGRAMS@ WINELOADER_PROGRAMS = @WINELOADER_PROGRAMS@
WINELOADER_DEPENDS = @WINELOADER_DEPENDS@ WINELOADER_DEPENDS = @WINELOADER_DEPENDS@
WINELOADER_INSTALL = @WINELOADER_INSTALL@ WINELOADER_INSTALL = @WINELOADER_INSTALL@
WINELOADER_LDFLAGS = @WINELOADER_LDFLAGS@
LIBWINE_SHAREDLIB = @LIBWINE_SHAREDLIB@ LIBWINE_SHAREDLIB = @LIBWINE_SHAREDLIB@
LIBWINE_IMPORTLIB = @LIBWINE_IMPORTLIB@ LIBWINE_IMPORTLIB = @LIBWINE_IMPORTLIB@
LIBWINE_INSTALL_LIB = @LIBWINE_INSTALL_LIB@ LIBWINE_INSTALL_LIB = @LIBWINE_INSTALL_LIB@
......
...@@ -723,6 +723,7 @@ SUBDIRS ...@@ -723,6 +723,7 @@ SUBDIRS
READELF READELF
OTOOL OTOOL
LDD LDD
WINELOADER_LDFLAGS
LDEXECFLAGS LDEXECFLAGS
LDRPATH_LOCAL LDRPATH_LOCAL
LDRPATH_INSTALL LDRPATH_INSTALL
...@@ -7346,6 +7347,8 @@ LDRPATH_LOCAL="" ...@@ -7346,6 +7347,8 @@ LDRPATH_LOCAL=""
LDEXECFLAGS="" LDEXECFLAGS=""
WINELOADER_LDFLAGS=""
LIBEXT="so" LIBEXT="so"
DLLEXT=".so" DLLEXT=".so"
IMPLIBEXT="def" IMPLIBEXT="def"
...@@ -8135,7 +8138,7 @@ done ...@@ -8135,7 +8138,7 @@ done
APPKIT_LIBS="-framework AppKit" APPKIT_LIBS="-framework AppKit"
LDEXECFLAGS="-image_base 0x7bf00000 -Wl,-pagezero_size,0x1000,-segaddr,WINE_DOS,0x00001000,-segaddr,WINE_SHAREDHEAP,0x7f000000,-sectcreate,__TEXT,__info_plist,wine_info.plist" WINELOADER_LDFLAGS="-image_base 0x7bf00000 -Wl,-pagezero_size,0x1000,-segaddr,WINE_DOS,0x00001000,-segaddr,WINE_SHAREDHEAP,0x7f000000,-sectcreate,__TEXT,__info_plist,wine_info.plist"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_pie" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_pie" >&5
$as_echo_n "checking whether the compiler supports -Wl,-no_pie... " >&6; } $as_echo_n "checking whether the compiler supports -Wl,-no_pie... " >&6; }
if ${ac_cv_cflags__Wl__no_pie+:} false; then : if ${ac_cv_cflags__Wl__no_pie+:} false; then :
...@@ -8159,7 +8162,7 @@ fi ...@@ -8159,7 +8162,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__no_pie" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__no_pie" >&5
$as_echo "$ac_cv_cflags__Wl__no_pie" >&6; } $as_echo "$ac_cv_cflags__Wl__no_pie" >&6; }
if test "x$ac_cv_cflags__Wl__no_pie" = xyes; then : if test "x$ac_cv_cflags__Wl__no_pie" = xyes; then :
LDEXECFLAGS="-Wl,-no_pie $LDEXECFLAGS" WINELOADER_LDFLAGS="-Wl,-no_pie $WINELOADER_LDFLAGS"
fi fi
if test "$ac_cv_header_DiskArbitration_DiskArbitration_h" = "yes" if test "$ac_cv_header_DiskArbitration_DiskArbitration_h" = "yes"
then then
...@@ -8377,7 +8380,7 @@ fi ...@@ -8377,7 +8380,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__Wl___export_dynamic" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__Wl___export_dynamic" >&5
$as_echo "$ac_cv_cflags__fPIC__Wl___export_dynamic" >&6; } $as_echo "$ac_cv_cflags__fPIC__Wl___export_dynamic" >&6; }
if test "x$ac_cv_cflags__fPIC__Wl___export_dynamic" = xyes; then : if test "x$ac_cv_cflags__fPIC__Wl___export_dynamic" = xyes; then :
LDEXECFLAGS="$LDEXECFLAGS -Wl,--export-dynamic" WINELOADER_LDFLAGS="-Wl,--export-dynamic"
fi fi
as_ac_var=`$as_echo "ac_cv_cflags_-fPIC -Wl,--rpath,\\$ORIGIN/../lib" | $as_tr_sh` as_ac_var=`$as_echo "ac_cv_cflags_-fPIC -Wl,--rpath,\\$ORIGIN/../lib" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -Wl,--rpath,\$ORIGIN/../lib" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -Wl,--rpath,\$ORIGIN/../lib" >&5
...@@ -8472,7 +8475,6 @@ fi ...@@ -8472,7 +8475,6 @@ fi
*) *)
DLLFLAGS="$DLLFLAGS -fPIC" DLLFLAGS="$DLLFLAGS -fPIC"
LDEXECFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can build a GNU style ELF dll" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can build a GNU style ELF dll" >&5
$as_echo_n "checking whether we can build a GNU style ELF dll... " >&6; } $as_echo_n "checking whether we can build a GNU style ELF dll... " >&6; }
if ${ac_cv_c_dll_gnuelf+:} false; then : if ${ac_cv_c_dll_gnuelf+:} false; then :
...@@ -8601,7 +8603,7 @@ fi ...@@ -8601,7 +8603,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__Wl___export_dynamic" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__Wl___export_dynamic" >&5
$as_echo "$ac_cv_cflags__fPIC__Wl___export_dynamic" >&6; } $as_echo "$ac_cv_cflags__fPIC__Wl___export_dynamic" >&6; }
if test "x$ac_cv_cflags__fPIC__Wl___export_dynamic" = xyes; then : if test "x$ac_cv_cflags__fPIC__Wl___export_dynamic" = xyes; then :
LDEXECFLAGS="-Wl,--export-dynamic" WINELOADER_LDFLAGS="-Wl,--export-dynamic"
fi fi
as_ac_var=`$as_echo "ac_cv_cflags_-fPIC -Wl,--rpath,\\$ORIGIN/../lib" | $as_tr_sh` as_ac_var=`$as_echo "ac_cv_cflags_-fPIC -Wl,--rpath,\\$ORIGIN/../lib" | $as_tr_sh`
...@@ -8714,8 +8716,8 @@ fi ...@@ -8714,8 +8716,8 @@ fi
$as_echo "$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&6; } $as_echo "$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&6; }
if test "x$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" = xyes; then : if test "x$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" = xyes; then :
case $host_os in case $host_os in
freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x60000000" ;; freebsd* | kfreebsd*-gnu) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-Ttext-segment=0x60000000" ;;
*) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x7c000000" ;; *) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-Ttext-segment=0x7c000000" ;;
esac esac
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x7c000400" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x7c000400" >&5
...@@ -8742,8 +8744,8 @@ fi ...@@ -8742,8 +8744,8 @@ fi
$as_echo "$ac_cv_cflags__Wl___section_start__interp_0x7c000400" >&6; } $as_echo "$ac_cv_cflags__Wl___section_start__interp_0x7c000400" >&6; }
if test "x$ac_cv_cflags__Wl___section_start__interp_0x7c000400" = xyes; then : if test "x$ac_cv_cflags__Wl___section_start__interp_0x7c000400" = xyes; then :
case $host_os in case $host_os in
freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;; freebsd* | kfreebsd*-gnu) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,--section-start,.interp=0x60000400" ;;
*) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7c000400" ;; *) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,--section-start,.interp=0x7c000400" ;;
esac esac
fi fi
# Extract the first word of "prelink", so it can be a program name with args. # Extract the first word of "prelink", so it can be a program name with args.
...@@ -8815,7 +8817,7 @@ fi ...@@ -8815,7 +8817,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__z_max_page_size_0x1000" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__z_max_page_size_0x1000" >&5
$as_echo "$ac_cv_cflags__Wl__z_max_page_size_0x1000" >&6; } $as_echo "$ac_cv_cflags__Wl__z_max_page_size_0x1000" >&6; }
if test "x$ac_cv_cflags__Wl__z_max_page_size_0x1000" = xyes; then : if test "x$ac_cv_cflags__Wl__z_max_page_size_0x1000" = xyes; then :
LDEXECFLAGS="$LDEXECFLAGS -Wl,-z,max-page-size=0x1000" WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-z,max-page-size=0x1000"
fi fi
;; ;;
esac esac
......
...@@ -678,6 +678,7 @@ AC_SUBST(DLLFLAGS,"-D_REENTRANT") ...@@ -678,6 +678,7 @@ AC_SUBST(DLLFLAGS,"-D_REENTRANT")
AC_SUBST(LDRPATH_INSTALL,"") AC_SUBST(LDRPATH_INSTALL,"")
AC_SUBST(LDRPATH_LOCAL,"") AC_SUBST(LDRPATH_LOCAL,"")
AC_SUBST(LDEXECFLAGS,"") AC_SUBST(LDEXECFLAGS,"")
AC_SUBST(WINELOADER_LDFLAGS,"")
LIBEXT="so" LIBEXT="so"
DLLEXT=".so" DLLEXT=".so"
IMPLIBEXT="def" IMPLIBEXT="def"
...@@ -736,9 +737,9 @@ case $host_os in ...@@ -736,9 +737,9 @@ case $host_os in
AC_SUBST(APPLICATIONSERVICES_LIBS,"-framework ApplicationServices") AC_SUBST(APPLICATIONSERVICES_LIBS,"-framework ApplicationServices")
AC_SUBST(CORESERVICES_LIBS,"-framework CoreServices") AC_SUBST(CORESERVICES_LIBS,"-framework CoreServices")
AC_SUBST(APPKIT_LIBS,"-framework AppKit") AC_SUBST(APPKIT_LIBS,"-framework AppKit")
LDEXECFLAGS="-image_base 0x7bf00000 -Wl,-pagezero_size,0x1000,-segaddr,WINE_DOS,0x00001000,-segaddr,WINE_SHAREDHEAP,0x7f000000,-sectcreate,__TEXT,__info_plist,wine_info.plist" WINELOADER_LDFLAGS="-image_base 0x7bf00000 -Wl,-pagezero_size,0x1000,-segaddr,WINE_DOS,0x00001000,-segaddr,WINE_SHAREDHEAP,0x7f000000,-sectcreate,__TEXT,__info_plist,wine_info.plist"
WINE_TRY_CFLAGS([-Wl,-no_pie], WINE_TRY_CFLAGS([-Wl,-no_pie],
[LDEXECFLAGS="-Wl,-no_pie $LDEXECFLAGS"]) [WINELOADER_LDFLAGS="-Wl,-no_pie $WINELOADER_LDFLAGS"])
if test "$ac_cv_header_DiskArbitration_DiskArbitration_h" = "yes" if test "$ac_cv_header_DiskArbitration_DiskArbitration_h" = "yes"
then then
dnl DiskArbitration API is not public on Darwin < 8.0, use it only if header found dnl DiskArbitration API is not public on Darwin < 8.0, use it only if header found
...@@ -849,7 +850,7 @@ case $host_os in ...@@ -849,7 +850,7 @@ case $host_os in
DLLFLAGS="$DLLFLAGS -fPIC" DLLFLAGS="$DLLFLAGS -fPIC"
LDEXECFLAGS="-Wl,-pie" LDEXECFLAGS="-Wl,-pie"
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic], WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
[LDEXECFLAGS="$LDEXECFLAGS -Wl,--export-dynamic"]) [WINELOADER_LDFLAGS="-Wl,--export-dynamic"])
WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib], WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
[LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"], LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"],
...@@ -866,7 +867,6 @@ case $host_os in ...@@ -866,7 +867,6 @@ case $host_os in
*) *)
DLLFLAGS="$DLLFLAGS -fPIC" DLLFLAGS="$DLLFLAGS -fPIC"
LDEXECFLAGS=""
AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf, AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf,
[WINE_TRY_SHLIB_FLAGS([-fPIC -shared -Wl,-Bsymbolic], [WINE_TRY_SHLIB_FLAGS([-fPIC -shared -Wl,-Bsymbolic],
ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")]) ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")])
...@@ -884,7 +884,7 @@ case $host_os in ...@@ -884,7 +884,7 @@ case $host_os in
rm -f conftest.map rm -f conftest.map
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic], WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
[LDEXECFLAGS="-Wl,--export-dynamic"]) [WINELOADER_LDFLAGS="-Wl,--export-dynamic"])
WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib], WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
[LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
...@@ -900,13 +900,13 @@ case $host_os in ...@@ -900,13 +900,13 @@ case $host_os in
*i[[3456789]]86* | x86_64) *i[[3456789]]86* | x86_64)
WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000], WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],
[case $host_os in [case $host_os in
freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x60000000" ;; freebsd* | kfreebsd*-gnu) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-Ttext-segment=0x60000000" ;;
*) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x7c000000" ;; *) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-Ttext-segment=0x7c000000" ;;
esac], esac],
[WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7c000400], [WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7c000400],
[case $host_os in [case $host_os in
freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;; freebsd* | kfreebsd*-gnu) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,--section-start,.interp=0x60000400" ;;
*) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7c000400" ;; *) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,--section-start,.interp=0x7c000400" ;;
esac]) esac])
AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH]) AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH])
if test "x$PRELINK" = xfalse if test "x$PRELINK" = xfalse
...@@ -914,7 +914,7 @@ case $host_os in ...@@ -914,7 +914,7 @@ case $host_os in
WINE_WARNING([prelink not found and linker does not support relocation, base address of core dlls won't be set correctly.]) WINE_WARNING([prelink not found and linker does not support relocation, base address of core dlls won't be set correctly.])
fi]) fi])
WINE_TRY_CFLAGS([-Wl,-z,max-page-size=0x1000], WINE_TRY_CFLAGS([-Wl,-z,max-page-size=0x1000],
[LDEXECFLAGS="$LDEXECFLAGS -Wl,-z,max-page-size=0x1000"]) [WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-z,max-page-size=0x1000"])
;; ;;
esac esac
......
...@@ -19,11 +19,11 @@ preloader_EXTRADEFS = $(MSVCRTFLAGS) ...@@ -19,11 +19,11 @@ preloader_EXTRADEFS = $(MSVCRTFLAGS)
wine_OBJS = main.o wine_OBJS = main.o
wine_DEPS = $(WINELOADER_DEPENDS) wine_DEPS = $(WINELOADER_DEPENDS)
wine_LDFLAGS = $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS) wine_LDFLAGS = $(WINELOADER_LDFLAGS) $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS)
wine64_OBJS = main.o wine64_OBJS = main.o
wine64_DEPS = $(WINELOADER_DEPENDS) wine64_DEPS = $(WINELOADER_DEPENDS)
wine64_LDFLAGS = $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS) wine64_LDFLAGS = $(WINELOADER_LDFLAGS) $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS)
wine_preloader_OBJS = preloader.o wine_preloader_OBJS = preloader.o
wine_preloader_LDFLAGS = -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000 wine_preloader_LDFLAGS = -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000
......
...@@ -50,6 +50,6 @@ MANPAGES = \ ...@@ -50,6 +50,6 @@ MANPAGES = \
wineserver.fr.UTF-8.man.in \ wineserver.fr.UTF-8.man.in \
wineserver.man.in wineserver.man.in
EXTRALIBS = -lwine $(POLL_LIBS) $(RT_LIBS) EXTRALIBS = $(LDEXECFLAGS) -lwine $(POLL_LIBS) $(RT_LIBS)
INSTALL_LIB = $(PROGRAMS) INSTALL_LIB = $(PROGRAMS)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment