From 443728bba4b4ec9b9177121022571b036a8b01bf Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 4 Sep 2004 00:15:42 +0000 Subject: [PATCH] re PR target/14925 (libunwind enabled gcc generates incompatible libgcc_s.so.1) 2004-09-03 H.J. Lu PR target/14925: Makefile.in (LIB2ADDEHSTATIC): New. (LIB2ADDEHSHARED): New. (LIBUNWIND): New. (LIBUNWINDDEP): New. (SHLIBUNWIND_LINK): New. (SHLIBUNWIND_INSTALL): New. (libgcc.mk): Pass LIB2ADDEHSTATIC, LIB2ADDEHSHARED, LIBUNWIND, LIBUNWINDDEP, SHLIBUNWIND_LINK and SHLIBUNWIND_INSTALL. (clean): Remove libunwind* (stage1-start): Remove and copy stage1/libunwind*. (stage2-start): Remove and copy stage2/libunwind*. (stage3-start): Remove and copy stage3/libunwind*. (stage4-start): Remove and copy stage4/libunwind*. (stageprofile-start): Remove and copy stageprofile/libunwind*. (stagefeedback-start): Remove and copy stagefeedback/libunwind*. * config.gcc (ia64*-*-linux*): Always add t-libunwind to tmake_file. Add t-libunwind-elf and ia64/t-glibc-libunwind to tmake_file if --with-system-libunwind isn't used. * config/ia64/t-glibc-libunwind: New file. * config/t-libunwind-elf: Likewise. * unwind-compat.c: Likewise. * unwind-compat.h: Likewise. * unwind-dw2-fde-compat.c: Likewise. * config/ia64/t-glibc (LIB2ADDEH): Updated. * config/ia64/t-hpux (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. * config/ia64/unwind-ia64.c: Include "unwind-compat.h". Define aliases if needed. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * config/t-libunwind (LIB2ADDEH): Updated. (LIB2ADDEHSTATIC): New. (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. (TARGET_LIBGCC2_CFLAGS): Set to -DUSE_GAS_SYMVER. * configure.ac: Change --enable-libunwind-exceptions to --with-system-libunwind. Don't define USE_LIBUNWIND_EXCEPTIONS. * configure: Regenerated. * config.in: Updated. * doc/install.texi (ia64-*-linux): Require libunwind 0.98 or above and mention --with-system-libunwind. (ia64-*-hpux*): Mention --enable-libunwind-exceptions is removed in gcc 3.4.3 and later. * gcc.c (init_spec): Add -lunwind to -lgcc_s if USE_LIBUNWIND_EXCEPTIONS is defined. * mklibgcc.in: Support libunwind. From-SVN: r87066 --- gcc/ChangeLog | 57 ++++++ gcc/Makefile.in | 27 +++ gcc/config.gcc | 8 +- gcc/config.in | 3 - gcc/config/ia64/t-glibc | 4 +- gcc/config/ia64/t-glibc-libunwind | 4 + gcc/config/ia64/t-hpux | 2 + gcc/config/ia64/unwind-ia64.c | 21 +++ gcc/config/t-libunwind | 9 +- gcc/config/t-libunwind-elf | 26 +++ gcc/configure | 279 ++++++++++++++---------------- gcc/configure.ac | 18 +- gcc/doc/install.texi | 7 +- gcc/gcc.c | 3 + gcc/mklibgcc.in | 159 +++++++++++++++-- gcc/unwind-compat.c | 206 ++++++++++++++++++++++ gcc/unwind-compat.h | 35 ++++ gcc/unwind-dw2-fde-compat.c | 46 +++++ gcc/unwind-dw2-fde-glibc.c | 5 + gcc/unwind-dw2.c | 20 +++ 20 files changed, 754 insertions(+), 185 deletions(-) create mode 100644 gcc/config/ia64/t-glibc-libunwind create mode 100644 gcc/config/t-libunwind-elf create mode 100644 gcc/unwind-compat.c create mode 100644 gcc/unwind-compat.h create mode 100644 gcc/unwind-dw2-fde-compat.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02b82890f90..743aad8cafd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,60 @@ +2004-09-03 H.J. Lu + + PR target/14925: + Makefile.in (LIB2ADDEHSTATIC): New. + (LIB2ADDEHSHARED): New. + (LIBUNWIND): New. + (LIBUNWINDDEP): New. + (SHLIBUNWIND_LINK): New. + (SHLIBUNWIND_INSTALL): New. + (libgcc.mk): Pass LIB2ADDEHSTATIC, LIB2ADDEHSHARED, LIBUNWIND, + LIBUNWINDDEP, SHLIBUNWIND_LINK and SHLIBUNWIND_INSTALL. + (clean): Remove libunwind* + (stage1-start): Remove and copy stage1/libunwind*. + (stage2-start): Remove and copy stage2/libunwind*. + (stage3-start): Remove and copy stage3/libunwind*. + (stage4-start): Remove and copy stage4/libunwind*. + (stageprofile-start): Remove and copy stageprofile/libunwind*. + (stagefeedback-start): Remove and copy stagefeedback/libunwind*. + + * config.gcc (ia64*-*-linux*): Always add t-libunwind to + tmake_file. Add t-libunwind-elf and ia64/t-glibc-libunwind to + tmake_file if --with-system-libunwind isn't used. + + * config/ia64/t-glibc-libunwind: New file. + * config/t-libunwind-elf: Likewise. + * unwind-compat.c: Likewise. + * unwind-compat.h: Likewise. + * unwind-dw2-fde-compat.c: Likewise. + + * config/ia64/t-glibc (LIB2ADDEH): Updated. + * config/ia64/t-hpux (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. + + * config/ia64/unwind-ia64.c: Include "unwind-compat.h". Define + aliases if needed. + * unwind-dw2-fde-glibc.c: Likewise. + * unwind-dw2.c: Likewise. + + * config/t-libunwind (LIB2ADDEH): Updated. + (LIB2ADDEHSTATIC): New. + (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. + (TARGET_LIBGCC2_CFLAGS): Set to -DUSE_GAS_SYMVER. + + * configure.ac: Change --enable-libunwind-exceptions to + --with-system-libunwind. Don't define USE_LIBUNWIND_EXCEPTIONS. + * configure: Regenerated. + * config.in: Updated. + + * doc/install.texi (ia64-*-linux): Require libunwind 0.98 or + above and mention --with-system-libunwind. + (ia64-*-hpux*): Mention --enable-libunwind-exceptions is + removed in gcc 3.4.3 and later. + + * gcc.c (init_spec): Add -lunwind to -lgcc_s if + USE_LIBUNWIND_EXCEPTIONS is defined. + + * mklibgcc.in: Support libunwind. + 2004-09-03 H.J. Lu * config/i386/i386.c (x86_branch_hints): Remove m_PENT4 and diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 3654ff09c8d..5990d2a7ec8 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -532,8 +532,16 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ # Additional sources to handle exceptions; overridden by targets as needed. LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c +LIB2ADDEHSTATIC = $(LIB2ADDEH) +LIB2ADDEHSHARED = $(LIB2ADDEH) LIB2ADDEHDEP = unwind.h unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h +# Don't build libunwind by default. +LIBUNWIND = +LIBUNWINDDEP = +SHLIBUNWIND_LINK = +SHLIBUNWIND_INSTALL = + # nm flags to list global symbols in libgcc object files. SHLIB_NM_FLAGS = -pg @@ -1205,7 +1213,13 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext LIB2ADD='$(LIB2ADD)' \ LIB2ADD_ST='$(LIB2ADD_ST)' \ LIB2ADDEH='$(LIB2ADDEH)' \ + LIB2ADDEHSTATIC='$(LIB2ADDEHSTATIC)' \ + LIB2ADDEHSHARED='$(LIB2ADDEHSHARED)' \ LIB2ADDEHDEP='$(LIB2ADDEHDEP)' \ + LIBUNWIND='$(LIBUNWIND)' \ + LIBUNWINDDEP='$(LIBUNWINDDEP)' \ + SHLIBUNWIND_LINK='$(SHLIBUNWIND_LINK)' \ + SHLIBUNWIND_INSTALL='$(SHLIBUNWIND_INSTALL)' \ FPBIT='$(FPBIT)' \ FPBIT_FUNCS='$(FPBIT_FUNCS)' \ LIB2_DIVMOD_FUNCS='$(LIB2_DIVMOD_FUNCS)' \ @@ -3051,6 +3065,7 @@ mostlyclean: lang.mostlyclean clean: mostlyclean lang.clean -rm -f libgcc.a libgcc_eh.a libgcov.a -rm -f libgcc_s$(SHLIB_EXT) libgcc_s$(SHLIB_EXT).1 + -rm -f libunwind* -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h -rm -f options.c options.h optionlist -rm -f cs-* @@ -3880,6 +3895,7 @@ stage1-start: -if [ -f collect-ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi -rm -f stage1/libgcc.a stage1/libgcc_eh.a stage1/libgcov.a -rm -f stage1/libgcc_s*$(SHLIB_EXT) + -rm -f stage1/libunwind* -cp libgcc.a stage1 -$(RANLIB_FOR_TARGET) stage1/libgcc.a -cp libgcov.a stage1 @@ -3888,6 +3904,7 @@ stage1-start: $(RANLIB_FOR_TARGET) stage1/libgcc_eh.a; \ fi -cp libgcc_s*$(SHLIB_EXT) stage1 + -cp libunwind* stage1 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ cp stage1/$${f} . ; \ else true; \ @@ -3915,6 +3932,7 @@ stage2-start: -if [ -f collect-ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi -rm -f stage2/libgcc.a stage2/libgcov.a stage2/libgcc_eh.a -rm -f stage2/libgcc_s*$(SHLIB_EXT) + -rm -f stage2/libunwind* -cp libgcc.a stage2 -$(RANLIB_FOR_TARGET) stage2/libgcc.a -cp libgcov.a stage2 @@ -3923,6 +3941,7 @@ stage2-start: $(RANLIB_FOR_TARGET) stage2/libgcc_eh.a; \ fi -cp libgcc_s*$(SHLIB_EXT) stage2 + -cp libunwind* stage2 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ cp stage2/$${f} . ; \ else true; \ @@ -3946,6 +3965,7 @@ stage3-start: -if [ -f collect-ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi -rm -f stage3/libgcc.a stage3/libgcov.a stage3/libgcc_eh.a -rm -f stage3/libgcc_s*$(SHLIB_EXT) + -rm -f stage3/libunwind* -cp libgcc.a stage3 -$(RANLIB_FOR_TARGET) stage3/libgcc.a -cp libgcov.a stage3 @@ -3954,6 +3974,7 @@ stage3-start: $(RANLIB_FOR_TARGET) stage3/libgcc_eh.a; \ fi -cp libgcc_s*$(SHLIB_EXT) stage3 + -cp libunwind* stage3 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ cp stage3/$${f} . ; \ else true; \ @@ -3977,6 +3998,7 @@ stage4-start: -if [ -f collect-ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi -rm -f stage4/libgcc.a stage4/libgcov.a stage4/libgcc_eh.a -rm -f stage4/libgcc_s*$(SHLIB_EXT) + -rm -f stage4/libunwind* -cp libgcc.a stage4 -$(RANLIB_FOR_TARGET) stage4/libgcc.a -cp libgcov.a stage4 @@ -3985,6 +4007,7 @@ stage4-start: $(RANLIB_FOR_TARGET) stage4/libgcc_eh.a; \ fi -cp libgcc_s*$(SHLIB_EXT) stage4 + -cp libunwind* stage4 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ cp stage4/$${f} . ; \ else true; \ @@ -4006,6 +4029,7 @@ stageprofile-start: -if [ -f collect-ld$(exeext) ] ; then (cd stageprofile && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi -rm -f stageprofile/libgcc.a stageprofile/libgcov.a stageprofile/libgcc_eh.a -rm -f stageprofile/libgcc_s*$(SHLIB_EXT) + -rm -f stageprofile/libunwind* -cp libgcc.a stageprofile -$(RANLIB_FOR_TARGET) stageprofile/libgcc.a -cp libgcov.a stageprofile @@ -4014,6 +4038,7 @@ stageprofile-start: $(RANLIB_FOR_TARGET) stageprofile/libgcc_eh.a; \ fi -cp libgcc_s*$(SHLIB_EXT) stageprofile + -cp libunwind* stageprofile -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ cp stageprofile/$${f} . ; \ else true; \ @@ -4035,6 +4060,7 @@ stagefeedback-start: -if [ -f collect-ld$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi -rm -f stagefeedback/libgcc.a stagefeedback/libgcov.a stagefeedback/libgcc_eh.a -rm -f stagefeedback/libgcc_s*$(SHLIB_EXT) + -rm -f stagefeedback/libunwind* -rm -f *.da -for dir in fixinc po testsuite $(SUBDIRS); \ do \ @@ -4048,6 +4074,7 @@ stagefeedback-start: $(RANLIB_FOR_TARGET) stagefeedback/libgcc_eh.a; \ fi -cp libgcc_s*$(SHLIB_EXT) stagefeedback + -cp libunwind* stagefeedback -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \ cp stagefeedback/$${f} . ; \ else true; \ diff --git a/gcc/config.gcc b/gcc/config.gcc index 79c5e878bd4..4f955a02b62 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1148,12 +1148,12 @@ ia64*-*-freebsd*) ;; ia64*-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h ia64/sysv4.h ia64/linux.h" - tmake_file="${tmake_file} ia64/t-ia64 ia64/t-glibc" + tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc" + if test x$with_system_libunwind != xyes ; then + tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" + fi target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o" - if test x"$use_libunwind_exceptions" = xyes; then - tmake_file="$tmake_file t-libunwind" - fi ;; ia64*-*-hpux*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h ia64/sysv4.h ia64/hpux.h" diff --git a/gcc/config.in b/gcc/config.in index f169e6dfdb1..42e5795e6f6 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -573,9 +573,6 @@ /* Define if your assembler mis-optimizes .eh_frame data. */ #undef USE_AS_TRADITIONAL_FORMAT -/* Define if gcc should use -lunwind. */ -#undef USE_LIBUNWIND_EXCEPTIONS - /* Define to 1 if the 'long long' (or '__int64') is wider than 'long' but still efficiently supported by the host hardware. */ #undef USE_LONG_LONG_FOR_WIDEST_FAST_INT diff --git a/gcc/config/ia64/t-glibc b/gcc/config/ia64/t-glibc index a1056628b50..df4fe9c4404 100644 --- a/gcc/config/ia64/t-glibc +++ b/gcc/config/ia64/t-glibc @@ -1 +1,3 @@ -LIB2ADDEH += $(srcdir)/config/ia64/fde-glibc.c +# Use system libunwind library on IA-64 GLIBC based system. +LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ + $(srcdir)/unwind-compat.c diff --git a/gcc/config/ia64/t-glibc-libunwind b/gcc/config/ia64/t-glibc-libunwind new file mode 100644 index 00000000000..df78f1d094f --- /dev/null +++ b/gcc/config/ia64/t-glibc-libunwind @@ -0,0 +1,4 @@ +# Build libunwind for IA-64 GLIBC based system. +LIBUNWIND = $(srcdir)/config/ia64/fde-glibc.c \ + $(srcdir)/config/ia64/unwind-ia64.c +LIBUNWINDDEP = unwind.inc diff --git a/gcc/config/ia64/t-hpux b/gcc/config/ia64/t-hpux index 597c2acbe2a..d89f174592c 100644 --- a/gcc/config/ia64/t-hpux +++ b/gcc/config/ia64/t-hpux @@ -23,6 +23,8 @@ LIBGCC1_TEST = # We do not want to include the EH stuff that linux uses, we want to use # the HP-UX libunwind library. +T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS + LIB2ADDEH = SHLIB_EXT = .so diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c index 1c88b729064..692f07b1adf 100644 --- a/gcc/config/ia64/unwind-ia64.c +++ b/gcc/config/ia64/unwind-ia64.c @@ -37,6 +37,7 @@ #include "tm.h" #include "unwind.h" #include "unwind-ia64.h" +#include "unwind-compat.h" #include "ia64intrin.h" /* This isn't thread safe, but nice for occasional tests. */ @@ -2381,4 +2382,24 @@ uw_identify_context (struct _Unwind_Context *context) } #include "unwind.inc" + +#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS) +alias (_Unwind_Backtrace); +alias (_Unwind_DeleteException); +alias (_Unwind_FindEnclosingFunction); +alias (_Unwind_FindTableEntry); +alias (_Unwind_ForcedUnwind); +alias (_Unwind_GetBSP); +alias (_Unwind_GetCFA); +alias (_Unwind_GetGR); +alias (_Unwind_GetIP); +alias (_Unwind_GetLanguageSpecificData); +alias (_Unwind_GetRegionStart); +alias (_Unwind_RaiseException); +alias (_Unwind_Resume); +alias (_Unwind_Resume_or_Rethrow); +alias (_Unwind_SetGR); +alias (_Unwind_SetIP); +#endif + #endif diff --git a/gcc/config/t-libunwind b/gcc/config/t-libunwind index 2204ae316d7..121ce2e47b6 100644 --- a/gcc/config/t-libunwind +++ b/gcc/config/t-libunwind @@ -1,5 +1,12 @@ +# Use the system libunwind library. +# # Override the default value from t-slibgcc-elf-ver and mention -lunwind # so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for # libunwind. SHLIB_LC = -lunwind -lc -LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c +LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ + $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c +LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + +T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS +TARGET_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER diff --git a/gcc/config/t-libunwind-elf b/gcc/config/t-libunwind-elf new file mode 100644 index 00000000000..ac94fac4ab0 --- /dev/null +++ b/gcc/config/t-libunwind-elf @@ -0,0 +1,26 @@ +# Build libunwind for ELF with the GNU linker. + +# Use unwind-dw2-fde-glibc +LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c +LIBUNWINDDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c + +SHLIBUNWIND_SOVERSION = 7 +SHLIBUNWIND_SONAME = @shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION) +SHLIBUNWIND_NAME = @shlib_dir@@shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION) + +SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \ + -nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \ + -Wl,-z,text -Wl,-z,defs \ + -o $(SHLIBUNWIND_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \ + rm -f $(SHLIB_SOLINK) && \ + $(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK) + +# $(slibdir) double quoted to protect it from expansion while building +# libgcc.mk. We want this delayed until actual install time. +SHLIBUNWIND_INSTALL = \ + $$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ + $(INSTALL_DATA) $(SHLIBUNWIND_NAME) \ + $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \ + rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ + $(LN_S) $(SHLIBUNWIND_SONAME) \ + $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) diff --git a/gcc/configure b/gcc/configure index 28f5551ea3c..d6e2e1731da 100755 --- a/gcc/configure +++ b/gcc/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP strict1_warn warn_cflags WERROR nocommon_flag TREEBROWSER EGREP valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file PACKAGE VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 libgcc_visibility GGC zlibdir zlibinc MAINT ANDER BANSHEEINC BANSHEELIB gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir gcc_version gcc_version_full gcc_version_trigger host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure symbolic_link thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP strict1_warn warn_cflags WERROR nocommon_flag TREEBROWSER EGREP valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file PACKAGE VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 libgcc_visibility GGC zlibdir zlibinc MAINT ANDER BANSHEEINC BANSHEELIB gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir gcc_version gcc_version_full gcc_version_trigger host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure symbolic_link thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' ac_subst_files='language_hooks' # Initialize some variables set by options. @@ -890,7 +890,6 @@ Optional Features: --enable-initfini-array use .init_array/.fini_array sections --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling - --enable-libunwind-exceptions force use libunwind for exceptions --disable-win32-registry disable lookup of installation paths in the Registry on Windows hosts @@ -923,6 +922,7 @@ Optional Packages: --with-dwarf2 force the default debug format to be DWARF 2 --with-sysroot=DIR Search for usr/lib, usr/include, et al, within DIR. --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib + --with-system-libunwind use installed libunwind --with-gc={page,zone} choose the garbage collection mechanism to use with the compiler --with-system-zlib use installed libz @@ -1031,7 +1031,7 @@ esac else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd "$ac_popdir" + cd $ac_popdir done fi @@ -1495,6 +1495,9 @@ test -n "$target_alias" && program_prefix=${target_alias}- # Determine the noncanonical target name, for directory use. +ACX_NONCANONICAL_TARGET + +# Determine the target- and build-specific subdirectories case ${build_alias} in "") build_noncanonical=${build} ;; *) build_noncanonical=${build_alias} ;; @@ -1510,10 +1513,6 @@ esac *) target_noncanonical=${target_alias} ;; esac - - - -# Determine the target- and build-specific subdirectories # Prefix 'build-' so this never conflicts with target_subdir. build_subdir="build-${build_noncanonical}" # Not really a subdirectory, but here for completeness. @@ -2383,7 +2382,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2441,7 +2441,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2557,7 +2558,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2611,7 +2613,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2656,7 +2659,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2700,7 +2704,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3106,7 +3111,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3177,7 +3183,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3236,7 +3243,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3302,7 +3310,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3372,7 +3381,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3442,7 +3452,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3512,7 +3523,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3583,7 +3595,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3655,7 +3668,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3728,7 +3742,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3778,7 +3793,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3836,7 +3852,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4071,7 +4088,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4241,7 +4259,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4304,7 +4323,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5269,7 +5289,7 @@ if test "${gcc_cv_prog_makeinfo_modern+set}" = set; then else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:5272: version of makeinfo is $ac_prog_version" >&5 + echo "configure:5292: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[2-9]*) @@ -5524,7 +5544,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5594,7 +5615,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5759,7 +5781,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5820,7 +5843,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5890,7 +5914,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6164,7 +6189,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6237,7 +6263,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6278,7 +6305,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6480,7 +6508,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6554,7 +6583,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6608,7 +6638,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6686,7 +6717,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6740,7 +6772,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6808,7 +6841,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6938,7 +6972,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7059,7 +7094,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7410,7 +7446,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7527,7 +7564,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7639,7 +7677,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7797,7 +7836,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8166,7 +8206,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8216,7 +8257,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8291,7 +8333,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8365,7 +8408,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8467,7 +8511,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8552,7 +8597,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8621,7 +8667,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8690,7 +8737,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8773,7 +8821,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8849,7 +8898,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8915,7 +8965,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9051,7 +9102,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9101,88 +9153,14 @@ _ACEOF fi; -if test x$host = x$target; then - echo "$as_me:$LINENO: checking for main in -lunwind" >&5 -echo $ECHO_N "checking for main in -lunwind... $ECHO_C" >&6 -if test "${ac_cv_lib_unwind_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lunwind $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# For platforms with the unwind ABI which includes an unwind library, +# libunwind, we can choose to use the system libunwind. +# Check whether --with-system-libunwind or --without-system-libunwind was given. +if test "${with_system_libunwind+set}" = set; then + withval="$with_system_libunwind" -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_unwind_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_unwind_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_unwind_main" >&5 -echo "${ECHO_T}$ac_cv_lib_unwind_main" >&6 -if test $ac_cv_lib_unwind_main = yes; then - use_libunwind_default=yes -else - use_libunwind_default=no -fi - -else - use_libunwind_default=no -fi -# Use libunwind based exception handling. -# Check whether --enable-libunwind-exceptions or --disable-libunwind-exceptions was given. -if test "${enable_libunwind_exceptions+set}" = set; then - enableval="$enable_libunwind_exceptions" - use_libunwind_exceptions=$enableval -else - use_libunwind_exceptions=$use_libunwind_default fi; -if test x"$use_libunwind_exceptions" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_LIBUNWIND_EXCEPTIONS 1 -_ACEOF - -fi # -------------------------------------------------------- # Build, host, and target specific configuration fragments @@ -9432,7 +9410,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9699,7 +9678,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9753,7 +9733,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13182,7 +13163,6 @@ s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t -s,@target_noncanonical@,$target_noncanonical,;t t s,@build_subdir@,$build_subdir,;t t s,@host_subdir@,$host_subdir,;t t s,@target_subdir@,$target_subdir,;t t @@ -13506,6 +13486,11 @@ esac + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -13544,12 +13529,6 @@ echo "$as_me: error: cannot find input file: $f" >&2;} fi;; esac done` || { (exit 1); exit 1; } - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub diff --git a/gcc/configure.ac b/gcc/configure.ac index 328d42a8381..1da2417c608 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1114,20 +1114,10 @@ AC_ARG_ENABLE(sjlj-exceptions, AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj, [Define 0/1 to force the choice for exception handling model.])]) -if test x$host = x$target; then - AC_CHECK_LIB(unwind, main, use_libunwind_default=yes, use_libunwind_default=no) -else - use_libunwind_default=no -fi -# Use libunwind based exception handling. -AC_ARG_ENABLE(libunwind-exceptions, -[ --enable-libunwind-exceptions force use libunwind for exceptions], -use_libunwind_exceptions=$enableval, -use_libunwind_exceptions=$use_libunwind_default) -if test x"$use_libunwind_exceptions" = xyes; then - AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1, - [Define if gcc should use -lunwind.]) -fi +# For platforms with the unwind ABI which includes an unwind library, +# libunwind, we can choose to use the system libunwind. +AC_ARG_WITH(system-libunwind, +[ --with-system-libunwind use installed libunwind]) # -------------------------------------------------------- # Build, host, and target specific configuration fragments diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index c9c012ba077..7a2d3e59266 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -2933,8 +2933,9 @@ have installed. IA-64 processor (also known as IPF, or Itanium Processor Family) running GNU/Linux. -If you are using the optional libunwind library, then you must use -libunwind 0.96 or later. +If you are using the installed system libunwind library with +@option{--with-system-libunwind}, then you must use libunwind 0.98 or +later. None of the following versions of GCC has an ABI that is compatible with any of the other versions in this list, with the exception that @@ -2956,6 +2957,8 @@ the option @option{--with-gnu-as} may be necessary. The GCC libunwind library has not been ported to HPUX. This means that for GCC versions 3.2.3 and earlier, @option{--enable-libunwind-exceptions} is required to build GCC. For GCC 3.3 and later, this is the default. +For gcc 3.4.3 and later, @option{--enable-libunwind-exceptions} is +removed and the system libunwind library will always be used. @html
diff --git a/gcc/gcc.c b/gcc/gcc.c index 7685274cc5f..8076f51c912 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1702,6 +1702,9 @@ init_spec (void) "-lgcc_s" #else "-lgcc_s%M" +#endif +#ifdef USE_LIBUNWIND_EXCEPTIONS + " -lunwind" #endif , "-lgcc", diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in index 891e474b531..ebf0a81edb4 100644 --- a/gcc/mklibgcc.in +++ b/gcc/mklibgcc.in @@ -14,7 +14,13 @@ # LIB2ADD # LIB2ADD_ST # LIB2ADDEH +# LIB2ADDEHSTATIC +# LIB2ADDEHSHARED # LIB2ADDEHDEP +# LIBUNWIND +# LIBUNWINDDEP +# SHLIBUNWIND_LINK +# SHLIBUNWIND_INSTALL # FPBIT # FPBIT_FUNCS # LIB2_DIVMOD_FUNCS @@ -117,7 +123,8 @@ done libgcc2_objs="" libgcc2_st_objs="" -libgcc2_eh_objs="" +libgcc2_eh_static_objs="" +libgcc2_eh_shared_objs="" for name in $lib2funcs; do for ml in $MULTILIBS; do @@ -236,13 +243,27 @@ for file in $LIB2ADDEH; do echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep echo " $gcc_compile" $flags -fexceptions -c $file -o $out done - if [ "$SHLIB_LINK" ]; then - libgcc2_eh_objs="$libgcc2_eh_objs ${oname}${objext}" - else + if [ -z "$SHLIB_LINK" ]; then libgcc2_objs="$libgcc2_objs ${oname}${objext}" fi done +if [ "$SHLIB_LINK" ]; then + # Those should be in libgcc_eh.a. + for file in $LIB2ADDEHSTATIC; do + name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'` + oname=`echo $name | sed -e 's,.*/,,'` + libgcc2_eh_static_objs="$libgcc2_eh_static_objs ${oname}${objext}" + done + + # Those should be in libgcc.so. + for file in $LIB2ADDEHSHARED; do + name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'` + oname=`echo $name | sed -e 's,.*/,,'` + libgcc2_eh_shared_objs="$libgcc2_eh_shared_objs ${oname}${objext}" + done +fi + for file in $LIB2ADD_ST; do name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'` oname=`echo $name | sed -e 's,.*/,,'` @@ -261,6 +282,31 @@ for file in $LIB2ADD_ST; do libgcc2_st_objs="$libgcc2_st_objs ${oname}${objext}" done +if [ "$LIBUNWIND" ]; then + libunwind_static_objs="" + libunwind_shared_objs="" + for file in $LIBUNWIND; do + name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'` + oname=`echo $name | sed -e 's,.*/,,'` + + for ml in $MULTILIBS; do + dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` + flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; + out="libgcc/${dir}/${oname}${objext}" + if [ ${name}.asm = ${file} ]; then + flags="$flags -xassembler-with-cpp" + fi + + echo $out: stmp-dirs $file $LIBUNWINDDEP + echo " $gcc_compile" $flags -fexceptions -c $file -o $out + echo ${out}s: stmp-dirs $file $LIBUNWINDDEP + echo " $gcc_compile" $flags -fexceptions -DSHARED -c $file -o ${out}s + done + libunwind_static_objs="$libunwind_static_objs ${oname}${objext}" + libunwind_shared_objs="$libunwind_shared_objs ${oname}${objext}s" + done +fi + # # build libgcov components # @@ -288,17 +334,21 @@ for ml in $MULTILIBS; do flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; libgcc_objs="" - libgcc_eh_objs="" + libgcc_eh_static_objs="" + libgcc_eh_shared_objs="" for o in $libgcc1_objs; do libgcc_objs="$libgcc_objs libgcc/${dir}/$o" done for o in $libgcc2_objs; do libgcc_objs="$libgcc_objs libgcc/${dir}/$o" done - for o in $libgcc2_eh_objs; do - libgcc_eh_objs="$libgcc_eh_objs libgcc/${dir}/$o" + for o in $libgcc2_eh_static_objs; do + libgcc_eh_static_objs="$libgcc_eh_static_objs libgcc/${dir}/$o" done - libgcc_sh_objs="$libgcc_objs $libgcc_eh_objs" + for o in $libgcc2_eh_shared_objs; do + libgcc_eh_shared_objs="$libgcc_eh_shared_objs libgcc/${dir}/$o" + done + libgcc_sh_objs="$libgcc_objs $libgcc_eh_shared_objs" shlib_deps="$libgcc_sh_objs" libgcc_st_objs="" @@ -310,6 +360,18 @@ for ml in $MULTILIBS; do for o in $libgcov_objs; do libgcov_a_objs="$libgcov_a_objs libgcc/${dir}/$o" done + + if [ "$LIBUNWIND" ]; then + libunwind_a_objs="" + for o in $libunwind_static_objs; do + libunwind_a_objs="$libunwind_a_objs libgcc/${dir}/$o" + done + libunwind_sh_objs="" + for o in $libunwind_shared_objs; do + libunwind_sh_objs="$libunwind_sh_objs libgcc/${dir}/$o" + done + shlibunwind_deps="$libunwind_sh_objs" + fi if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then mapfile="libgcc/${dir}/libgcc.map" @@ -375,21 +437,37 @@ EOF echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcov.a $libgcov_a_objs echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcov.a + if [ "$LIBUNWIND" ]; then + echo "" + echo "${dir}/libunwind.a: stmp-dirs $libunwind_a_objs" + echo " -rm -rf ${dir}/libunwind.a" + echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libunwind.a $libunwind_a_objs + echo ' $(RANLIB_FOR_TARGET)' ${dir}/libunwind.a + echo "" + echo "${dir}/libgcc.a: ${dir}/libunwind.a" + fi + if [ "$SHLIB_LINK" ]; then echo "" - echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_objs" + echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_static_objs" echo " -rm -rf ${dir}/libgcc_eh.a" - echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_objs + echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_static_objs echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a if [ -z "$SHLIB_MULTILIB" ]; then if [ "$dir" = . ]; then shlib_base_name=libgcc_s + shlibunwind_base_name=libunwind else shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g` + shlibunwind_base_name=libunwind_`echo $dir | sed s,/,_,g` fi shlib_so_name="$shlib_base_name" + shlibunwind_so_name="$shlibunwind_base_name" + if [ "$LIBUNWIND" ]; then + shlib_deps="$shlib_deps ${dir}/${shlibunwind_base_name}${SHLIB_EXT}" + fi shlib_dir= shlib_slibdir_qual= if [ -n "$MULTILIB_OSDIRNAMES" ]; then @@ -401,11 +479,13 @@ EOF os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"` if [ -z "$os_multilib_base" ]; then shlib_so_name=libgcc_s + shlibunwind_so_name=libunwind if [ "$os_multilib_dir" != "." ]; then shlib_slibdir_qual="/$os_multilib_dir" fi else shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g` + shlibunwind_so_name=libunwind_`echo $gcc_multilib_sup | sed s,/,_,g` shlib_slibdir_qual="/$os_multilib_base" fi fi @@ -421,8 +501,21 @@ EOF -e "s%@shlib_so_name@%$shlib_so_name%g" \ -e "s%@shlib_dir@%$shlib_dir%g" \ -e "s%@shlib_slibdir_qual@%%g" + if [ "$LIBUNWIND" ]; then + echo "" + echo "${dir}/${shlibunwind_base_name}${SHLIB_EXT}: $shlibunwind_deps" + echo " $SHLIBUNWIND_LINK" \ + | sed -e "s%@multilib_flags@%$flags%g" \ + -e "s%@multilib_dir@%$dir%g" \ + -e "s%@shlib_objs@%$libunwind_sh_objs%g" \ + -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \ + -e "s%@shlib_so_name@%$shlibunwind_so_name%g" \ + -e "s%@shlib_dir@%$shlib_dir%g" \ + -e "s%@shlib_slibdir_qual@%%g" + fi elif [ "$SHLIB_MULTILIB" = "$dir" ]; then shlib_base_name="libgcc_s"; + shlibunwind_base_name="libunwind"; echo "" echo "${shlib_base_name}${SHLIB_EXT}: $shlib_deps" echo " $SHLIB_LINK" \ @@ -434,6 +527,18 @@ EOF -e "s%@shlib_so_name@%$shlib_base_name%g" \ -e "s%@shlib_dir@%%g" \ -e "s%@shlib_slibdir_qual@%%g" + if [ "$LIBUNWIND" ]; then + echo "" + echo "${shlibunwind_base_name}${SHLIB_EXT}: $shlibunwind_deps" + echo " $SHLIBUNWIND_LINK" \ + | sed -e "s%@multilib_flags@%$flags%g" \ + -e "s%@multilib_dir@%$dir%g" \ + -e "s%@shlib_objs@%$libgcc_sh_objs%g" \ + -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \ + -e "s%@shlib_so_name@%$shlibunwind_base_name%g" \ + -e "s%@shlib_dir@%%g" \ + -e "s%@shlib_slibdir_qual@%%g" + fi fi fi done @@ -466,6 +571,9 @@ for ml in $MULTILIBS; do dirs="$dirs ${dir} libgcc/${dir}" fi all="$all ${dir}/libgcc.a ${dir}/libgcov.a" + if [ "$LIBUNWIND" ]; then + all="$all ${dir}/libunwind.a" + fi if [ "$SHLIB_LINK" ]; then all="$all ${dir}/libgcc_eh.a" if [ -z "$SHLIB_MULTILIB" ]; then @@ -475,8 +583,14 @@ for ml in $MULTILIBS; do suff=_`echo $dir | sed s,/,_,g` fi all="$all ${dir}/libgcc_s${suff}${SHLIB_EXT}" + if [ "$LIBUNWIND" ]; then + all="$all ${dir}/${dir}/libunwind${suff}${SHLIB_EXT}" + fi elif [ "$SHLIB_MULTILIB" = "$dir" ]; then all="$all libgcc_s${SHLIB_EXT}" + if [ "$LIBUNWIND" ]; then + all="$all ${dir}/${dir}/libunwind${SHLIB_EXT}" + fi fi fi done @@ -536,10 +650,13 @@ for ml in $MULTILIBS; do if [ -z "$SHLIB_MULTILIB" ]; then if [ "$dir" = . ]; then shlib_base_name=libgcc_s + shlibunwind_base_name=libunwind else shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g` + shlibunwind_base_name=libunwind_`echo $dir | sed s,/,_,g` fi shlib_so_name="$shlib_base_name" + shlibunwind_so_name="$shlibunwind_base_name" shlib_dir= shlib_slibdir_qual= if [ -n "$MULTILIB_OSDIRNAMES" ]; then @@ -552,11 +669,13 @@ for ml in $MULTILIBS; do os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"` if [ -z "$os_multilib_base" ]; then shlib_so_name=libgcc_s + shlibunwind_so_name=libunwind if [ "$os_multilib_dir" != "." ]; then shlib_slibdir_qual="/$os_multilib_dir" fi else shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g` + shlibunwind_so_name=libunwind_`echo $gcc_multilib_sup | sed s,/,_,g` shlib_slibdir_qual="/$os_multilib_base" fi fi @@ -565,6 +684,16 @@ for ml in $MULTILIBS; do -e "s%@shlib_so_name@%$shlib_so_name%g" \ -e "s%@shlib_dir@%$shlib_dir%g" \ -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g" + if [ "$LIBUNWIND" ]; then + echo " $SHLIBUNWIND_INSTALL" \ + | sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \ + -e "s%@shlib_so_name@%$shlibunwind_so_name%g" \ + -e "s%@shlib_dir@%$shlib_dir%g" \ + -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g" + libunwinddir='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)' + echo ' $(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/ + echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a + fi elif [ "$SHLIB_MULTILIB" = "$dir" ]; then shlib_base_name="libgcc_s"; echo " $SHLIB_INSTALL" \ @@ -572,6 +701,16 @@ for ml in $MULTILIBS; do -e "s%@shlib_so_name@%$shlib_base_name%g" \ -e "s%@shlib_dir@%%g" \ -e "s%@shlib_slibdir_qual@%%g" + if [ "$LIBUNWIND" ]; then + echo " $SHLIBUNWIND_INSTALL" \ + | sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \ + -e "s%@shlib_so_name@%$shlibunwind_base_name%g" \ + -e "s%@shlib_dir@%%g" \ + -e "s%@shlib_slibdir_qual@%%g" + libunwinddir='$(DESTDIR)$(slibdir)' + echo ' $(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/ + echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a + fi fi fi done diff --git a/gcc/unwind-compat.c b/gcc/unwind-compat.c new file mode 100644 index 00000000000..26f45ac8e57 --- /dev/null +++ b/gcc/unwind-compat.c @@ -0,0 +1,206 @@ +/* Backward compatibility unwind routines. + Copyright (C) 2004 + Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combined + executable.) + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS) +#include "unwind.h" +#include "unwind-dw2-fde.h" +#include "unwind-compat.h" + +extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace + (_Unwind_Trace_Fn, void *); + +_Unwind_Reason_Code +_Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument) +{ + return __libunwind_Unwind_Backtrace (trace, trace_argument); +} +symver (_Unwind_Backtrace, GCC_3.3); + +extern void __libunwind_Unwind_DeleteException + (struct _Unwind_Exception *); + +void +_Unwind_DeleteException (struct _Unwind_Exception *exc) +{ + return __libunwind_Unwind_DeleteException (exc); +} +symver (_Unwind_DeleteException, GCC_3.0); + +extern void * __libunwind_Unwind_FindEnclosingFunction (void *); + +void * +_Unwind_FindEnclosingFunction (void *pc) +{ + return __libunwind_Unwind_FindEnclosingFunction (pc); +} +symver (_Unwind_FindEnclosingFunction, GCC_3.3); + +extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); + +_Unwind_Reason_Code +_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, + _Unwind_Stop_Fn stop, void * stop_argument) +{ + return __libunwind_Unwind_ForcedUnwind (exc, stop, stop_argument); +} +symver (_Unwind_ForcedUnwind, GCC_3.0); + +extern _Unwind_Word __libunwind_Unwind_GetCFA + (struct _Unwind_Context *); + +_Unwind_Word +_Unwind_GetCFA (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetCFA (context); +} +symver (_Unwind_GetCFA, GCC_3.3); + +#ifdef __ia64__ +extern _Unwind_Word __libunwind_Unwind_GetBSP + (struct _Unwind_Context *); + +_Unwind_Word +_Unwind_GetBSP (struct _Unwind_Context * context) +{ + return __libunwind_Unwind_GetBSP (context); +} +symver (_Unwind_GetBSP, GCC_3.3.2); +#else +extern _Unwind_Ptr __libunwind_Unwind_GetDataRelBase + (struct _Unwind_Context *); + +_Unwind_Ptr +_Unwind_GetDataRelBase (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetDataRelBase (context); +} +symver (_Unwind_GetDataRelBase, GCC_3.0); + +extern _Unwind_Ptr __libunwind_Unwind_GetTextRelBase + (struct _Unwind_Context *); + +_Unwind_Ptr +_Unwind_GetTextRelBase (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetTextRelBase (context); +} +symver (_Unwind_GetTextRelBase, GCC_3.0); +#endif + +extern _Unwind_Word __libunwind_Unwind_GetGR + (struct _Unwind_Context *, int ); + +_Unwind_Word +_Unwind_GetGR (struct _Unwind_Context *context, int index) +{ + return __libunwind_Unwind_GetGR (context, index); +} +symver (_Unwind_GetGR, GCC_3.0); + +extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *); + +_Unwind_Ptr +_Unwind_GetIP (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetIP (context); +} +symver (_Unwind_GetIP, GCC_3.0); + +extern void *__libunwind_Unwind_GetLanguageSpecificData + (struct _Unwind_Context *); + +void * +_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetLanguageSpecificData (context); +} +symver (_Unwind_GetLanguageSpecificData, GCC_3.0); + +extern _Unwind_Ptr __libunwind_Unwind_GetRegionStart + (struct _Unwind_Context *); + +_Unwind_Ptr +_Unwind_GetRegionStart (struct _Unwind_Context *context) +{ + return __libunwind_Unwind_GetRegionStart (context); +} +symver (_Unwind_GetRegionStart, GCC_3.0); + +extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException + (struct _Unwind_Exception *); + +_Unwind_Reason_Code +_Unwind_RaiseException(struct _Unwind_Exception *exc) +{ + return __libunwind_Unwind_RaiseException (exc); +} +symver (_Unwind_RaiseException, GCC_3.0); + +extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *); + +void +_Unwind_Resume (struct _Unwind_Exception *exc) +{ + __libunwind_Unwind_Resume (exc); +} +symver (_Unwind_Resume, GCC_3.0); + +extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow + (struct _Unwind_Exception *); + +_Unwind_Reason_Code +_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc) +{ + return __libunwind_Unwind_Resume_or_Rethrow (exc); +} +symver (_Unwind_Resume_or_Rethrow, GCC_3.3); + +extern void __libunwind_Unwind_SetGR + (struct _Unwind_Context *, int, _Unwind_Word); + +void +_Unwind_SetGR (struct _Unwind_Context *context, int index, + _Unwind_Word val) +{ + __libunwind_Unwind_SetGR (context, index, val); +} +symver (_Unwind_SetGR, GCC_3.0); + +extern void __libunwind_Unwind_SetIP + (struct _Unwind_Context *, _Unwind_Ptr); + +void +_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val) +{ + return __libunwind_Unwind_SetIP (context, val); +} +symver (_Unwind_SetIP, GCC_3.0); +#endif diff --git a/gcc/unwind-compat.h b/gcc/unwind-compat.h new file mode 100644 index 00000000000..051cea1d05d --- /dev/null +++ b/gcc/unwind-compat.h @@ -0,0 +1,35 @@ +/* Backward compatibility unwind routines. + Copyright (C) 2004 + Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combined + executable.) + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#define symver(name, version) \ + __asm__ (".symver " #name"," #name "@" #version) + +#define alias(name) \ + __typeof(name) __libunwind##name __attribute__ ((alias (#name))) diff --git a/gcc/unwind-dw2-fde-compat.c b/gcc/unwind-dw2-fde-compat.c new file mode 100644 index 00000000000..5e8c0a30c65 --- /dev/null +++ b/gcc/unwind-dw2-fde-compat.c @@ -0,0 +1,46 @@ +/* Backward compatibility unwind routines. + Copyright (C) 2004 + Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combined + executable.) + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS) +#include "unwind.h" +#include "unwind-dw2-fde.h" +#include "unwind-compat.h" + +extern const fde * __libunwind__Unwind_Find_FDE + (void *, struct dwarf_eh_bases *); + +const fde * +_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) +{ + __libunwind__Unwind_Find_FDE (pc, bases); +} + +symver (_Unwind_Find_FDE, GCC_3.0); +#endif diff --git a/gcc/unwind-dw2-fde-glibc.c b/gcc/unwind-dw2-fde-glibc.c index 1d2930df668..96d7946291a 100644 --- a/gcc/unwind-dw2-fde-glibc.c +++ b/gcc/unwind-dw2-fde-glibc.c @@ -46,6 +46,7 @@ #define NO_BASE_OF_ENCODED_VALUE #include "unwind-pe.h" #include "unwind-dw2-fde.h" +#include "unwind-compat.h" #include "gthr.h" #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ @@ -306,3 +307,7 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) #define _Unwind_Find_FDE _Unwind_Find_FDE #include "unwind-dw2-fde.c" #endif + +#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS) +alias (_Unwind_Find_FDE); +#endif diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c index 3815d9f3f95..db8f3f5e20a 100644 --- a/gcc/unwind-dw2.c +++ b/gcc/unwind-dw2.c @@ -1317,4 +1317,24 @@ uw_identify_context (struct _Unwind_Context *context) #include "unwind.inc" +#if defined (USE_GAS_SYMVER) && defined (SHARED) && defined (USE_LIBUNWIND_EXCEPTIONS) +alias (_Unwind_Backtrace); +alias (_Unwind_DeleteException); +alias (_Unwind_FindEnclosingFunction); +alias (_Unwind_FindTableEntry); +alias (_Unwind_ForcedUnwind); +alias (_Unwind_GetDataRelBase); +alias (_Unwind_GetTextRelBase); +alias (_Unwind_GetCFA); +alias (_Unwind_GetGR); +alias (_Unwind_GetIP); +alias (_Unwind_GetLanguageSpecificData); +alias (_Unwind_GetRegionStart); +alias (_Unwind_RaiseException); +alias (_Unwind_Resume); +alias (_Unwind_Resume_or_Rethrow); +alias (_Unwind_SetGR); +alias (_Unwind_SetIP); +#endif + #endif /* !USING_SJLJ_EXCEPTIONS */ -- 2.30.2