#endif
+/* Define if the PE linker supports --disable-dynamicbase option. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_LD_PE_DISABLE_DYNAMICBASE
+#endif
+
+
/* Define if your linker supports PIE option. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_PIE
# define LINK_SPEC_LARGE_ADDR_AWARE ""
#endif
+#undef LINK_SPEC_DISABLE_DYNAMICBASE
+#if HAVE_LD_PE_DISABLE_DYNAMICBASE
+# define LINK_SPEC_DISABLE_DYNAMICBASE \
+ "%{!shared:%{!mdll:%{no-pie:--disable-dynamicbase}}}"
+#else
+# define LINK_SPEC_DISABLE_DYNAMICBASE ""
+#endif
+
#undef LINK_SPEC
#define LINK_SPEC SUB_LINK_SPEC " %{mwindows:--subsystem windows} \
%{mconsole:--subsystem console} \
%{static:-Bstatic} %{!static:-Bdynamic} \
%{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
" LINK_SPEC_LARGE_ADDR_AWARE "\
+ " LINK_SPEC_DISABLE_DYNAMICBASE "\
%(shared_libgcc_undefs)"
/* Enable sincos optimization, overriding cygming.h. sincos, sincosf
"%{!shared:%{!mdll:%{!m64:--large-address-aware}}}"
#endif
+#if HAVE_LD_PE_DISABLE_DYNAMICBASE
+# define LINK_SPEC_DISABLE_DYNAMICBASE \
+ "%{!shared:%{!mdll:%{no-pie:--disable-dynamicbase}}}"
+#else
+# define LINK_SPEC_DISABLE_DYNAMICBASE ""
+#endif
+
#define LINK_SPEC "%{mwindows:--subsystem windows} \
%{mconsole:--subsystem console} \
%{shared: %{mdll: %eshared and mdll are not compatible}} \
%{static:-Bstatic} %{!static:-Bdynamic} \
%{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
" LINK_SPEC_LARGE_ADDR_AWARE "\
+ " LINK_SPEC_DISABLE_DYNAMICBASE "\
%(shared_libgcc_undefs)"
/* Include in the mingw32 libraries with libgcc */
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_broken_pe_dwarf5" >&5
$as_echo "$gcc_cv_ld_broken_pe_dwarf5" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking PE linker --disable-dynamicbase support" >&5
+$as_echo_n "checking PE linker --disable-dynamicbase support... " >&6; }
+ gcc_cv_ld_disable_dynamicbase=no
+ if test $in_tree_ld = yes; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 36 -o "$gcc_cv_gld_major_version" -gt 2; then \
+ gcc_cv_ld_disable_dynamicbase=yes
+ fi
+ else
+ if $gcc_cv_ld --help 2>&1 | grep -q 'disable\-]dynamicbase' > /dev/null; then
+ gcc_cv_ld_disable_dynamicbase=yes
+ fi
+ fi
+ if test x"$gcc_cv_ld_disable_dynamicbase" = xyes; then
+
+$as_echo "#define HAVE_LD_PE_DISABLE_DYNAMICBASE 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_disable_dynamicbase" >&5
+$as_echo "$gcc_cv_ld_disable_dynamicbase" >&6; }
;;
esac
[Define if the PE linker has broken DWARF 5 support.])
fi
AC_MSG_RESULT($gcc_cv_ld_broken_pe_dwarf5)
+
+ AC_MSG_CHECKING(PE linker --disable-dynamicbase support)
+ gcc_cv_ld_disable_dynamicbase=no
+ if test $in_tree_ld = yes; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 36 -o "$gcc_cv_gld_major_version" -gt 2; then \
+ gcc_cv_ld_disable_dynamicbase=yes
+ fi
+ else
+ if $gcc_cv_ld --help 2>&1 | grep -q 'disable\-]dynamicbase' > /dev/null; then
+ gcc_cv_ld_disable_dynamicbase=yes
+ fi
+ fi
+ if test x"$gcc_cv_ld_disable_dynamicbase" = xyes; then
+ AC_DEFINE(HAVE_LD_PE_DISABLE_DYNAMICBASE, 1,
+ [Define if the PE linker supports --disable-dynamicbase option.])
+ fi
+ AC_MSG_RESULT($gcc_cv_ld_disable_dynamicbase)
;;
esac