Commit 36cf2920 authored by Alexandre Julliard's avatar Alexandre Julliard

makefiles: When supported, use -Ttext-segment also for the main loader.

parent b06d3430
...@@ -8550,61 +8550,63 @@ fi ...@@ -8550,61 +8550,63 @@ fi
case $host_cpu in case $host_cpu in
*i[3456789]86* | x86_64) *i[3456789]86* | x86_64)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000" >&5
$as_echo_n "checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400... " >&6; } $as_echo_n "checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000... " >&6; }
if ${ac_cv_cflags__Wl___section_start__interp_0x7bf00400+:} false; then : if ${ac_cv_cflags__Wl__Ttext_segment_0x7bc00000+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
ac_wine_try_cflags_saved=$CFLAGS ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x7bf00400" CFLAGS="$CFLAGS -Wl,-Ttext-segment=0x7bc00000"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
int main(int argc, char **argv) { return 0; } int main(int argc, char **argv) { return 0; }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wl___section_start__interp_0x7bf00400=yes ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=yes
else else
ac_cv_cflags__Wl___section_start__interp_0x7bf00400=no ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=no
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved CFLAGS=$ac_wine_try_cflags_saved
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&5
$as_echo "$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&6; } $as_echo "$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&6; }
if test "x$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" = 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,--section-start,.interp=0x60000400" ;; freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x60000000" ;;
*) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;; *) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x7bf00000" ;;
esac esac
else
fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000" >&5 $as_echo_n "checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400... " >&6; }
$as_echo_n "checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000... " >&6; } if ${ac_cv_cflags__Wl___section_start__interp_0x7bf00400+:} false; then :
if ${ac_cv_cflags__Wl__Ttext_segment_0x7bc00000+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
ac_wine_try_cflags_saved=$CFLAGS ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Wl,-Ttext-segment=0x7bc00000" CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x7bf00400"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
int main(int argc, char **argv) { return 0; } int main(int argc, char **argv) { return 0; }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=yes ac_cv_cflags__Wl___section_start__interp_0x7bf00400=yes
else else
ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=no ac_cv_cflags__Wl___section_start__interp_0x7bf00400=no
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved CFLAGS=$ac_wine_try_cflags_saved
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&5
$as_echo "$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&6; } $as_echo "$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&6; }
if test "x$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" = xyes; then : if test "x$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" = xyes; then :
: case $host_os in
else freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;;
# Extract the first word of "prelink", so it can be a program name with args. *) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;;
esac
fi
# Extract the first word of "prelink", so it can be a program name with args.
set dummy prelink; ac_word=$2 set dummy prelink; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; } $as_echo_n "checking for $ac_word... " >&6; }
......
...@@ -895,14 +895,17 @@ case $host_os in ...@@ -895,14 +895,17 @@ case $host_os in
case $host_cpu in case $host_cpu in
*i[[3456789]]86* | x86_64) *i[[3456789]]86* | x86_64)
WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7bf00400], WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],
[case $host_os in [case $host_os in
freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;; freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x60000000" ;;
*) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;; *) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x7bf00000" ;;
esac esac],
]) [WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7bf00400],
WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],[:], [case $host_os in
[AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH]) freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;;
*) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;;
esac])
AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH])
if test "x$PRELINK" = xfalse if test "x$PRELINK" = xfalse
then then
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.])
......
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