ar script and bison errors

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

In message <m3zo1zqhri.fsf at>
          Nick Burrett <nick at> wrote:

> Theo Markettos <atm26 at> 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.




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 @@
       strcat (file_name, "lib");
       strcat (file_name, library);
+      strcat (file_name, ".a");
+      strcat (file_name, "a.lib");
+      strcat (file_name, library);
+      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, "/");
+      strcat (file_name, "lib");
+      strcat (file_name, library);
       strcat (file_name, ".o");
       strcat (file_name, "o.lib");

 Peter Naulls - peter at
 RISC OS Projects Initiative  -
 Java for RISC OS and ARM     -
 Debian Linux on RiscPCs      -

More information about the gcc mailing list