public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Shared library runpath trouble in Solaris.
@ 1997-11-10  6:04 Teemu Torma
  1997-11-10  8:42 ` Ian Lance Taylor
  0 siblings, 1 reply; 15+ messages in thread
From: Teemu Torma @ 1997-11-10  6:04 UTC (permalink / raw)
  To: egcs

It seems that gcc does not specify any runpath for shared libraries.
At least if using multilibs the whole thing does not work, and
if `prefix' is not a standard one (I am using /usr/gnu), shared
libraries are not found at all.

I have made following changes to allow gcc automatically set -R
to all directories it adds itself.

Or am I missing something completely?

Teemu

1997-11-06  Teemu Torma  <tot@trema.com>

	* config/sparc/sol2.h: Define ADDITIONAL_LINKDIR_OPTION "-R".

	* gcc.c (do_spec_1): If ADDITIONAL_LINKDIR_OPTION is defined,
	add that option for each absolute link directories.

Index: gcc.c
===================================================================
RCS file: /trema/cvs/gnu/egcs/gcc/gcc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -u -p -r1.1.1.1 -r1.2
--- gcc.c	1997/09/26 09:56:58	1.1.1.1
+++ gcc.c	1997/11/06 11:51:51	1.2
@@ -3226,6 +3226,19 @@ do_spec_1 (spec, inswitch, soft_matched_
 			      do_spec_1 (multilib_dir, 1, NULL_PTR);
 			      /* Make this a separate argument.  */
 			      do_spec_1 (" ", 0, NULL_PTR);
+
+#ifdef ADDITIONAL_LINKDIR_OPTION
+			      if (pl->prefix[0] == '/'
+				  || pl->prefix[0] == DIR_SEPARATOR)
+				{
+				  do_spec_1 (ADDITIONAL_LINKDIR_OPTION,
+					     0, NULL_PTR);
+				  do_spec_1 (buffer, 1, NULL_PTR);
+				  do_spec_1 (multilib_dir, 1, NULL_PTR);
+				  /* Make this a separate argument.  */
+				  do_spec_1 (" ", 0, NULL_PTR);
+				}			      
+#endif
 			    }
 			}
 		      if (!pl->require_machine_suffix)
@@ -3240,6 +3253,19 @@ do_spec_1 (spec, inswitch, soft_matched_
 			      do_spec_1 (multilib_dir, 1, NULL_PTR);
 			      /* Make this a separate argument.  */
 			      do_spec_1 (" ", 0, NULL_PTR);
+
+#ifdef ADDITIONAL_LINKDIR_OPTION
+			      if (pl->prefix[0] == '/'
+				  || pl->prefix[0] == DIR_SEPARATOR)
+				{
+				  do_spec_1 (ADDITIONAL_LINKDIR_OPTION,
+					     0, NULL_PTR);
+				  do_spec_1 (pl->prefix, 1, NULL_PTR);
+				  do_spec_1 (multilib_dir, 1, NULL_PTR);
+				  /* Make this a separate argument.  */
+				  do_spec_1 (" ", 0, NULL_PTR);
+				}
+#endif
 			    }
 			}
 		    }
@@ -3264,6 +3290,19 @@ do_spec_1 (spec, inswitch, soft_matched_
 			  do_spec_1 (buffer, 1, NULL_PTR);
 			  /* Make this a separate argument.  */
 			  do_spec_1 (" ", 0, NULL_PTR);
+
+#ifdef ADDITIONAL_LINKDIR_OPTION
+			  if (pl->prefix[0] == '/'
+			      || pl->prefix[0] == DIR_SEPARATOR)
+			    {
+			      do_spec_1 (ADDITIONAL_LINKDIR_OPTION,
+					 0, NULL_PTR);
+			      do_spec_1 (pl->prefix, 1, NULL_PTR);
+			      do_spec_1 (buffer, 1, NULL_PTR);
+			      /* Make this a separate argument.  */
+			      do_spec_1 (" ", 0, NULL_PTR);
+			    }
+#endif
 			}
 		    }
 		  if (!pl->require_machine_suffix)
@@ -3286,6 +3325,18 @@ do_spec_1 (spec, inswitch, soft_matched_
 			  do_spec_1 (buffer, 1, NULL_PTR);
 			  /* Make this a separate argument.  */
 			  do_spec_1 (" ", 0, NULL_PTR);
+
+#ifdef ADDITIONAL_LINKDIR_OPTION
+			  if (pl->prefix[0] == '/'
+			      || pl->prefix[0] == DIR_SEPARATOR)
+			    {
+			      do_spec_1 (ADDITIONAL_LINKDIR_OPTION,
+					 0, NULL_PTR);
+			      do_spec_1 (buffer, 1, NULL_PTR);
+			      /* Make this a separate argument.  */
+			      do_spec_1 (" ", 0, NULL_PTR);
+			    }
+#endif
 			}
 		    }
 		}
Index: config/sparc/sol2.h
===================================================================
RCS file: /trema/cvs/gnu/egcs/gcc/config/sparc/sol2.h,v
retrieving revision 1.1.1.2
retrieving revision 1.6
diff -u -u -p -r1.1.1.2 -r1.6
--- sol2.h	1997/10/24 09:12:33	1.1.1.2
+++ sol2.h	1997/11/10 12:11:04	1.6
@@ -157,6 +164,10 @@ Boston, MA 02111-1307, USA.  */
        %{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
        %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}} \
    %{Qy:} %{!Qn:-Qy}"
+
+/* Add -R for each automatically included -L. */
+#undef ADDITIONAL_LINKDIR_OPTION
+#define ADDITIONAL_LINKDIR_OPTION "-R"
 
 /* This defines which switch letters take arguments.
    It is as in svr4.h but with -R added.  */

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~1997-11-12  4:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-10  6:04 Shared library runpath trouble in Solaris Teemu Torma
1997-11-10  8:42 ` Ian Lance Taylor
1997-11-10  9:08   ` Teemu Torma
1997-11-10  9:08     ` Ian Lance Taylor
1997-11-10 13:47       ` Alexandre Oliva
1997-11-10 13:47         ` Ian Lance Taylor
1997-11-10 18:41           ` Alexandre Oliva
1997-11-10 19:19             ` Ian Lance Taylor
1997-11-10 19:57               ` Alexandre Oliva
1997-11-11  9:10                 ` Ian Lance Taylor
1997-11-11 12:28                   ` Alexandre Oliva
1997-11-11 22:42                     ` Alexandre Oliva
1997-11-12  4:01                   ` Teemu Torma
1997-11-11  2:26             ` Swen Thuemmler
1997-11-10 10:17   ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).