makefiles: Also pass -fPIC flag when linking.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8f732c66ab
commit
8039941c52
|
@ -44,7 +44,7 @@ EXTRACFLAGS = @EXTRACFLAGS@
|
||||||
EXTRACROSSCFLAGS= @EXTRACROSSCFLAGS@
|
EXTRACROSSCFLAGS= @EXTRACROSSCFLAGS@
|
||||||
MSVCRTFLAGS = @BUILTINFLAG@
|
MSVCRTFLAGS = @BUILTINFLAG@
|
||||||
TARGETFLAGS = @TARGETFLAGS@
|
TARGETFLAGS = @TARGETFLAGS@
|
||||||
UNWINDFLAGS = @UNWINDFLAGS@
|
LDDLLFLAGS = @LDDLLFLAGS@
|
||||||
LDEXECFLAGS = @LDEXECFLAGS@
|
LDEXECFLAGS = @LDEXECFLAGS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
BISON = @BISON@
|
BISON = @BISON@
|
||||||
|
|
|
@ -631,7 +631,6 @@ RT_LIBS
|
||||||
POLL_LIBS
|
POLL_LIBS
|
||||||
DL_LIBS
|
DL_LIBS
|
||||||
TOOLSEXT
|
TOOLSEXT
|
||||||
UNWINDFLAGS
|
|
||||||
BUILTINFLAG
|
BUILTINFLAG
|
||||||
EXCESS_PRECISION_CFLAGS
|
EXCESS_PRECISION_CFLAGS
|
||||||
EXTRACFLAGS
|
EXTRACFLAGS
|
||||||
|
@ -743,6 +742,7 @@ WINELOADER_LDFLAGS
|
||||||
TOP_INSTALL_DEV
|
TOP_INSTALL_DEV
|
||||||
TOP_INSTALL_LIB
|
TOP_INSTALL_LIB
|
||||||
LDEXECFLAGS
|
LDEXECFLAGS
|
||||||
|
LDDLLFLAGS
|
||||||
LDRPATH_LOCAL
|
LDRPATH_LOCAL
|
||||||
LDRPATH_INSTALL
|
LDRPATH_INSTALL
|
||||||
DLLFLAGS
|
DLLFLAGS
|
||||||
|
@ -7849,6 +7849,8 @@ LDRPATH_INSTALL=""
|
||||||
|
|
||||||
LDRPATH_LOCAL=""
|
LDRPATH_LOCAL=""
|
||||||
|
|
||||||
|
LDDLLFLAGS=""
|
||||||
|
|
||||||
LDEXECFLAGS=""
|
LDEXECFLAGS=""
|
||||||
|
|
||||||
TOP_INSTALL_LIB=""
|
TOP_INSTALL_LIB=""
|
||||||
|
@ -8660,6 +8662,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||||
|
|
||||||
LIBEXT="dylib"
|
LIBEXT="dylib"
|
||||||
DLLFLAGS="$DLLFLAGS -fPIC"
|
DLLFLAGS="$DLLFLAGS -fPIC"
|
||||||
|
LDDLLFLAGS="-fPIC"
|
||||||
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
|
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
|
||||||
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
|
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
|
||||||
COREFOUNDATION_LIBS="-framework CoreFoundation"
|
COREFOUNDATION_LIBS="-framework CoreFoundation"
|
||||||
|
@ -9038,6 +9041,7 @@ fi
|
||||||
|
|
||||||
linux-android*)
|
linux-android*)
|
||||||
DLLFLAGS="$DLLFLAGS -fPIC"
|
DLLFLAGS="$DLLFLAGS -fPIC"
|
||||||
|
LDDLLFLAGS="-fPIC"
|
||||||
LDEXECFLAGS="-Wl,-pie"
|
LDEXECFLAGS="-Wl,-pie"
|
||||||
enable_wineandroid_drv=${enable_wineandroid_drv:-yes}
|
enable_wineandroid_drv=${enable_wineandroid_drv:-yes}
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -Wl,--export-dynamic" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -Wl,--export-dynamic" >&5
|
||||||
|
@ -9280,9 +9284,11 @@ fi
|
||||||
*)
|
*)
|
||||||
case $host_cpu in
|
case $host_cpu in
|
||||||
*i[3456789]86*)
|
*i[3456789]86*)
|
||||||
DLLFLAGS="$DLLFLAGS -fno-PIC" ;;
|
DLLFLAGS="$DLLFLAGS -fno-PIC"
|
||||||
|
LDDLLFLAGS="-fno-PIC" ;;
|
||||||
*)
|
*)
|
||||||
DLLFLAGS="$DLLFLAGS -fPIC" ;;
|
DLLFLAGS="$DLLFLAGS -fPIC"
|
||||||
|
LDDLLFLAGS="-fPIC" ;;
|
||||||
esac
|
esac
|
||||||
{ $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; }
|
||||||
|
@ -17548,8 +17554,7 @@ then
|
||||||
|
|
||||||
$as_echo "#define __ASM_CFI(str) str" >>confdefs.h
|
$as_echo "#define __ASM_CFI(str) str" >>confdefs.h
|
||||||
|
|
||||||
UNWINDFLAGS=-fasynchronous-unwind-tables
|
LDDLLFLAGS="$LDDLLFLAGS -fasynchronous-unwind-tables"
|
||||||
|
|
||||||
else
|
else
|
||||||
$as_echo "#define __ASM_CFI(str) \"\"" >>confdefs.h
|
$as_echo "#define __ASM_CFI(str) \"\"" >>confdefs.h
|
||||||
|
|
||||||
|
|
11
configure.ac
11
configure.ac
|
@ -707,6 +707,7 @@ dnl **** Check for working dll ****
|
||||||
AC_SUBST(DLLFLAGS,"-D_REENTRANT")
|
AC_SUBST(DLLFLAGS,"-D_REENTRANT")
|
||||||
AC_SUBST(LDRPATH_INSTALL,"")
|
AC_SUBST(LDRPATH_INSTALL,"")
|
||||||
AC_SUBST(LDRPATH_LOCAL,"")
|
AC_SUBST(LDRPATH_LOCAL,"")
|
||||||
|
AC_SUBST(LDDLLFLAGS,"")
|
||||||
AC_SUBST(LDEXECFLAGS,"")
|
AC_SUBST(LDEXECFLAGS,"")
|
||||||
AC_SUBST(TOP_INSTALL_LIB,"")
|
AC_SUBST(TOP_INSTALL_LIB,"")
|
||||||
AC_SUBST(TOP_INSTALL_DEV,"")
|
AC_SUBST(TOP_INSTALL_DEV,"")
|
||||||
|
@ -746,6 +747,7 @@ case $host_os in
|
||||||
AC_LANG_POP([Objective C])
|
AC_LANG_POP([Objective C])
|
||||||
LIBEXT="dylib"
|
LIBEXT="dylib"
|
||||||
DLLFLAGS="$DLLFLAGS -fPIC"
|
DLLFLAGS="$DLLFLAGS -fPIC"
|
||||||
|
LDDLLFLAGS="-fPIC"
|
||||||
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
|
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
|
||||||
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
|
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
|
||||||
dnl declare needed frameworks
|
dnl declare needed frameworks
|
||||||
|
@ -891,6 +893,7 @@ case $host_os in
|
||||||
|
|
||||||
linux-android*)
|
linux-android*)
|
||||||
DLLFLAGS="$DLLFLAGS -fPIC"
|
DLLFLAGS="$DLLFLAGS -fPIC"
|
||||||
|
LDDLLFLAGS="-fPIC"
|
||||||
LDEXECFLAGS="-Wl,-pie"
|
LDEXECFLAGS="-Wl,-pie"
|
||||||
enable_wineandroid_drv=${enable_wineandroid_drv:-yes}
|
enable_wineandroid_drv=${enable_wineandroid_drv:-yes}
|
||||||
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
|
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
|
||||||
|
@ -926,9 +929,11 @@ case $host_os in
|
||||||
*)
|
*)
|
||||||
case $host_cpu in
|
case $host_cpu in
|
||||||
*i[[3456789]]86*)
|
*i[[3456789]]86*)
|
||||||
DLLFLAGS="$DLLFLAGS -fno-PIC" ;;
|
DLLFLAGS="$DLLFLAGS -fno-PIC"
|
||||||
|
LDDLLFLAGS="-fno-PIC" ;;
|
||||||
*)
|
*)
|
||||||
DLLFLAGS="$DLLFLAGS -fPIC" ;;
|
DLLFLAGS="$DLLFLAGS -fPIC"
|
||||||
|
LDDLLFLAGS="-fPIC" ;;
|
||||||
esac
|
esac
|
||||||
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],
|
||||||
|
@ -2137,7 +2142,7 @@ then
|
||||||
asm_func_header="$asm_func_header.cfi_startproc\\n\\t"
|
asm_func_header="$asm_func_header.cfi_startproc\\n\\t"
|
||||||
asm_func_trailer="\\n\\t.cfi_endproc$asm_func_trailer"
|
asm_func_trailer="\\n\\t.cfi_endproc$asm_func_trailer"
|
||||||
AC_DEFINE([__ASM_CFI(str)],[str],[Define to a macro to output a .cfi assembly pseudo-op])
|
AC_DEFINE([__ASM_CFI(str)],[str],[Define to a macro to output a .cfi assembly pseudo-op])
|
||||||
AC_SUBST([UNWINDFLAGS],[-fasynchronous-unwind-tables])
|
LDDLLFLAGS="$LDDLLFLAGS -fasynchronous-unwind-tables"
|
||||||
else
|
else
|
||||||
AC_DEFINE([__ASM_CFI(str)],[""])
|
AC_DEFINE([__ASM_CFI(str)],[""])
|
||||||
if test "x$enable_win64" = "xyes"
|
if test "x$enable_win64" = "xyes"
|
||||||
|
|
|
@ -134,7 +134,7 @@ static struct strarray msvcrt_flags;
|
||||||
static struct strarray extra_cflags;
|
static struct strarray extra_cflags;
|
||||||
static struct strarray extra_cross_cflags;
|
static struct strarray extra_cross_cflags;
|
||||||
static struct strarray cpp_flags;
|
static struct strarray cpp_flags;
|
||||||
static struct strarray unwind_flags;
|
static struct strarray lddll_flags;
|
||||||
static struct strarray libs;
|
static struct strarray libs;
|
||||||
static struct strarray enable_tests;
|
static struct strarray enable_tests;
|
||||||
static struct strarray cmdline_vars;
|
static struct strarray cmdline_vars;
|
||||||
|
@ -2282,7 +2282,7 @@ static void output_winegcc_command( struct makefile *make, int cross )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
output_filenames( target_flags );
|
output_filenames( target_flags );
|
||||||
output_filenames( unwind_flags );
|
output_filenames( lddll_flags );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4201,7 +4201,7 @@ int main( int argc, char *argv[] )
|
||||||
extra_cflags = get_expanded_make_var_array( top_makefile, "EXTRACFLAGS" );
|
extra_cflags = get_expanded_make_var_array( top_makefile, "EXTRACFLAGS" );
|
||||||
extra_cross_cflags = get_expanded_make_var_array( top_makefile, "EXTRACROSSCFLAGS" );
|
extra_cross_cflags = get_expanded_make_var_array( top_makefile, "EXTRACROSSCFLAGS" );
|
||||||
cpp_flags = get_expanded_make_var_array( top_makefile, "CPPFLAGS" );
|
cpp_flags = get_expanded_make_var_array( top_makefile, "CPPFLAGS" );
|
||||||
unwind_flags = get_expanded_make_var_array( top_makefile, "UNWINDFLAGS" );
|
lddll_flags = get_expanded_make_var_array( top_makefile, "LDDLLFLAGS" );
|
||||||
libs = get_expanded_make_var_array( top_makefile, "LIBS" );
|
libs = get_expanded_make_var_array( top_makefile, "LIBS" );
|
||||||
enable_tests = get_expanded_make_var_array( top_makefile, "ENABLE_TESTS" );
|
enable_tests = get_expanded_make_var_array( top_makefile, "ENABLE_TESTS" );
|
||||||
top_install_lib = get_expanded_make_var_array( top_makefile, "TOP_INSTALL_LIB" );
|
top_install_lib = get_expanded_make_var_array( top_makefile, "TOP_INSTALL_LIB" );
|
||||||
|
|
Loading…
Reference in New Issue