Commit Graph

15 Commits

Author SHA1 Message Date
Peter Wemm
a2034fc036 svr4.h defines ASM_IDENTIFY_GCC, but neglects to define
ASM_IDENTIFY_LANGUAGE.  Use the osfrose.h method, because gdb assumes
'C' by default, so there's no need to further clutter the symbol table.
1998-03-08 13:26:15 +00:00
Peter Wemm
9ed6fc5562 Cosmetic cleanup for a.out asm generation.. Don't put the end-of-file
markers that the stabs-in-elf system uses.
1998-03-08 12:47:45 +00:00
Peter Wemm
178576c62f Put the function stabs in traditional order on a.out, or gdb doesn't see
function local variables.
1998-03-08 11:54:04 +00:00
Peter Wemm
ebdff85b87 Add hooks for John Birrell's kernel thread support library.
Submitted by: John Birrell <jb@cimlogic.com.au>
1998-03-08 05:33:24 +00:00
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
John Birrell
85351f7d5a Let gcc know about libc_r. Use -pthread to link against libc_r instead
of libc.
1997-05-03 02:58:54 +00:00
John Polstra
07bb70bf47 Make "gcc -shared" work properly for building shared libraries. An
up-to-date version of c++rt0.o is necessary for this to work right.

Closes PR gnu/3035: gcc -shared flag is broken.
1997-04-09 20:13:41 +00:00
John Polstra
5a55bb419e Disallow "-p" when linking, with a diagnostic that recommends using
"-pg" and gprof(1) instead.  FreeBSD does not support plain "-p" or
prof(1).

Plain "-p" is still allowed when just compiling.  In the compile
phase, "-p" is identical "-pg".  It is used by <bsd.lib.mk> for
building profiled object files.
1997-04-05 16:19:08 +00:00
Satoshi Asami
8fd2f83608 -current is now 3.0. NOT a 2.2 candidate. :) 1997-03-25 08:06:06 +00:00
David E. O'Brien
6a16ae63cd Undo rev 1.4 of freebsd.h and 1.2 freebsd-elf.h, where I added
_BSD4_4 as a predefined symbol.  People on the lists generally didn't care
for it.
1997-02-24 13:19:34 +00:00
David E. O'Brien
dfc33decb2 Add _BSD4_4 as a predefined symbol.
Peter Dufault (dufault@hda.com) suggested this is the most approate symbol
to use.

2.2-R candidate.
1997-02-16 20:55:32 +00:00
Peter Wemm
b376b0ea5f Activate the .weak code generation for libgcc.a and g++ now that it works. 1996-10-01 02:20:27 +00:00
Peter Wemm
da843809ce Merge in freebsd-specific changes 1996-09-18 06:54:11 +00:00
Peter Wemm
9882643d04 Import of 2.7.2.1 into vendor branch 1996-09-18 05:45:16 +00:00
Peter Wemm
a4cd5630b0 Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the
non-i386, non-unix, and generatable files have been trimmed, but can easily
be added in later if needed.

gcc-2.7.2.1 will follow shortly, it's a very small delta to this and it's
handy to have both available for reference for such little cost.

The freebsd-specific changes will then be committed, and once the dust has
settled, the bmakefiles will be committed to use this code.
1996-09-18 05:35:50 +00:00