1 2004-09-08 H.J. Lu <hongjiu.lu@intel.com>
3 * Makeconfig (libunwind): New.
4 (libgcc_eh): Add $(libunwind).
5 (gnulib): Always set to -lgcc $(libgcc_eh).
6 (static-gnulib): Always set to -lgcc -lgcc_eh $(libunwind).
9 * Makerules (LDLIBS-c.so): Use $(libc.so-gnulib) instead of
12 * configure.in (libc_cv_cc_with_libunwind): Set to yes if gcc
13 uses -lunwind for static binaries.
14 * configure: Regenerated.
16 --- libc/Makeconfig.unwind 2004-08-11 14:23:00.000000000 -0700
17 +++ libc/Makeconfig 2004-09-08 10:07:59.512198328 -0700
18 @@ -521,18 +521,19 @@ link-libc-bounded = $(common-objpfx)libc
19 link-extra-libs-bounded = $(foreach lib,$(LDLIBS-$(@F:%-bp=%)),$(common-objpfx)$(lib)_b.a)
22 -ifneq ($(have-as-needed),yes)
23 - libgcc_eh := -lgcc_eh
24 +ifneq ($(have-cc-with-libunwind),yes)
27 - libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) -Wl,--no-as-needed
28 + libunwind = -lunwind
30 -ifneq ($(have-cc-with-libunwind),yes)
31 - gnulib := -lgcc $(libgcc_eh)
32 - static-gnulib := -lgcc -lgcc_eh
33 +ifneq ($(have-as-needed),yes)
34 + libgcc_eh := -lgcc_eh $(libunwind)
36 - gnulib := -lgcc $(libgcc_eh) -lunwind
37 - static-gnulib := -lgcc -lgcc_eh -lunwind
38 + libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) $(libunwind) -Wl,--no-as-needed
40 +gnulib := -lgcc $(libgcc_eh)
41 +static-gnulib := -lgcc -lgcc_eh $(libunwind)
42 +libc.so-gnulib := -lgcc
45 +preinit = $(addprefix $(csu-objpfx),crti.o)
46 --- libc/Makerules.unwind 2004-09-01 15:44:48.000000000 -0700
47 +++ libc/Makerules 2004-09-08 09:12:53.000000000 -0700
48 @@ -581,8 +581,8 @@ build-shlib-objlist = $(build-module-hel
49 # Also omits crti.o and crtn.o, which we do not want
50 # since we define our own `.init' section specially.
51 LDFLAGS-c.so = -nostdlib -nostartfiles
52 -# But we still want to link libc.so against $(static-gnulib).
53 -LDLIBS-c.so += $(static-gnulib)
54 +# But we still want to link libc.so against $(libc.so-gnulib).
55 +LDLIBS-c.so += $(libc.so-gnulib)
56 # Give libc.so an entry point and make it directly runnable itself.
57 LDFLAGS-c.so += -e __libc_main
58 # If lazy relocation is disabled add the -z now flag.
59 --- libc/configure.in.unwind 2004-09-08 09:12:53.000000000 -0700
60 +++ libc/configure.in 2004-09-08 09:12:53.000000000 -0700
61 @@ -1309,13 +1309,17 @@ EOF
64 AC_CACHE_CHECK(for libunwind-support in compiler,
65 - libc_cv_cc_with_libunwind, [dnl
66 - AC_TRY_LINK([#include <libunwind.h>], [
69 - unw_getcontext (&uc);
70 - unw_init_local (&c, &uc)],
71 - libc_cv_cc_with_libunwind=yes, libc_cv_cc_with_libunwind=no)])
72 + libc_cv_cc_with_libunwind, [
73 + cat > conftest.c <<EOF
74 +int main (void) { return 0; }
76 + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
77 + conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
78 + libc_cv_cc_with_libunwind=yes
80 + libc_cv_cc_with_libunwind=no
83 AC_SUBST(libc_cv_cc_with_libunwind)
84 if test $libc_cv_cc_with_libunwind = yes; then
85 AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)