Bug 16770

Summary: Can't build a.out binaries
Product: Base System Reporter: trost <trost>
Component: i386Assignee: David E. O'Brien <obrien>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description trost 2000-02-17 04:00:01 UTC
	If you specify "-aout" on the cc command line, you get the
	error message "ld: crt0.o: No such file or directory" (or
	c++rt0.o if -shared is specified).

Fix: 

Got me -- I don't understand the a.out magic well enough to
	start diagnosing it.  If I remove crt.o from the ld command line,
	ld then complains about libgcc.a having bad magic -- presumably
	it is using the wrong library.
How-To-Repeat: 
	$ echo 'main() {print("Oh, Hell World.\n");}' > foo.c
	$ cc -aout foo.c
Comment 1 David E. O'Brien freebsd_committer freebsd_triage 2000-07-29 02:32:17 UTC
State Changed
From-To: open->closed

You aren't quite understanding the binary creation process.  ``cc -aout'' 
works in that it generates an a.out object module.  In order to create an 
a.out binary (as with an ELF binary), you need to have the crtX.o and libc, 
etc. as a.out versions also.  A.out versions of CSU and standard libraries 
do not come with FreBSD by default.  You need to build an a.out crt0.o using 
``cc -aout'' first along with any libraries you will need. 


Comment 2 David E. O'Brien freebsd_committer freebsd_triage 2000-07-29 02:32:17 UTC
Responsible Changed
From-To: freebsd-bugs->obrien

I'm mr. toolchain.