[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] Re: bug in dummy.c
From: |
Simon Josefsson |
Subject: |
[Bug-gnulib] Re: bug in dummy.c |
Date: |
Fri, 05 Nov 2004 14:32:42 +0100 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Simon Josefsson wrote:
>> It seems dummy.c doesn't work. On Solaris 2.9 with GCC 3.3.2 and the
>> /usr/ccs/bin/ld from
>>
>> ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.373
>>
>> I get this error:
>>
>> ld: fatal: file ../gl/.libs/libgl.a: unknown file type
>> ld: fatal: File processing errors. No output written to
>> .libs/libgsasl.so.7.0.0
>
> How did you create this libgl.a?
With the gnulib-tool --import generated Makefile, which uses libtool.
> On a Solaris 2.9 machine with GCC 3.3.1 I get this:
>
> $ cat > dummy.c
> typedef int dummy;
> $ gcc -c dummy.c
> $ ar cru empty.a dummy.o
> $ nm empty.a
>
>
> empty.a[dummy.o]:
>
> [Index] Value Size Type Bind Other Shndx Name
>
> [2] | 0| 0|SECT |LOCL |0 |2 |
> [1] | 0| 0|FILE |LOCL |0 |ABS |dummy.c
> $ cat > hello.c
> #include <stdio.h>
> int main () { printf("Halloechen Welt\n"); return 0; }
> $ gcc hello.c empty.a
> $ gcc -c hello.c
> $ ld hello.o empty.a -lc -o a.out
> $ which ld
> /usr/ccs/bin/ld
>
> What is it that makes it fail in your situation?
I tracked it down, and when I follow your procedure, but use GNU ar,
it fails:
address@hidden:~$ ar cru empty.a dummy.o
address@hidden:~$ gcc hello.c empty.a
ld: fatal: file empty.a: unknown file type
ld: fatal: File processing errors. No output written to a.out
collect2: ld returned 1 exit status
address@hidden:~$ /usr/local/bin/ar --version
GNU ar 2.12.1
I'm now using /usr/ccs/bin/ar instead, and it works.
Perhaps it is libtool that should check for this broken GNU ar? Right
now configure just print:
checking for ar... ar
It could locate and find /usr/ccs/bin/ar instead, which it already
does for 'ld'.
On the other hand, /usr/ccs/bin/ar might have other bugs...
Thanks.