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]

Re: gcc and g++ compilation option to add -rpath (not in FAQ)


On Mar 21, 1999, Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> wrote:

> On 19 Mar 1999, Alexandre Oliva wrote:
>> You can modify the specs file (installed in gcc-lib/*/*) so as to add
>> whatever options you want to the link command.  You may do that in the
>> *link or *lib spec, for example.  IMO, this tip should be added to the
>> FAQ.

> Would you mind adding it? ;-)  (Consider it approved, just send the patch
> to egcs-patches after installation.)

Ok, I'm installing the attached patch, after updating the `Last
modified' date.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Brasil
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,egcs.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists
Index: faq.html
===================================================================
RCS file: /egcs/carton/cvsfiles/wwwdocs/htdocs/faq.html,v
retrieving revision 1.115
diff -u -r1.115 faq.html
--- faq.html	1999/03/21 09:46:00	1.115
+++ faq.html	1999/03/24 08:24:15
@@ -375,6 +375,26 @@
 this was a bad idea, and so it was removed for Solaris.  We should
 not recreate it.
 
+<p>However, if you feel you really need such an option to be passed
+automatically to the linker, you may add it to the gcc specs file.
+This file can be found in the same directory that contains cc1 (run
+<code>gcc -print-prog-name=cc1</code> to find it).  You may add linker
+flags such as <code>-R</code> or <code>-rpath</code>, depending on
+platform and linker, to the <code>*link</code> or <code>*lib</code>
+specs.
+
+<p>Another alterative is to install a wrapper script around gcc, g++
+or ld that adds the appropriate directory to the environment variable
+<code>LD_RUN_PATH</code> or equivalent (again, it's
+platform-dependent).
+
+<p>Yet another option, that works on a few platforms, is to hard-code
+the full pathname of the library into its soname.  This can only be
+accomplished by modifying the appropriate <tt>.ml</tt> file within
+<tt>libstdc++/config</tt> (and also <tt>libg++/config</tt>, if you are
+building libg++), so that <code>$(libdir)/</code> appears just before
+the library name in <code>-soname</code> or <code>-h</code> options.
+
 <hr>
 <h2><a name="gas">GCC can not find GNU as/GNU ld</a></h2>
 <p>To ensure that EGCS finds the GNU assembler (the GNU loader), which

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