This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] PR40134, use a linker script on arm-linux to link with -lgcc_s -lgcc


On 09.09.2009 13:24, Jakub Jelinek wrote:
On Mon, Jul 13, 2009 at 09:12:27AM -0400, Matthias Klose wrote:
this doesn't seem to work together with -nostdlib, e.g. how libstdc++ is linked
(libstdc++ ends up with undefined symbols from libgcc). Current libtool has it's
own idea about linking with libgcc, and doesn't link with -lgcc (explicitely
removing it from the command line if it's there). So do we have to change
libtool at the same time to support linking with both libgcc_s and libgcc?

After discussing this with Alex on IRC today, we agreed that the linker script for targets that need it is probably easier.

But, completely duplicating the SHLIB_LINK/SHLIB_INSTALL variables,
especially without all the variables that can tweak it, is IMHO a wrong
idea.  We should avoid the duplication.

The following patch has been tested on powerpc64-linux --with-cpu=default32
together with a
--- rs6000.c.jj	2009-09-04 16:42:37.465404822 +0200
+++ rs6000.c	2009-09-09 12:15:01.502404904 +0200
@@ -18011,7 +18011,7 @@ static bool
  no_global_regs_above (int first, bool gpr)
  {
    int i;
-  for (i = first; i<  gpr ? 32 : 64 ; i++)
+  for (i = first; i<  (gpr ? 32 : 64) ; i++)
      if (global_regs[i])
        return false;
    return true;
fix (I know Nathan has a more complete patch).  arm*-*-linux* could add the
same into config.gcc, similarly sh*-*-linux* (you said sh uses it already,
but I couldn't find anything like that in config/sh/t-*).

If this patch is committed, I hope Nathan could commit his rs6000 fix as
well (would it be acceptable to 4.4 as well)?

2009-09-09 Jakub Jelinek<jakub@redhat.com>

	* config/t-slibgcc-elf-ver (SHLIB_MAKE_SOLINK, SHLIB_INSTALL_SOLINK):
	New variables.
	(SHLIB_LINK, SHLIB_INSTALL): Use them.
	* config/t-slibgcc-libgcc: New file.
	* config.gcc (powerpc*-*-linux*, powerpc*-*-gnu*): Use it.

Applied and checked the attach patch on top of your patch, ran the testsuite without regressions (applied the patch for pr40133 from Paolo for the same test run as well).


Matthias

Attachment: arm.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]