Commit 7e9d8517 by H.J. Lu Committed by H.J. Lu

re PR target/18153 (-static-libgcc links in libunwind.so.7)

2004-12-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/18153
	* configure.ac: Define HAVE_LD_STATIC_DYNAMIC if linker supports
	-Bstatic/-Bdynamic option.
	* config.in: Regenerated.
	* configure: Likewise.

	* gcc.c (init_spec): Pass -Bstatic/-Bdynamic to ld for static
	-lunwind if possible.

From-SVN: r92229
parent 19fabfe0
2004-12-15 H.J. Lu <hongjiu.lu@intel.com>
PR target/18153
* configure.ac: Define HAVE_LD_STATIC_DYNAMIC if linker supports
-Bstatic/-Bdynamic option.
* config.in: Regenerated.
* configure: Likewise.
* gcc.c (init_spec): Pass -Bstatic/-Bdynamic to ld for static
-lunwind if possible.
2004-12-15 Daniel Berlin <dberlin@dberlin.org>
* cfgloop.c (flow_loops_dump): Don't print out levels.
......
......@@ -370,6 +370,9 @@
a read-write section. */
#undef HAVE_LD_RO_RW_SECTION_MIXING
/* Define if your linker supports -Bstatic/-Bdynamic option. */
#undef HAVE_LD_STATIC_DYNAMIC
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
......
......@@ -13960,6 +13960,30 @@ fi
# Target-specific assembler checks.
echo "$as_me:$LINENO: checking linker -Bstatic/-Bdynamic option" >&5
echo $ECHO_N "checking linker -Bstatic/-Bdynamic option... $ECHO_C" >&6
gcc_cv_ld_static_dynamic=no
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then
gcc_cv_ld_static_dynamic=yes
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
gcc_cv_ld_static_dynamic=yes
fi
fi
if test x"$gcc_cv_ld_static_dynamic" = xyes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_LD_STATIC_DYNAMIC 1
_ACEOF
fi
echo "$as_me:$LINENO: result: $gcc_cv_ld_static_dynamic" >&5
echo "${ECHO_T}$gcc_cv_ld_static_dynamic" >&6
if test x"$demangler_in_ld" = xyes; then
echo "$as_me:$LINENO: checking linker --demangle support" >&5
echo $ECHO_N "checking linker --demangle support... $ECHO_C" >&6
......
......@@ -2518,6 +2518,25 @@ fi
# Target-specific assembler checks.
AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option)
gcc_cv_ld_static_dynamic=no
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then
gcc_cv_ld_static_dynamic=yes
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
gcc_cv_ld_static_dynamic=yes
fi
fi
if test x"$gcc_cv_ld_static_dynamic" = xyes; then
AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1,
[Define if your linker supports -Bstatic/-Bdynamic option.])
fi
AC_MSG_RESULT($gcc_cv_ld_static_dynamic)
if test x"$demangler_in_ld" = xyes; then
AC_MSG_CHECKING(linker --demangle support)
gcc_cv_ld_demangle=no
......
......@@ -1715,7 +1715,11 @@ init_spec (void)
"-lgcc",
"-lgcc_eh"
#ifdef USE_LIBUNWIND_EXCEPTIONS
# ifdef HAVE_LD_STATIC_DYNAMIC
" %{!static:-Bstatic} -lunwind %{!static:-Bdynamic}"
# else
" -lunwind"
# endif
#endif
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment