This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11979] New: ar creates invalid library file from empty object
- From: "rickf at ebenchmarks dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2003 16:02:51 -0000
- Subject: [Bug c/11979] New: ar creates invalid library file from empty object
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11979
Summary: ar creates invalid library file from empty object
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rickf at ebenchmarks dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: sparc-sun-solaris2.8
Compiler binary from sunfreeware.com.
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>