This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix for libunwind link errors
- From: Jim Wilson <wilson at specifixinc dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 30 Nov 2003 00:26:14 -0800
- Subject: fix for libunwind link errors
This fixes a problem building gnatlib_and_tools on my ia64-linux system with
libunwind installed. Without this patch, I get errors when linking gnatmake
because the libunwind library routines can't be found.
The problem here is that we are adding -lunwind when libgcc_s is used. We
should instead be adding it when libgcc_eh is used. There is no longer any
need to specify it with libgcc_s because we add it when creating libgcc_s.so,
and thus it is brought in via DT_NEEDED.
This was tested with a make bootstrap and make check on an ia64-linux debian
testing (sarge) system. There were no regressions.
2003-11-29 James E Wilson <wilson@specifixinc.com>
* gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name
instead of in shared_name.
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.395
diff -p -r1.395 gcc.c
*** gcc.c 23 Oct 2003 19:27:41 -0000 1.395
--- gcc.c 29 Nov 2003 21:23:30 -0000
*************** init_spec (void)
*** 1633,1644 ****
#else
"-lgcc_s%M"
#endif
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
! ,
! "-lgcc",
! "-lgcc_eh");
p += 5;
in_sep = 0;
}
--- 1633,1646 ----
#else
"-lgcc_s%M"
#endif
+ ,
+ "-lgcc",
+ "-lgcc_eh"
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
! );
!
p += 5;
in_sep = 0;
}
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com