This is the mail archive of the 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]

[committed] Fix IRIX fallout from Solaris mklibgcc changes

[ cc'ing folks involved in the original mklibgcc threads, and David B.,
  who provides regular IRIX results. ]

As reported a few weeks ago, the Solaris mklibgcc changes broke
execution testing for the non-default IRIX multilibs.  The full
horror can be seen from results like:

Discussion of the problem was here:

but the thread went cold without the supporters of the Solaris
changes suggesting how this should be fixed in general (i.e.,
without invalidating the original objective of the changes).

Given the effect that these changes had -- and the fact that they
were made in stage 3 -- I suppose one alternative would be to revert
the patches and go back to the old scheme.  There was at least one
message from David Edelsohn in support of the original set-up:

but I don't know if that's still his position.

Assuming that going back to the old scheme isn't an option, the patch
below at least gets IRIX back to normal.  I'm happy to revert it and
do something else if there's concensus on what the something should be.

To recap, the build directory (gcc/) used to be laid out like this:               (soname
    mabi-32/       (soname
    mabi-64/       (soname -> -> mabi-32/ -> mabi-64/

where mabi-32 and mabi-64 are the MULTILIB_DIRNAMES directories
for -mabi=32 and -mabi=64 respectively.  gcc would link against the
multilib-encoded *.so files and the testsuite would add the appropriate
MULTILIB_DIRNAMES directory[*] to LD_LIBRARY_PATH and friends.  Each test
thus found the right version of at runtime.

  [*] as opposed to the MULTILIB_OSDIRNAMES directory used by
      the installed tree

For reference, the install directory looked like this:               (soname
    mabi=32/       (soname
    mabi=64/       (soname ->
    mabi=32/ ->
    mabi=64/ ->

where mabi=32 and mabi=64 are the MULTILIB_OSDIRNAMES directories
for -mabi=32 and -mabi=64.  This hasn't changed, and the installed
tree still works.

Anyway, the recent mklibgcc patches made the build directory use a
flat layout in which both the DSO and symlink have multilib-encoded
names:               (soname       (soname       (soname -> -> ->

It's therefore not possible to run shared-libgcc o32 and n64 executables
from the build tree because the dynamic loader will try to use the n32
version of

It's easy to revert SHLIB_LINK to the old behaviour by changing:

    SHLIB_NAME = @multilib_dir@/$(SHLIB_SOVERSION)

in t-slibgcc-irix.  However, @multilib_dir@ isn't available to
SHLIB_INSTALL, and since this patch was always going to be a
band-aid, I wanted something that would only affect IRIX,

The patch below therefore keeps the original SHLIB_NAME but gets
SHLIB_LINK to "install" a copy of it as @multilib_dir@/$(SHLIB_SONAME)
(still talking about the bulid tree here).  This copy will then get
used when running the testsuite.

Tested on mips-sgi-irix6.5, applied to head.  I realise that the patch
is a kludge, but it was very difficult to test IRIX stuff with things
as they stood, and I wanted to fix that ASAP.  Like I say, I'm happy
to revisit this if there's consensus on what the Right Way is.


	* config/mips/t-slibgcc-irix (SHLIB_LINK): Install a copy of the
	library as @multilib_dir@/$(SHLIB_SONAME).

Index: config/mips/t-slibgcc-irix
RCS file: /cvs/gcc/gcc/gcc/config/mips/t-slibgcc-irix,v
retrieving revision 1.4
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.4 t-slibgcc-irix
--- config/mips/t-slibgcc-irix	16 Dec 2004 19:14:28 -0000	1.4
+++ config/mips/t-slibgcc-irix	8 Jan 2005 10:43:34 -0000
@@ -18,7 +18,9 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2
 	  mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
 	else true; fi && \
 	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+	{ test "@multilib_dir@" = "." || \
+	  $(INSTALL_DATA) $(SHLIB_NAME) @multilib_dir@/$(SHLIB_SONAME); }
 # $(slibdir) double quoted to protect it from expansion while building
 #  We want this delayed until actual install time.

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