@@ -6190,6 +6190,31 @@ if test x"$ld64_flag" = x"yes"; then
[Define to 1 if ld64 supports '-export_dynamic'.])
fi
+case $target_os in
+ win32 | pe | cygwin* | mingw32*)
+ AC_MSG_CHECKING(broken PE linker dwarf5 support)
+ gcc_cv_ld_broken_pe_dwarf5=yes
+ if test $in_tree_ld = yes ; then
+ if grep -q '\.debug_loclists.*BLOCK.*__section_alignment__.*NOLOAD.*:' \
+ $gcc_cv_ld_gld_srcdir/scripttempl/pe*.sc \
+ && grep -q '\.debug_rnglists.*BLOCK.*__section_alignment__.*NOLOAD.*:' \
+ $gcc_cv_ld_gld_srcdir/scripttempl/pe*.sc; then
+ gcc_cv_ld_broken_pe_dwarf5=no
+ fi
+ else
+ if $gcc_cv_ld --verbose 2>&1 | grep -q '\.debug_loclists.*BLOCK.*__section_alignment__.*NOLOAD.*:' \
+ && $gcc_cv_ld --verbose 2>&1 | grep -q '\.debug_rnglists.*BLOCK.*__section_alignment__.*NOLOAD.*:'; then
+ gcc_cv_ld_broken_pe_dwarf5=no
+ fi
+ fi
+ if test x$gcc_cv_ld_broken_pe_dwarf5 = xyes; then
+ AC_DEFINE(HAVE_LD_BROKEN_PE_DWARF5, 1,
+ [Define if the PE linker has broken DWARF 5 support.])
+ fi
+ AC_MSG_RESULT($gcc_cv_ld_broken_pe_dwarf5)
+ ;;
+esac
+
# --------
# UNSORTED
# --------
@@ -1861,6 +1861,13 @@ ix86_option_override_internal (bool main
SUBSUBTARGET_OVERRIDE_OPTIONS;
#endif
+#ifdef HAVE_LD_BROKEN_PE_DWARF5
+ /* If the PE linker has broken DWARF 5 support, make
+ DWARF 4 the default. */
+ if (TARGET_PECOFF)
+ SET_OPTION_IF_UNSET (opts, opts_set, dwarf_version, 4);
+#endif
+
/* -fPIC is the default for x86_64. */
if (TARGET_MACHO && TARGET_64BIT_P (opts->x_ix86_isa_flags))
opts->x_flag_pic = 2;
@@ -1580,6 +1580,12 @@
#endif
+/* Define if the PE linker has broken DWARF 5 support. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_LD_BROKEN_PE_DWARF5
+#endif
+
+
/* Define if your linker supports --build-id. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_BUILDID
@@ -19392,7 +19392,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19405 "configure"
+#line 19395 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19498,7 +19498,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19511 "configure"
+#line 19501 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -22237,16 +22237,6 @@ freebsd* | dragonfly*)
esac
;;
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux
need_lib_prefix=no
@@ -22368,7 +22358,7 @@ linux*oldld* | linux*aout* | linux*coff*
# project, but have not yet been accepted: they are GCC-local changes
# for the time being. (See
# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html)
-linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | uclinuxfdpiceabi)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -30223,6 +30213,34 @@ _ACEOF
fi
+case $target_os in
+ win32 | pe | cygwin* | mingw32*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking broken PE linker dwarf5 support" >&5
+$as_echo_n "checking broken PE linker dwarf5 support... " >&6; }
+ gcc_cv_ld_broken_pe_dwarf5=yes
+ if test $in_tree_ld = yes ; then
+ if grep -q '\.debug_loclists.*BLOCK.*__section_alignment__.*NOLOAD.*:' \
+ $gcc_cv_ld_gld_srcdir/scripttempl/pe*.sc \
+ && grep -q '\.debug_rnglists.*BLOCK.*__section_alignment__.*NOLOAD.*:' \
+ $gcc_cv_ld_gld_srcdir/scripttempl/pe*.sc; then
+ gcc_cv_ld_broken_pe_dwarf5=no
+ fi
+ else
+ if $gcc_cv_ld --verbose 2>&1 | grep -q '\.debug_loclists.*BLOCK.*__section_alignment__.*NOLOAD.*:' \
+ && $gcc_cv_ld --verbose 2>&1 | grep -q '\.debug_rnglists.*BLOCK.*__section_alignment__.*NOLOAD.*:'; then
+ gcc_cv_ld_broken_pe_dwarf5=no
+ fi
+ fi
+ if test x$gcc_cv_ld_broken_pe_dwarf5 = xyes; then
+
+$as_echo "#define HAVE_LD_BROKEN_PE_DWARF5 1" >>confdefs.h
+
+ 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; }
+ ;;
+esac
+
# --------
# UNSORTED
# --------