This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11979] New: ar creates invalid library file from empty object


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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]