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]

egcs (1.1.1) for BSD/OS 4.0



  Hi.  I've put together a few patches for getting egcs (originally
the 1.1.1 release) working properly on BSD/OS 4.0 systems (both x86
and sparc).

  Most of the stuff I have will be normal; patches to configure,
configure.in, config.guess, ltconfig, etc.  And, the addition of one
files in each gcc/config/arch dir...

  The one additional change I needed to get it to link against
dynamically shared libraries was that I needed to change the way
collect2 invoked ld.  On this system at least, the ld (which is a
modified GNU ld 2.8.1) behaves differently if you invoke it as
"/usr/bin/ld" instead of "ld".  I think it assumes it's a
cross-compiler when invoked with a full path, and the method it uses
to look for libraries changes.  The first place it looks after
finishing the -L args is in "/usr/bin/../lib/", instead of when
invoked as "ld" it looks in "/shlib/".  Looking this way causes it to
find the /usr/lib/libXX.a libs in preference to the (desired) shared
libraries in /shlib/libXX.so.

  The patch I made to avoid this was:

--- collect2.c  1998/12/21 20:18:29     1.1.1.1
+++ collect2.c  1999/01/01 00:08:42     1.2
@@ -1057,7 +1057,15 @@
 
   /* Maybe we know the right file to use (if not cross).  */
 #ifdef REAL_LD_FILE_NAME
+#ifdef UNQUALIFIED_LD_FILE_NAME
+  /* This hack allows us to run the linker as "ld" instead of the full */
+  /* path of ld on this system (eg. "/usr/bin/ld").  Some ld's behave  */
+  /* differently if invoked with a full path, presuming they need to   */
+  /* behave like a cross-linker... */
+  ld_file_name = strdup (REAL_LD_FILE_NAME);
+#else
   ld_file_name = find_a_file (&path, REAL_LD_FILE_NAME);
+#endif
   if (ld_file_name == 0)
 #endif
   /* Search the (target-specific) compiler dirs for ld'.  */


  And then set UNQUALIFIED_LD_FILE_NAME in the relevant
gcc/config/arch/os.h files (in addition to setting REAL_LD_FILE_NAME
to "ld").

  I would be happy to hear alternative suggestions to this approach if
you are not fond of it.  Once I iron out this issue, I can bundle
patches against something more current (like egcs_ss_19990228) and
ship it to you guys.

  Let me know what you think about this issue.  Thanks...

                        - Chris

--
Chris P. Ross				UUNET Technologies, Inc.
cross@eng.us.uu.net			R & D / Engineering
cross@uu.net


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