ar script and bison errors

Peter Naulls peter at chocky.org
Sun Feb 24 07:50:09 PST 2002


In message <m3zo1zqhri.fsf at nick.ws.noc.dsvr.net>
          Nick Burrett <nick at dsvr.net> wrote:

> Theo Markettos <atm26 at cam.ac.uk> writes:
> 
> > I've attached the above in case it's of use to anyone, or someone has
> > something better.
> 
> A long long time ago I wrote a patch for Libfile to have an `Ar' class
> that emulated the command line options of `ar'.  I did this so that we
> could build a RISC OS GCC direct from an official GCC build environment.

By the same token, it would be nice if Drlink could understand the Unix
archive format.

Additionally, I'd like to resuggest a patch of Alex's from sometime ago
below.  I've been using this for quite some time, and I think the
hassles of not having it are far more than any perceieved confusion
about filetype naming.

Peter


---------------

Hi

Below is a patch for LD so that it searches for lib<name>.a before it
looks for lib<name>.o, if -l<name> is specified.

Index: riscos-aof/ld/ld.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/ld/ld.c,v
retrieving revision 1.7
diff -u -r1.7 ld.c
--- riscos-aof/ld/ld.c	2001/05/07 11:15:56	1.7
+++ riscos-aof/ld/ld.c	2001/08/13 16:50:27
@@ -1596,6 +1596,23 @@
 #ifdef CROSS_COMPILE
       strcat (file_name, "lib");
       strcat (file_name, library);
+      strcat (file_name, ".a");
+#else
+      strcat (file_name, "a.lib");
+      strcat (file_name, library);
+#endif
+      if (check_and_add_library (file_name) == 1)
+	return;
+
+      /* Couldn't find lib<name>.a so try lib<name>.o */
+      strcpy (file_name, list->name);
+      if (list->name[i] != ':' && list->name[i] != '.'
+          && list->name[i] != '/')
+        strcat (file_name, "/");
+
+#ifdef CROSS_COMPILE
+      strcat (file_name, "lib");
+      strcat (file_name, library);
       strcat (file_name, ".o");
 #else
       strcat (file_name, "o.lib");





-- 
------------------------------------------------------------------------
 Peter Naulls - peter at chocky.org
 RISC OS Projects Initiative  -  http://www.chocky.org/initiative/
 Java for RISC OS and ARM     -  http://www.chocky.org/java/
 Debian Linux on RiscPCs      -  http://www.chocky.org/debian/
------------------------------------------------------------------------



More information about the gcc mailing list