bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ar creates invalid library file from empty object


From: Rick Foos
Subject: Re: ar creates invalid library file from empty object
Date: Sat, 23 Aug 2003 11:22:15 -0500

Hello All,

I originally reported a bug in ar with 2.11.2 Solaris version from
Sunfreeware. I'm trying to manage the gnu part of Solaris with pkg-get and
Sunfreeware.

It makes it easier personally, but more importantly, when I get a call about
my software, I'd like to deal with gnu packages on Solaris by recommending
the current update of pkg-get.

Could you update the Sunfreeware version to a more current binutils, per the
recommendation below?

I recently updated with pkg-get, and the 2.11.2 version had a regression in
ar. I'm assuming it's fixed in 2.14, but either way if the problem remains
it can be reported as a bug.

I've long since worked around this, and know how to roll back versions, or
use Sun utilities etc. I'm just trying to make it easier for us users to
report relevant problems when they occurr. This has been rather complicated.

Thank you,
Rick Foos

PS: Redhat 9 chanell is at binutils-2.13.90.0.18-9. It doesn't have the ar
problem, but since I see a lot of Linux in your email addresses, they could
use an update to 2.14 as well.

----- Original Message ----- 
From: Alan Modra
To: Rick Foos
Cc: address@hidden
Sent: Saturday, August 23, 2003 4:31 AM
Subject: Re: ar creates invalid library file from empty object


On Tue, Aug 19, 2003 at 02:34:33PM -0500, Rick Foos wrote:
> binutils 2.11.2, from sunfreeware.com Solaris 8.

Try a more recent version.  2.11.x is rather old.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

------------ Original Report
binutils 2.11.2, from sunfreeware.com Solaris 8.

This is a regression from previous versions. Simplified example to
illustrate
only the bug.

When ar builds a library from an empty object file (valid object, no code),
the
resulting link reports:
ld: fatal: file empty.a: unknown file type

--- commands to reproduce.
rick~ %gcc -c hello.c
rick~ %gcc -c empty.c
rick~ %which ar
/usr/local/bin/ar
rick~ %ar scr empty.a empty.o
rick~ %gcc -oempty hello.o empty.a
ld: fatal: file empty.a: unknown file type
ld: fatal: File processing errors. No output written to empty
collect2: ld returned 1 exit status

--- hello.c
#include <stdio.h>

int main(void)
{
printf("Hello\n");
return 0;
}

--- empty.c
#include <stdio.h>
Other version of ar on solaris work. Previous versions of binutils have
worked as well.

rick~ %/usr/ccs/bin/ar scr empty.a empty.o
rick~ %gcc -ohello hello.o empty.a
rick~ %/usr/xpg4/bin/ar scr empty.a empty.o
rick~ %gcc -ohello hello.o empty.a
rick~ %/usr/local/bin/ar scr empty.a empty.o
rick~ %gcc -ohello hello.o empty.a
ld: fatal: file empty.a: unknown file type
ld: fatal: File processing errors. No output written to hello
collect2: ld returned 1 exit status
rick~ %





reply via email to

[Prev in Thread] Current Thread [Next in Thread]