Commit Graph

255 Commits

Author SHA1 Message Date
David E. O'Brien
f269f9df8d Grrrrr. Put the $FreeBSD$ in a Bad Place. 1999-10-15 21:49:40 +00:00
David E. O'Brien
b7da6f22c3 Register the fact we want expand_main_function() to invoke __main. 1999-10-15 20:56:19 +00:00
David E. O'Brien
46e3c32617 Merge rev 1.2 (a.out support) into EGCS 1.1.2. 1999-10-15 20:48:35 +00:00
David E. O'Brien
68883b2d58 Return these files back to their stock versions.
These files aren't used in either building GCC or with a GCC installation
in the "FreeBSD native" case.
1999-10-13 15:55:31 +00:00
David E. O'Brien
b50366c383 Virgin import of EGCS 1.1.2 1999-10-12 00:47:56 +00:00
David E. O'Brien
f04184a54b This commit was generated by cvs2svn to compensate for changes in r52143,
which included commits to RCS files with non-trunk default branches.
1999-10-12 00:47:56 +00:00
David E. O'Brien
44d23c83a9 Remove a useless blank line, I accidently added. 1999-10-12 00:35:49 +00:00
David E. O'Brien
ba505f0644 Move RCS tag to our normal place. 1999-10-10 22:43:12 +00:00
David E. O'Brien
1baaa64720 Style cleanups:
* be consistant on protecting "#define FOO"s with "#undef FOO".
* be consistant that macro params are upper case, and commas are followed
  by a space in the macro definition
* protect macro param expansion by ()'s
* break long lines
* line continuations chars to consistant column
* remove trailing spaces
1999-10-10 22:33:40 +00:00
David E. O'Brien
ac27a30c83 Remove things common to all FreeBSD platforms. They will now live in a
FreeBSD wide config file.

This includes "WORD_SWITCH_TAKES_ARG" & "SWITCH_TAKES_ARG".  Platforms
such as FreeBSD/MIPS will need to override these two defintions, but it
can #undef them and define them approapiately.
1999-10-10 22:17:24 +00:00
David E. O'Brien
bdc228c639 Virgin import of EGCS 1.1.2 1999-10-03 09:19:40 +00:00
David E. O'Brien
72a8915368 This commit was generated by cvs2svn to compensate for changes in r51899,
which included commits to RCS files with non-trunk default branches.
1999-10-03 09:19:40 +00:00
David E. O'Brien
dc76ff5a60 Virgin import of EGCS 1.1.2 1999-10-02 21:54:32 +00:00
David E. O'Brien
360a324402 This commit was generated by cvs2svn to compensate for changes in r51885,
which included commits to RCS files with non-trunk default branches.
1999-10-02 21:54:32 +00:00
David E. O'Brien
929da3a6b2 * We have /var/tmp, not /usr/tmp. So use that where EGCS used the latter.
*  In the absence of the env vars TMPDIR, TMP, TEMP (which override this
   ordering), attempt to create temperary files in /tmp, P_tmpdir (/var/tmp),
   /usr/tmp, and .  until successful.
1999-10-02 21:50:07 +00:00
David E. O'Brien
261b37fb6c Virgin import of EGCS 1.1.2 1999-10-02 01:46:57 +00:00
David E. O'Brien
8167cb1aef This commit was generated by cvs2svn to compensate for changes in r51848,
which included commits to RCS files with non-trunk default branches.
1999-10-02 01:46:57 +00:00
David E. O'Brien
b6f18be149 Bring BDE's printf format error fixes into EGCS. 1999-09-19 11:00:01 +00:00
David E. O'Brien
989e177ec2 Bring our profiling tweaks into EGCS 1.1.2. 1999-09-19 10:43:38 +00:00
David E. O'Brien
db102939b7 "COMMENT_BEGIN" is no longer used. 1999-09-19 10:32:18 +00:00
David E. O'Brien
8d5d8faf3b Support linking against libgcc_r.
Submitted by:	Luoqi Chen <luoqi@chen.ml.org>
1999-09-19 10:31:14 +00:00
David E. O'Brien
844dfb548c This should get us the same functionality we had with GCC 2.7.2.1.
*  Support for our dual ELF/a.out building ability
*  Our custom ASM_* definitions
*  Our custom debugger and profiling related definitions
*  Our custom STARTFILE/ENDFILE specs

*  The stock EGCS 1.1.2 freebsd-elf.h file depended on
   egcs-1.1.2/gcc/config/linux.h, which included "svr4.h".  We will
   include "svr4.h" via our "tm.h" definition.  So add the few bits
   from "linux.h" we actually needed.

*  Using our current crtbegin.o/crtend.o we cannot support the DWARF2
   unwinding mechanisms.  In the future we will switch to the
   non-sjlj-exceptions type exception machanism.  However the `make world'
   bootstrap problems with the EGCS crtstuff.c must be overcome first.

*  Our a.out gas doesn't "know" to use NOP's for aligns while in the text
   section.  Thus the a.out alignment generation needed tweaking from
   what we did with GCC 2.7.2.  [from BDE]

*  The definition of SUPPORTS_ONE_ONLY prevents the compiler from trying
   to use "linkonce" sections for a.out.  The definition of
   NO_DBX_FUNCTION_END we had causes it to avoid .stabs symbols that the
   assembler cannot handle for a.out.  [from JDP]

*  The previous "EXCEPTION_SECTION_FUNCTION" is the wrong name for EGCS.
   It also needed tweaking for EGCS.  [from JDP]

Also bump __FreeBSD_cc_version to 400002 in case we need to know we are
using EGCS at some point.
1999-09-19 10:28:57 +00:00
David E. O'Brien
a49a6042f2 Use the stock EGCS version of this. 1999-09-19 09:09:21 +00:00
David E. O'Brien
f23c668cbe Document the new i386 family options.
Obtained from:	invoke.texi
1999-09-19 09:00:24 +00:00
David E. O'Brien
7c61b15b97 Document -Os optimization. Add to -O{0,2} documentation.
Obtained from:	invoke.texi
1999-09-19 08:58:44 +00:00
David E. O'Brien
95a61b537f Merge revs 1.2-1.11 (doc fixes and updates to reflect reality) into the
EGCS 1.1.2 manpage.
1999-09-19 08:56:04 +00:00
David E. O'Brien
dbf974584d Merge rev 1.2 docs fixes into EGCS 1.1.2's manpage. 1999-09-19 08:18:18 +00:00
David E. O'Brien
08d266f93c Fix conflicts. This has a small part of rev 1.2 in it. 1999-09-18 11:14:59 +00:00
David E. O'Brien
8e9098e1f3 Fix conflicts. This merges revs 1.{2,3} with EGCS 1.1.2. 1999-09-18 11:02:28 +00:00
Bruce Evans
e6413fc21c Merge from ../egcs/gcc/gcc.c rev.1.5:
Don't exclude directories that the linker is "known" to search (/lib
and /usr/lib) when deciding whether to pass certain paths to the
linker.  Under FreeBSD, the linker is actually known to never search
/lib and to only search /usr/lib in the elf case.  Not passing the
paths causes at best causes confusing differences for cross compiling.
This change is conditional on FREEBSD_NATIVE but should be absolute.
1999-09-13 15:50:16 +00:00
David E. O'Brien
6641a1b79d Use the stock EGCS 1.1.2 file here. Our previous changes are OBE.
(code change by rev 1.3 has been removed, and 1.2 is not needed since
contrib/gcc/cp/except.c is now the stock one)
1999-08-30 10:50:39 +00:00
David E. O'Brien
291e7c65a6 Use the stock EGCS 1.1.2 file here. I cannot determine if our previous
changes for ObjC are still appropriate.
1999-08-30 10:27:11 +00:00
David E. O'Brien
e5b502affd This brings rev 1.2 into EGCS 1.1.2. Also tweaks gleemed from EGCS
ChangeLog's.  Note that rev 1.3 changes (HOST_PTR_PRINTF) was not
brought into EGCS 1.1.2 as that is the default.
1999-08-30 10:12:33 +00:00
David E. O'Brien
7870fcbbe0 Fix conflicts. 1999-08-30 09:58:28 +00:00
David E. O'Brien
37f5c2fd7b Use the stock EGCS 1.1.2 file here. Our previous changes are OBE. 1999-08-30 09:54:31 +00:00
David E. O'Brien
a80c005075 This add Alpha and proper x86 support to EGCS 1.1.2. Functionally speaking,
this covers revs 1.{2,3}.
1999-08-30 08:41:19 +00:00
David E. O'Brien
698a4b1cdb This brings rev 1.2 (reality check and document profiling extensions)
into EGCS 1.1.2.
1999-08-30 07:51:44 +00:00
David E. O'Brien
562502babb This brings rev 1.2 (document printf0()) into EGCS 1.1.2. 1999-08-30 07:38:42 +00:00
David E. O'Brien
7214c26ced Fix conflicts. 1999-08-30 07:28:52 +00:00
David E. O'Brien
1ff1015930 Fix conflicts.
This adds rev 1.2 (-fformat-extensions) to EGCS 1.1.2.
1999-08-30 04:01:02 +00:00
David E. O'Brien
252b86ac0b Fix conflict. 1999-08-30 01:02:55 +00:00
David E. O'Brien
293515f678 Fix conflicts. 1999-08-30 00:01:36 +00:00
David E. O'Brien
e9a76e02f7 This brings rev 1.2 (FREEBSD_NATIVE) and rev 1.5 (mixed ELF/aout support)
into EGCS 1.1.2.
1999-08-29 23:53:46 +00:00
David E. O'Brien
b8871f91cb Correct vfork()/exit() to vfork()/_exit().
Also return "1" rather than "-1".  According to bde: -1 is unrepresentable.
Exit statuses must be >= 0 and <= 255, at least if chars are 8 bits and
shorts are 16 bits.  This seems to only be documented indirectly in exit.2
by referring to wait.2.  WEXITSTATUS() throws away all except the low 8 bits
of the status returned by _exit(), and the kernel actually only stores 8
bits of it (if chars are 8 bits, etc.), so wait() can't return any more bits.

Obtained from: rev 1.4 of contrib/gcc/gcc.c
1999-08-29 23:46:20 +00:00
David E. O'Brien
a462f21277 Fix conflicts.
This brings rev 1.2 (-fformat-extensions) into EGCS 1.1.2.
1999-08-28 11:46:53 +00:00
David E. O'Brien
d8f6a90a74 Fix conflicts.
This brings revs 1.{2,3} minus rev 1.4 into EGCS 1.1.2.
1999-08-28 11:27:19 +00:00
David E. O'Brien
c805b031d1 Fix conflicts. 1999-08-28 08:14:14 +00:00
David E. O'Brien
54e4f442da Fix conflicts. This brings rev 1.2 (fix stabs ordering for a.out) into
EGCS 1.1.2.
1999-08-28 07:19:03 +00:00
David E. O'Brien
e573f48e0e Fix conflicts. This brings in rev 1.2 (FreeBSD native support -- do not
search the multitude of extended include file paths that do not exist)
into EGCS 1.1.2.
1999-08-27 11:02:42 +00:00
David E. O'Brien
19d654ce6b Fix conflicts. This brings the "printf0" addition into EGCS 1.1.2. 1999-08-27 10:58:48 +00:00
David E. O'Brien
1428ce0f83 Don't accept %q length specifiers in the kernel (more precisely,
if compiling with -fformat-extensions). Gcc's format checker never
actually supported %q length specifiers.  It treats %q as an alias
for %ll, which is correct if quad_t is long long (e.g., on i386's)
and broken otherwise (e.g., on alphas).

quad_t's currently should be printed in the same way that they
already need to be printed to avoid compiler warnings on all
supported systems: cast them to a standard type that is at least
as large (long or long long) and use the length specifier for that
(%l or %ll).  This is problematic since long long isn't standard
yet.  C9x's intmax_t should be implemented soon.

Don't accept %L length specifiers in the kernel either.  The only
legitimate ones are for long doubles, but the kernel doesn't even
support plain doubles.  (gcc bogusly accepts %Ld as an alias for
%lld, and it sometimes prints "q" in error messages about "ll" and
"L" length specifiers, becauses it represents all these specifiers
as 'q'.)

Submitted by:	bde
1999-08-27 10:05:08 +00:00
David E. O'Brien
35edbffe27 Fixed kernel format checking:
- plain %r and %z were disallowed.  The hard NULs in the warnings were
  hopefully caused by disallowing of plain formats being nonsense.
- new formats for shortening to a byte were allowed, but even the libc
  printf doesn't support them.
- old %hr and %hz formats were allowed, but the kernel printf doesn't
  support them.  The kernel doesn't support %hd either, but this is
  harder to fix.

Submitted by:	bde
1999-08-27 10:02:56 +00:00
David E. O'Brien
1fc70153e9 Fix conflicts.
This brings revs 1.2 (-fformat-extensions) and 1.3 (printf0())
into EGCS 1.1.2.
1999-08-27 10:01:05 +00:00
David E. O'Brien
56c6bb4f57 Fix conflicts. 1999-08-27 09:36:15 +00:00
David E. O'Brien
2a266d02ba Virgin import of gcc from EGCS 1.1.2 1999-08-26 09:30:50 +00:00
David E. O'Brien
f1a94e6381 This commit was generated by cvs2svn to compensate for changes in r50397,
which included commits to RCS files with non-trunk default branches.
1999-08-26 09:30:50 +00:00
David E. O'Brien
2e3446e467 * Consistantly surround macro parameters with ()
* Consistantly put spaces after "," in macro param lists
* Consistantly align continuation characters.
* Don't need to supply all variations of __FOO__ in CPP_PREDEFINES,
  gcc will do that for us.
1999-08-20 09:01:55 +00:00
David E. O'Brien
1f2d1c0503 Move two of the DBX config directives to the common configuration header.
Also simply CPP_PREDEFINES a little.
1999-08-19 09:16:23 +00:00
David E. O'Brien
adba8d12f5 Move "WORD_SWITCH_TAKES_ARG" & "SWITCH_TAKES_ARG" to the general spec file
since their definitions were identical.  FreeBSD/MIPS will need to override
these two defintions, but it can #undef them and define them approapiately.
1999-08-15 22:02:50 +00:00
David E. O'Brien
c86942dc66 Move "LIBGCC_SPEC" to freebsd-native.h as it is not approapiate for
submitting to the GCC mainainers for folding into the stock GCC.
1999-08-15 21:59:46 +00:00
David E. O'Brien
3b82b5b7f7 Virgin import of GCC 2.7.2.3 1999-07-10 23:03:59 +00:00
David E. O'Brien
68bb3e165b This commit was generated by cvs2svn to compensate for changes in r48743,
which included commits to RCS files with non-trunk default branches.
1999-07-10 23:03:59 +00:00
David E. O'Brien
14ffedf1b0 * The OBSTACK_CHUNK_SIZE #define was in the "Code generation parameters"
section rather than the "Miscellaneous parameters" where it belongs.

* Clarify what we are locating using the -m rule.

Submitted by:	bde
1999-07-02 19:26:45 +00:00
David E. O'Brien
5bfda2db35 The GNU standard about putting 2 spaces after sentences in comments
was not consistantly followed.

Submitted by:	bde
1999-07-02 19:20:44 +00:00
David E. O'Brien
7675d60dff Define "OBSTACK_CHUNK_SIZE" as getpagesize().
Our malloc can allocte pagesized blocks efficiently and the EGCS default size
of 4072 bytes is not optimal.

Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1999-06-28 09:05:56 +00:00
Hidetoshi Shimokawa
766b710e3a Remove 'SET_ASM_OP' macro, which is unused now and rather harmful
for recent egcs.
1999-06-10 12:05:48 +00:00
John Polstra
d36a530801 Fix typo (#unset where #undef was meant). 1999-05-21 04:56:32 +00:00
David E. O'Brien
395b1ec416 Consistantly protect "#define FOO ..." with "#undef FOO". 1999-05-20 08:30:48 +00:00
David E. O'Brien
2898537149 Turn DEFAULT_VTABLE_THUNKS back on. It caused problems with undefined symbols
in libstdc++.

Until I have a chance to look at what that problem is and to carefully consider
the upgrade issues of turning it back on at a later date if we leave it turned
off for any extended peroid of time.
1999-04-30 19:12:51 +00:00
David E. O'Brien
e53bca4f44 Rather than hack config/freebsd.h to contain our hacks for a native compiler,
just include them in tm.h (as built from cc/cc_tools/Makefile).

This will reduce the diffs from the vendor sources.

Excellent idea by:	jdp
1999-04-28 18:48:08 +00:00
David E. O'Brien
3f1ea226c9 Simplify the definition of FBSD_SWITCH_TAKES_ARG, and make sure
SWITCH_TAKES_ARG isn't defined (which svr4.h does) when we assign our
definition to it.
1999-04-27 19:29:44 +00:00
David E. O'Brien
512a10fde7 Wait until EGCS 1.2 to use more efficient ``thunks'' to implement C++ vtables.
While I have yet to hear of any problems with us using thunks.  The EGCS
mailing list notes some have problems with it and not using them are a
safer default.  People wanting to use them, can set the appropiate
compiler flag.
1999-04-27 15:43:56 +00:00
David E. O'Brien
1030a4e631 Use new FBSD_SWITCH_TAKES_ARG' and FBSD_WORD_SWITCH_TAKES_ARG'. 1999-04-22 17:45:24 +00:00
David E. O'Brien
61d2d44398 Move SWITCH_TAKES_ARG' to FBSD_SWITCH_TAKES_ARG' and `WORD_SWITCH_TAKES_ARG'
to `FBSD_WORD_SWITCH_TAKES_ARG' which allows architectures to tweak these
values if needed.
1999-04-22 17:45:01 +00:00
David E. O'Brien
073f9b19ff Support linking against libgcc_r.
Submitted by:	Luoqi Chen <luoqi@chen.ml.org>
1999-04-14 00:25:45 +00:00
Bruce Evans
b3827ce345 Removed unconditional definitions of __ELF__. They were redundant for
elf and wrong for i386-aout.
1999-04-08 13:57:13 +00:00
David E. O'Brien
2f494cb24f Merge shared LIB_SPEC into share config header. 1999-04-08 07:49:24 +00:00
David E. O'Brien
44109b462f merge alpha/freebsd-elf.h into alpha/freebsd.h
Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1999-04-08 07:48:49 +00:00
David E. O'Brien
dd03234d28 Mispelled global option in usage. 1999-04-06 13:09:24 +00:00
David E. O'Brien
6c499bb15a Fix space padding that was causing a problem in creating the final
CPP_PREDEFINES.
1999-04-04 22:46:18 +00:00
David E. O'Brien
bf098f1e3f * Protect ourselves from any previously defined options.
* Turn on DEFAULT_VTABLE_THUNKS.  (it is the default anyway, I'm just being
  explicit about it, in case it causes us trouble it might be easier for
  someone to notice it this way)
1999-04-03 23:26:03 +00:00
David E. O'Brien
1eb80b4532 Bump __FreeBSD_cc_version to 400002 in case we need to know we are using
EGCS at some point.

Submitted by:	jdp
1999-04-03 02:18:13 +00:00
David E. O'Brien
3b7a861fcf Alpha architecture config files.
Obtained from:	adapted from Hidetoshi Shimokawa <simokawa@FreeBSD.ORG>'s
		alpha suppliment to the Egcs port.
1999-03-30 07:47:06 +00:00
cvs2svn
f5be10a3f2 This commit was manufactured by cvs2svn to create branch 'VENDOR-gcc'. 1999-03-30 07:36:37 +00:00
David E. O'Brien
32b91f49ab Base configuration file for all FreeBSD targets. 1999-03-30 07:36:36 +00:00
Poul-Henning Kamp
aca6858651 Remove the linker-set hack we used for BB profiling. 1999-03-21 12:28:14 +00:00
David E. O'Brien
992d0ff19f Update __FreeBSD__ and __FreeBSD_cc_version to be consistant with
__FreeBSD_version

Forgotten by: Eivind and Some anonymous release engineer
1999-01-22 11:09:00 +00:00
Peter Wemm
135b45b1ac a.out is default 1999-01-16 08:51:46 +00:00
Martin Cracauer
38db74296d Compile threaded proframs with -D_THREAD_SAFE, not -D_THREADSAFE 1998-12-15 16:43:14 +00:00
John Polstra
34ff484bfc Per request from ache, change the numbering scheme of __FreeBSD_cc_version.
Its form is now like __FreeBSD_version, with the FreeBSD revision in
the top digits.
1998-10-29 22:11:08 +00:00
John Polstra
98bf848b69 Add a new predefined preprocessor symbol "__FreeBSD_cc_version",
with a numeric value that describes the feature level of the
compiler.  This can be used to check for the presence/absence of
FreeBSD-specific compiler features.  The value is a decimal number
whose digits have the form VRRRRFF, where:

	V    = Compiler vendor.  0 (elided) means gcc.
	RRRR = Vendor's version number, e.g., 2721 for the current
	       gcc version (2.7.2.1).
	FF   = FreeBSD-specific revision level.  00 means the stock
	       compiler from the vendor.

The value of "__FreeBSD_cc_version" is hard-coded in
"src/contrib/gcc/config/i386/freebsd.h" and must be incremented
when new FreeBSD-specific compiler features are added.  I considered
simply picking up the value of FreeBSD_version from <osreldate.h>.
But that would break cross compiles of gcc.

PR:		Part of the fix for gnu/8452
Suggested by:	bde
1998-10-29 04:27:06 +00:00
Warner Losh
a556fde0bc Add alpha-*=freebsd* to configure 1998-09-09 17:07:36 +00:00
John Polstra
5584f22bb3 Make profiling work for ELF. gprof now autodetects the format of
the executable file, so it will work for both a.out and ELF format
files.  I have split the object format specific code into separate
source files.  It's cleaner than it was before, but it's still
pretty crufty.

Don't cheat on your make world for this update.  A lot of things
have to be rebuilt for it to work, including the compiler and all
of the profiled libraries.
1998-09-07 23:32:00 +00:00
John Birrell
8472e43276 Change /etc/objectformat to /etc/objformat. Last chance 'cause it's E-day.
Suggested by: jdp
1998-08-30 20:40:29 +00:00
Bruce Evans
0f79d73473 Support printf format checking of FreeBSD kernel formats %[Dbrz].
This is enabled by the undocumented option -fformat-extensions.
This option should be named better and/or give more control over
the extensions.

Fixed a message - don't warn about the field width when it's the
precision that has the wrong type.  Didn't fix excessive checking
for the precision relative to the type - ANSI requires both to be
ints, but gcc permits the field width to be either int or unsigned
int.
1998-08-24 06:33:52 +00:00
Bruce Evans
d983fa4305 Fixed printf format errors. gcc should have a macro HOST_PTR_PRINTF_TYPE
to go with its HOST_PTR_PRINTF[_FORMAT], since if %p is wrong for the
format then `void *' is probably wrong for the type.
1998-08-02 14:57:00 +00:00
John Polstra
3bc25faee6 Add support for a new archetype "printf0" for the "format" function
attribute.  It is like the existing "printf" archetype, except that
it doesn't complain if the format string is a null pointer.  See
the node "Function Attributes" in the GCC info pages if you don't
know what this is all about.

This change will allow us to add format string checking for the
err(3) family of functions.
1998-07-15 04:22:45 +00:00
Bruce Evans
c15a5b80be Fixed printf format errors. 1998-06-30 19:53:09 +00:00
John Birrell
6e2f2fe480 Add LIB_SPEC (same as on i386) so that gcc knows about libc_r. 1998-06-08 10:58:36 +00:00
Peter Wemm
4af3a821f1 -pg was causing a link with -lc_r... :-]
Submitted by:  Dmitry Khrustalev <dima@xyzzy.machaon.ru>
PR: 6287
1998-04-13 14:12:34 +00:00
John Birrell
2161ed1f46 Document the FreeBSD specific options from LIB_SPEC. 1998-04-10 09:19:11 +00:00
John Birrell
6db4691d19 Ouch, my local cvs walloped the version I thought I was committing.
Here is what I intended.
1998-03-14 03:02:19 +00:00
John Birrell
1de944af88 On i386, freebsd.h and freebsd-elf.h have been merged to combine
aout and elf support. freebsd-elf.h died as a result, so the BINFORMAT
test for elf in src/gnu/usr.bin/cc/cc_tool/Makefile will need to
use freebsd.h, not freebsd-elf.h. That means that alpha will have to
go the same way. The new alpha/freebsd.h has the alpha/freebsd-elf.h
definitions merged in.
1998-03-13 21:12:12 +00:00
John Birrell
0f471b05f9 Nuke crti.o from the STARTFILE_SPEC again. No asm code is needed on alpha.
Add the define that lets gas know how to ".set" and enable pragmas
so that #pragma weak will work.
1998-03-11 20:56:24 +00:00
John Birrell
37aebf7ed2 Change the LINK_SPEC to specify the same runtime loader as used on
i386-elf because that is what will be used for FreeBSD/Alpha.

Change the STARTFILE_SPEC to match the non-aout version of i386 so
that the csu files can be built in exactly the same way as i386-elf.
This means that FreeBSD/Alpha departs from NetBSD/Alpha which uses
crt0 and crtbegin/crtend. Since i386-aout uses crt0, I guess it was
decided that i386-elf should use crt1. i386-elf also references
crti and with this change, so does FreeBAS/Alpha.

I think it is important for FreeBSD to have a consistent implementation
across architectures and since ELF is quite compatible (ignoring
differences in 32 and 64 bits), gcc might as well be configured the
same.

Another change is that the entry symbol is _start, not __start as
in NetBSD.
1998-03-10 06:47:14 +00:00
Peter Wemm
42fcd1ffa9 Both our a.out (hacked) gas and the binutils gas support .weak
Prompted by: bde
1998-03-09 04:47:58 +00:00
Peter Wemm
df320ec9d3 Only do a.out/elf switching on i386 family 1998-03-09 04:13:31 +00:00
Peter Wemm
3f39463468 Don't disable the use of $ in assembler labels.. It changes libstdc++
and libg++ so that they won't work with existing binaries (including
netscape!!).
1998-03-09 03:26:57 +00:00
Peter Wemm
b51cdb1e8b Spell -Bshareable correctly... :-] 1998-03-08 16:09:57 +00:00
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
2e56a2ce82 Upgrade the cpp pre-defines to include -Dunix. Turns out we need that
to compile m4.

And don't just define __FreeBSD__, but define it as -D__FreeBSD__=3
like on i386.
1998-01-12 02:53:28 +00:00
John Birrell
0f4140c055 Add the alpha MD files for gcc to product ELF for FreeBSD/Alpha.
See freebsd.h and freebsd-elf.h for the silly comment that cgd@netbsd.org
wanted me to add about his claim that uncommented source files that
have been publicly available for ftp for nearly a year; that are
configuration patches to a GPL'ed program; are owned by his previous
employer who refuses to release them. Well... I did as he said. As if
that makes a difference!

At this point we've got cpp, gcc, g++ ported to FreeBSD/Alpha so all
the code that uses __FreeBSD__ is correctly pre-processed. Yay.

I'll commit the bootstrap makefile next to let others play, then on
to libc.
1998-01-11 04:39:46 +00:00
Wolfram Schneider
f6b31571f6 spelling corrections.
PR: docs/4450
Submitted by: josh@quick.net
1997-09-13 16:01:53 +00:00
Peter Wemm
2eba9bcd51 Merge in some of my changes with John's. I've used this to build
an ELF system.  I'm not sure about some of the things here.  We definately
need to go back and rationalize this.
1997-08-29 06:11:52 +00:00
John Polstra
6eb0e3b9f9 Add the necessary defines to the freebsd-elf configuration so that
it can be built via BINFORMAT=elf in the environment.  Most likely
some of the directory defines such as STANDARD_EXEC_PREFIX will
change again soon, as we settle on the proper locations for the
various components.

Note, the build still fails when it tries to compile libgcc2.c
using the ELF compiler, unless arrangements have been made for the
compiler to find the ELF assembler instead of the a.out assembler.
1997-08-28 01:38:56 +00:00
Bruce Evans
d2f874d9b7 Attempt to fix clobbered vendor Id. 1997-06-29 11:43:31 +00:00
Satoshi Asami
7371365efc Make all the info dir entries line up neatly. 1997-05-28 07:49:21 +00:00
Eivind Eklund
6ad98044a1 it's'' -> its'' where appropriate and typo fixes in time2posix.3.
Closes PR docs/3612.

Submitted by:	Josh Gilliam <soil@quick.net>
1997-05-19 16:33:27 +00:00
Peter Wemm
5db0562b97 The -pthread option was added to freebsd.h but missed from freebsd-elf.h 1997-05-12 09:24:27 +00:00
John-Mark Gurney
86696f47ac change an' to a'...
Submitted by: Josh Gilliam
Closes PR#3471
1997-05-05 07:43:50 +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
Peter Wemm
300fb94053 correct vfork()/exit() to vfork()/_exit(). This is far more important
now that vfork() actually works in FreeBSD for the first time.

Spotted by: se
1997-04-25 06:42:57 +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
John Polstra
27aa98671d Update the value of "__FreeBSD__" to 3 for the ELF compiler. 1997-03-26 17:05:21 +00:00
Satoshi Asami
8fd2f83608 -current is now 3.0. NOT a 2.2 candidate. :) 1997-03-25 08:06:06 +00:00
John-Mark Gurney
538efd5320 slight fix to gcc's man page... 1997-03-23 00:51:16 +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
Peter Wemm
8988623bce check for /usr/libdata/gcc/specs and use it if it exists. 1997-02-22 15:21:40 +00:00
Peter Wemm
dc92c6d1cb Back out easy $FreeBSD$ (file already left vendor branch) 1997-02-22 10:52:38 +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
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Poul-Henning Kamp
ec4076d321 Fix BB profiling.
Submitted by:	bde
1997-01-13 12:15:29 +00:00
Joshua Peck Macdonald
a27d0c0f96 This file has the info annotation, except its annotated name
is different from its filename for some reason.
1997-01-11 02:56:24 +00:00
Peter Wemm
2c80f2dbdb Apparently this patch fixes the objc backend on the i386 platforms.
Without this, compiled programs die with FP errors.

This is originally credited to: jlemon@netcom.com (Jonathan Lemon), and
has been forwarded to me by quite a few of people.
1996-10-26 17:00:50 +00:00
Peter Wemm
8adcea95d1 Remove temporary hack to disable use of libstdc++ now that it's built and
installed (and hopefully: working).
1996-10-04 08:51:18 +00:00
John Polstra
87f11ab41b Fix a bug that caused incorrect PIC code to be generated for exceptions.
The symptom was an assembler warning

    "GOT relocation burb: `___EXCEPTION_TABLE__' should be global"

followed (sometimes) by a core dump.  The fix makes the compiler
generate the correct GOTOFF addressing for that symbol, rather than the
GOT addressing it was emitting before.

Warning:  There is still at least one serious bug in the i386 exception
code for PIC.  The exception code that is generated clobbers the GOT
register (%ebx) and then tries to use it later.  That leads to core
dumps at program execution time.  I know where the problem is, but I do
not have a fix for it at this time.  Until it is fixed, exceptions will
not work in PIC code.  This is a general problem for all i386 platforms;
it is not specific to FreeBSD.
1996-10-03 17:49:35 +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
252bb01fbc Temporarily disable the code that wants to add -lstdc++ in tge g++ driver
since we don't have it yet and I've taken too long on the libg++-2.7.2
stuff (it causes problems due to to the lack of .weak support which I've
nearly finished)

Submitted by: "Ph. Charnier" <charnier@xp11.frmug.org>
1996-09-27 05:13:40 +00:00
Peter Wemm
b5ad28261f Doc fixes and updates to reflect reality, as well as info about profiling
extensions.
1996-09-18 06:56:52 +00:00
Peter Wemm
da843809ce Merge in freebsd-specific changes 1996-09-18 06:54:11 +00:00
Peter Wemm
852e8be503 Add in hooks to produce assembler output suitable for binutils+elf
Obtained from: John Polstra <jdp@freebsd.org>, from his elfkit.
1996-09-18 06:50:39 +00:00
Peter Wemm
7767f29ab5 Add the hooks that we use for our profiling extensions.
Obtained from: bde
1996-09-18 06:47:49 +00:00
Peter Wemm
f7f03b3cbc When running native on freebsd (ie: in /usr/bin, /usr/libexec, not the
gnu-style /usr/local/lib/gcc* layout), only search the paths that
exist for the modules (cc1, cc1plus , cc1obj etc)

Also, update an error message.
1996-09-18 06:45:17 +00:00
Peter Wemm
655565618b When compiling native on freebsd, do not search the multitude of extended
include file paths that do not exist.
1996-09-18 06:40:54 +00:00
Peter Wemm
864252eaad build libgcc*.a a little more compact by removing excess local symbols
Obtained from: bde
1996-09-18 06:37:22 +00:00