bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/521] New: GNU ar on Solaris creates invalid archives in so


From: bruno at clisp dot org
Subject: [Bug binutils/521] New: GNU ar on Solaris creates invalid archives in some cases
Date: 6 Nov 2004 15:45:16 -0000

This is hurting the gnulib project: GNU ar version 2.15, used on Solaris 7 or 
Solaris 9, creates invalid .a files if there are no exported symbols. 
 
Test case: 
 
$ cat > hello.c 
#include <stdio.h> 
int main () { printf("Hello World\n"); return 0; } 
$ gcc -c hello.c 
 
$ gnu-ar --version 
GNU ar 2.15 
Copyright 2004 Free Software Foundation, Inc. 
This program is free software; you may redistribute it under the terms of 
the GNU General Public License.  This program has absolutely no warranty. 
 
$ cat > dummy.c 
typedef int dummy; 
$ gcc -c dummy.c 
$ /bin/rm -f empty.a 
$ gnu-ar cru empty.a dummy.o 
$ /usr/ccs/bin/ld hello.o empty.a -lc -o a.out 
ld: fatal: file empty.a: unknown type, unable to process using elf(3E) 
libraries 
ld: fatal: File processing errors. No output written to a.out 
$ echo $? 
1 
 
Test case that shows that there is no problem if the system's 'ar' is used: 
 
$ cat > dummy.c 
typedef int dummy; 
$ gcc -c dummy.c 
$ /bin/rm -f empty.a 
$ /usr/ccs/bin/ar cru empty.a dummy.o 
$ /usr/ccs/bin/ld hello.o empty.a -lc -o a.out 
$ echo $? 
0 
 
Test case that shows that there is no problem if there are exported symbols: 
 
$ cat > dummy.c 
int dummy; 
$ gcc -c dummy.c 
$ /bin/rm -f empty.a 
$ gnu-ar cru empty.a dummy.o 
$ /usr/ccs/bin/ld hello.o empty.a -lc -o a.out 
$ echo $? 
0

-- 
           Summary: GNU ar on Solaris creates invalid archives in some cases
           Product: binutils
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: bruno at clisp dot org
                CC: bug-binutils at gnu dot org
 GCC build triplet: sparc-sun-solaris2.7
  GCC host triplet: sparc-sun-solaris2.7
GCC target triplet: sparc-sun-solaris2.7


http://sources.redhat.com/bugzilla/show_bug.cgi?id=521

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

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