+2017-06-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (gcc_cv_ld_static_dynamic): Also check stderr for
+ $gcc_cv_ld --help output.
+ (gcc_cv_ld_demangle): Likewise.
+ (gcc_cv_ld_eh_frame_hdr): Likewise.
+ (gcc_cv_ld_pie): Likewise.
+ (gcc_cv_ld_as_needed): Likewise. Prefer native forms unless $gnu_ld.
+ (gcc_cv_ld_buildid): Likewise.
+ (gcc_cv_ld_sysroot): Likewise.
+ (ld_bndplt_support): Likewise.
+ (ld_pushpopstate_support): Likewise.
+ * configure: Regenerate.
+ * config/sol2.h [!USE_GLD] (SYSROOT_SPEC): Define.
+
2017-06-21 Jakub Jelinek <jakub@redhat.com>
PR target/81151
#define RDYNAMIC_SPEC "--export-dynamic"
#endif
+#ifndef USE_GLD
+/* Prefer native form with Solaris ld. */
+#define SYSROOT_SPEC "-z sysroot=%R"
+#endif
+
#ifndef USE_GLD
/* With Sun ld, use mapfile to enforce direct binding to libgcc_s unwinder. */
#define LINK_LIBGCC_MAPFILE_SPEC \
fi
elif test x$gcc_cv_ld != x; then
# Check if linker supports -Bstatic/-Bdynamic option
- if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \
- && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep -- -Bstatic > /dev/null \
+ && $gcc_cv_ld --help 2>&1 | grep -- -Bdynamic > /dev/null; then
gcc_cv_ld_static_dynamic=yes
else
case "$target" in
fi
elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then
# Check if the GNU linker supports --demangle option
- if $gcc_cv_ld --help 2>/dev/null | grep no-demangle > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep no-demangle > /dev/null; then
gcc_cv_ld_demangle=yes
fi
fi
elif test x$gcc_cv_ld != x; then
if echo "$ld_ver" | grep GNU > /dev/null; then
# Check if linker supports --eh-frame-hdr option
- if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep eh-frame-hdr > /dev/null; then
gcc_cv_ld_eh_frame_hdr=yes
fi
else
fi
elif test x$gcc_cv_ld != x; then
# Check if linker supports -pie option
- if $gcc_cv_ld --help 2>/dev/null | grep -- -pie > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep -- -pie > /dev/null; then
gcc_cv_ld_pie=yes
case "$target" in
*-*-solaris2*)
gcc_cv_ld_as_needed=yes
fi
elif test x$gcc_cv_ld != x; then
- # Check if linker supports --as-needed and --no-as-needed options
- if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then
- gcc_cv_ld_as_needed=yes
- else
- case "$target" in
- # Solaris 2 ld always supports -z ignore/-z record.
- *-*-solaris2*)
- gcc_cv_ld_as_needed=yes
- gcc_cv_ld_as_needed_option="-z ignore"
- gcc_cv_ld_no_as_needed_option="-z record"
- ;;
- esac
- fi
+ # Check if linker supports --as-needed and --no-as-needed options
+ if $gcc_cv_ld --help 2>&1 | grep as-needed > /dev/null; then
+ gcc_cv_ld_as_needed=yes
+ fi
+ case "$target:$gnu_ld" in
+ *-*-solaris2*:no)
+ # Solaris 2 ld always supports -z ignore/-z record. Prefer the native
+ # forms.
+ gcc_cv_ld_as_needed=yes
+ gcc_cv_ld_as_needed_option="-z ignore"
+ gcc_cv_ld_no_as_needed_option="-z record"
+ ;;
+ esac
fi
# --as-needed/-z ignore can only be used if libgcc_s.so.1 uses
# dl_iterate_phdr, i.e. since Solaris 11.
gcc_cv_ld_buildid=yes
fi
elif test x$gcc_cv_ld != x; then
- if $gcc_cv_ld --help 2>/dev/null | grep build-id > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep build-id > /dev/null; then
gcc_cv_ld_buildid=yes
fi
fi
gcc_cv_ld_sysroot=yes
fi
elif test x$gcc_cv_ld != x; then
- if $gcc_cv_ld --help 2>/dev/null | grep sysroot > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep sysroot > /dev/null; then
gcc_cv_ld_sysroot=yes
fi
fi
fi
elif test x$gcc_cv_ld != x; then
# Check if linker supports -a bndplt option
- if $gcc_cv_ld --help 2>/dev/null | grep -- '-z bndplt' > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep -- '-z bndplt' > /dev/null; then
ld_bndplt_support=yes
fi
fi
fi
elif test x$gcc_cv_ld != x; then
# Check if linker supports --push-state/--pop-state options
- if $gcc_cv_ld --help 2>/dev/null | grep -- '--push-state' > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep -- '--push-state' > /dev/null; then
ld_pushpopstate_support=yes
fi
fi
fi
elif test x$gcc_cv_ld != x; then
# Check if linker supports -Bstatic/-Bdynamic option
- if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \
- && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep -- -Bstatic > /dev/null \
+ && $gcc_cv_ld --help 2>&1 | grep -- -Bdynamic > /dev/null; then
gcc_cv_ld_static_dynamic=yes
else
case "$target" in
fi
elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then
# Check if the GNU linker supports --demangle option
- if $gcc_cv_ld --help 2>/dev/null | grep no-demangle > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep no-demangle > /dev/null; then
gcc_cv_ld_demangle=yes
fi
fi
elif test x$gcc_cv_ld != x; then
if echo "$ld_ver" | grep GNU > /dev/null; then
# Check if linker supports --eh-frame-hdr option
- if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep eh-frame-hdr > /dev/null; then
gcc_cv_ld_eh_frame_hdr=yes
fi
else
fi
elif test x$gcc_cv_ld != x; then
# Check if linker supports -pie option
- if $gcc_cv_ld --help 2>/dev/null | grep -- -pie > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep -- -pie > /dev/null; then
gcc_cv_ld_pie=yes
case "$target" in
*-*-solaris2*)
gcc_cv_ld_as_needed=yes
fi
elif test x$gcc_cv_ld != x; then
- # Check if linker supports --as-needed and --no-as-needed options
- if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then
- gcc_cv_ld_as_needed=yes
- else
- case "$target" in
- # Solaris 2 ld always supports -z ignore/-z record.
- *-*-solaris2*)
- gcc_cv_ld_as_needed=yes
- gcc_cv_ld_as_needed_option="-z ignore"
- gcc_cv_ld_no_as_needed_option="-z record"
- ;;
- esac
- fi
+ # Check if linker supports --as-needed and --no-as-needed options
+ if $gcc_cv_ld --help 2>&1 | grep as-needed > /dev/null; then
+ gcc_cv_ld_as_needed=yes
+ fi
+ case "$target:$gnu_ld" in
+ *-*-solaris2*:no)
+ # Solaris 2 ld always supports -z ignore/-z record. Prefer the native
+ # forms.
+ gcc_cv_ld_as_needed=yes
+ gcc_cv_ld_as_needed_option="-z ignore"
+ gcc_cv_ld_no_as_needed_option="-z record"
+ ;;
+ esac
fi
# --as-needed/-z ignore can only be used if libgcc_s.so.1 uses
# dl_iterate_phdr, i.e. since Solaris 11.
gcc_cv_ld_buildid=yes
fi
elif test x$gcc_cv_ld != x; then
- if $gcc_cv_ld --help 2>/dev/null | grep build-id > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep build-id > /dev/null; then
gcc_cv_ld_buildid=yes
fi
fi])
gcc_cv_ld_sysroot=yes
fi
elif test x$gcc_cv_ld != x; then
- if $gcc_cv_ld --help 2>/dev/null | grep sysroot > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep sysroot > /dev/null; then
gcc_cv_ld_sysroot=yes
fi
fi])
fi
elif test x$gcc_cv_ld != x; then
# Check if linker supports -a bndplt option
- if $gcc_cv_ld --help 2>/dev/null | grep -- '-z bndplt' > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep -- '-z bndplt' > /dev/null; then
ld_bndplt_support=yes
fi
fi
fi
elif test x$gcc_cv_ld != x; then
# Check if linker supports --push-state/--pop-state options
- if $gcc_cv_ld --help 2>/dev/null | grep -- '--push-state' > /dev/null; then
+ if $gcc_cv_ld --help 2>&1 | grep -- '--push-state' > /dev/null; then
ld_pushpopstate_support=yes
fi
fi