configure: Build binaries as PIE on Android.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2015-11-17 12:48:39 +09:00
parent a30feab7d7
commit 3d8a91e14d
2 changed files with 12 additions and 22 deletions

25
configure vendored
View File

@ -8350,36 +8350,31 @@ $as_echo "$ac_cv_cflags__Wl___enable_new_dtags" >&6; }
if test "x$ac_cv_cflags__Wl___enable_new_dtags" = xyes; then : if test "x$ac_cv_cflags__Wl___enable_new_dtags" = xyes; then :
LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,--enable-new-dtags" LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,--enable-new-dtags"
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-pie" >&5
case $host_cpu in $as_echo_n "checking whether the compiler supports -Wl,-pie... " >&6; }
*i[3456789]86* | x86_64) if ${ac_cv_cflags__Wl__pie+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400" >&5
$as_echo_n "checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400... " >&6; }
if ${ac_cv_cflags__Wl___section_start__interp_0x7bf00400+:} 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,-pie"
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__pie=yes
else else
ac_cv_cflags__Wl___section_start__interp_0x7bf00400=no ac_cv_cflags__Wl__pie=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__pie" >&5
$as_echo "$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&6; } $as_echo "$ac_cv_cflags__Wl__pie" >&6; }
if test "x$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" = xyes; then : if test "x$ac_cv_cflags__Wl__pie" = xyes; then :
LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,-pie"
fi fi
;;
esac
LIBWINE_SHAREDLIB="libwine.so" LIBWINE_SHAREDLIB="libwine.so"

View File

@ -860,13 +860,8 @@ case $host_os in
WINE_TRY_CFLAGS([-Wl,--enable-new-dtags], WINE_TRY_CFLAGS([-Wl,--enable-new-dtags],
[LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,--enable-new-dtags"]) [LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,--enable-new-dtags"])
WINE_TRY_CFLAGS([-Wl,-pie],
case $host_cpu in [LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,-pie"])
*i[[3456789]]86* | x86_64)
WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7bf00400],
[LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"])
;;
esac
AC_SUBST(LIBWINE_SHAREDLIB,"libwine.so") AC_SUBST(LIBWINE_SHAREDLIB,"libwine.so")
AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.so") AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.so")