freebsd-skq/gnu/usr.bin
Peter Wemm 9cb13c2344 First round of changes to support generation of assembler for the old
a.out gas and the binutils gas (elf or a.out) with a single compiler.

This uses other infrastructure not yet committed, in order to support
both a.out and elf it needs to be able to get to both a.out and elf
gas, ld, libs, crt* etc.  So for now, the support is pretty much dormant.

The new freebsd.h file is based on the old freebsd-elf.h file (which has a
long lineage, right back through linux and svr4 files).  The change is
pretty dramatic from a gcc internals standpoint as it overrides a lot of
definitions in order to generate different output based on target mode.
There is potential for screw-ups, so please be on the lookout - gcc's
configuration mechanism wasn't really meant for this kind of thing.
It's believed to compile world etc just fine under both a.out and elf, can
handle global constructors and destructors, handles the differences in
a.out and elf stabs, and what sections things like exceptions go in.

The initial idea came from i386/osfrose.h which is a dual rose/elf format
target.  These two are not as diverse as a.out and elf it would seem.

The cc front-end uses external configuration to determine default object
format (still being thrashed out, so read the source if you want to see
it so far), and has a '-aout' and '-elf' override command line switch.
There are some other internal switches that can be accessed, namely -maout,
-mno-aout, -munderscores and -mnounderscores.  The underscore and local
symbol prefixing rules are controllable seperately to the output format.
(ie: it's possible to generate a.out without the _ prefixes on symbols and
also to generate elf with the _ prefixes.  This isn't quite optimal, but
does seem to work pretty well, except the linkers don't always recognise
the local symbols without their normal names)

The default format is a.out (still), nobody should see any major changes.

With both elf and a.out tools and libraries installed:

[1:26pm]/tmp-223> cc -elf -o hello hello.c
peter@beast[1:27pm]/tmp-224> file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped
[1:27pm]/tmp-225> ./hello
hello world!

[1:27pm]/tmp-226> cc -aout -o hello hello.c
[1:27pm]/tmp-227> file hello
hello: FreeBSD/i386 compact demand paged dynamically linked executable not stripped
1:27pm]/tmp-228> ./hello
hello world!

Since my co-conspirators put a lot of effort into this too, I'll add them
so they can share the blame^H^H^H^H^Hglory. :-)

Reviewed by: sos, jdp
1998-03-08 05:29:49 +00:00
..
as Fixed `make -jN' for large N. Just put the generated headers in 1998-03-06 13:13:15 +00:00
awk Remove yet another superfluous file. 1997-10-26 12:53:16 +00:00
bc Fix the getopt() prototype to match the system one. 1997-03-11 17:14:37 +00:00
binutils Use foo/bar.a' instead of -Lfoo -lbar' for linking to static internal 1998-03-07 08:55:00 +00:00
bison change bin to BINOWN and BINGRP 1997-08-21 03:28:07 +00:00
cc First round of changes to support generation of assembler for the old 1998-03-08 05:29:49 +00:00
cpio Added to RELENG_2_2 via tagging. 1997-08-21 08:26:55 +00:00
cvs comment that pvcs_to_rcs is left out since it needs perl5 1998-01-26 04:33:03 +00:00
dc Make makewhatis(1) happy. 1997-03-21 20:59:44 +00:00
dialog fix misspelling 1997-08-30 11:08:06 +00:00
diff Define PR_PROGRAM properly 1997-10-29 17:35:54 +00:00
diff3 Switch to contrib version 1997-10-29 16:50:42 +00:00
gdb Use foo/bar.a' instead of -Lfoo -lbar' for linking to static internal 1998-03-07 08:55:00 +00:00
genclass Add a genclass.1 manpage. 1997-09-15 19:18:59 +00:00
gperf Revert $FreeBSD$ to $Id$ 1997-02-22 15:48:31 +00:00
grep Delete cc(1) debug option, typo from last commit. 1998-03-07 16:13:57 +00:00
groff Don't create an unused obj directory. 1998-02-20 11:18:57 +00:00
gzip Make machine dependent asm code machine dependent. 8-) 1998-01-25 09:52:32 +00:00
ld Implement dladdr. 1998-02-06 16:46:46 +00:00
man Use foo/bar.a' instead of -Lfoo -lbar' for linking to static internal 1998-03-07 09:46:17 +00:00
patch Add PATCH_INDEX_FIRST environment variable to do the same as -I option 1998-01-22 07:44:04 +00:00
perl Build perl header files for machine/* too. 1998-02-21 04:06:24 +00:00
ptx Same deal. 1997-01-11 03:50:21 +00:00
rcs Add missing *roff macros to correct display about -V option. 1997-08-23 15:50:53 +00:00
sdiff Switch to contrib version 1997-10-29 16:58:20 +00:00
send-pr Added a sparc category to the list. 1997-12-20 18:54:22 +00:00
sort Open temporary files with O_EXCL. 1998-03-06 19:00:26 +00:00
tar The ' character is treated differently as the first character of a line. 1998-02-15 17:03:58 +00:00
texinfo Real skeleton manpage for install-info 1997-08-29 09:10:22 +00:00
Makefile Correct spammage from MACHINE_ARCH commit - you don't want to 1998-02-20 16:14:37 +00:00
Makefile.inc Revert $FreeBSD$ to $Id$ 1997-02-22 15:48:31 +00:00