History log of /freebsd-10.2-release/contrib/gcc/config/i386/freebsd.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 285830 23-Jul-2015 gjb

- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
builds.
- Update newvers.sh to reflect RC1.
- Update __FreeBSD_version to reflect 10.2.
- Update default pkg(8) configuration to use the quarterly branch.[1]

Discussed with: re, portmgr [1]
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 238472 15-Jul-2012 kib

Pass --enable-new-dtags to the linker invocation by default. If
desired, one can turn off the generation of post-ELF standard dtags by
overriding it with --disable-new-dtags after the default switch.

Immediate effect of the change is that -rpath path is now stored both
in DT_RPATH and DT_RUNPATH tags, which is the right way to provide
rpath for dynamic linker supporting DT_RUNPATH per specification.

Reviewed by: kan
MFC after: 1 month


# 236137 27-May-2012 kib

Enable gnu hash generation for dynamic ELF binaries on x86.

Reviewed by: kan


# 217098 07-Jan-2011 kib

Make gcc emit the .note.GNU-stack section into the assembler files.

Reviewed by: kan


# 181534 10-Aug-2008 das

Make -mfancy-math-387 the default on FreeBSD, as it is on most other
operating systems. Previously, gcc would inhibit the generation of
fsqrt, fsin, and several other floating point instructions, for the
benefit of the old in-kernel math emulator, which was removed over 5
years ago.


# 180079 28-Jun-2008 obrien

White space fixes.


# 180078 28-Jun-2008 obrien

Reduce diff to vendor.


# 169706 19-May-2007 kan

Update configuration files for GCC 4.2.


# 146915 03-Jun-2005 kan

Fix a typo from previos commit.


# 146909 03-Jun-2005 kan

Catch up with changes in BDX_OUTPUT_[LR]BRAC callers.


# 146908 03-Jun-2005 kan

Merge conflicts for GCC 3.4.4.


# 132857 29-Jul-2004 kan

Remove obsolete ASM_FINAL_SPEC definition.

Reported by: green


# 132741 28-Jul-2004 kan

Update i386 MD bits for GCC 3.4.2-prerelease.


# 123715 22-Dec-2003 kan

Fix ASM_OUTPUT_LABELREF to deal with TSL model prefixes GCC
started to use internally. They need to be stripped before
the name of the label or symbol is printed.


# 119414 24-Aug-2003 obrien

Reformat FBSD_{START,END}FILE_SPEC to FSF coding standards.
Use these in our i386, amd64, and alpha platforms.


# 119016 17-Aug-2003 gordon

Tell the toolchain to look for rtld in /libexec instead of /usr/libexec.


# 117479 12-Jul-2003 kan

Do not override FP rounding options for 32bit platforms. amd64 doesn't
need this.


# 117418 11-Jul-2003 kan

Update for 3.3.1-prerelease.


# 114842 08-May-2003 obrien

I goofed in rev 1.59 (a.out support axing) and missed getting FUNCTION_PROFILER
fully clean. This resulted in inserted garbage into the produced assembly code
when the gcc -pg and -fPIC options are used together.

PR: i386/50598
Submitted by: Don Lewis <truckman@freebsd.org>


# 114077 26-Apr-2003 obrien

Remove the last vestiges (I hope) of the mixed ELF/a.out support.
As a plus we can use the stock CC1_SPEC and ASM_SPEC for AMD64.


# 113420 13-Apr-2003 kan

Teach gcc how to put unitialized data into BSS on FreeBSD.


# 107286 26-Nov-2002 obrien

Remove our custom mixed ELF/a.out support. This means the base compiler
now only produce ELF objects. It also makes us closer to stock GCC, and
simplifies the set of changes we still need from stock GCC on every import.

Applauded by: peter
Approved by: re


# 99884 12-Jul-2002 obrien

Fix C++ exception handling. GCC was using the older BSD DBX register numbers
rather than the ELF ABI/SVR4 ones in its DWARF unwinding.

Submitted by: Alexander Kabaev <ak03@gte.com>


# 99883 12-Jul-2002 obrien

When I decided to use a stock dbxout.c rather than merge the rev 1.2 change
(put the function stabs in traditional order on a.out, or gdb doesn't see
function local variables), I failed to remove the related knobs here.

Effectively were overrode the ELF-wide definition in elfos.h w/o providing
new infrastructure. This is what caused GDB to fail to debug applications
compiled and linked with -stabs. This is because GCC was unconditionally
inserts .stabs instruction for functions after the function body. GDB was
getting confused because what it thinks is function beginning address is
actually function ending address.

Submitted by: Alexander Kabaev <ak03@gte.com>


# 98597 21-Jun-2002 obrien

Tweaks for the 64-bit compiler.


# 98572 21-Jun-2002 obrien

BDE prefers this organization.

Submitted by: bde


# 98096 10-Jun-2002 obrien

cvs -j -j gave me two copies of TARGET_VERSION and I didn't notice
it before committing.


# 97943 06-Jun-2002 obrien

Match the DBX_OUTPUT_MAIN_SOURCE_FILE_END definition in dbxelf.h.

Bug found by: bde


# 97910 06-Jun-2002 obrien

Didn't get them all in revision 1.50.


# 97908 06-Jun-2002 obrien

Fix excessive alignment for the aout case, and unbreak genassym for that case.
Our aout linker has alignment hacks and doesn't need gcc to do anything special.

Tested for a year by: bde :-)


# 97907 06-Jun-2002 obrien

Tidy do-while.

Requested by: bde


# 96466 12-May-2002 obrien

do-while ASM_OUTPUT_ALIGN to enable its use in more places.


# 96447 12-May-2002 obrien

Fixes for building a.out bits.

Submitted by: bde


# 96144 07-May-2002 obrien

Comment a knob.


# 96143 07-May-2002 obrien

The default ASM_OUTPUT_ADDR_DIFF_ELT will now handle our mixed a.out/ELF.


# 95810 30-Apr-2002 obrien

i386 MD bits for Gcc 3.1.

These are totally untested. Do these work? Hell if I know, I have yet to
bootstrap using these bits. But people want them, so here they are.


# 95349 24-Apr-2002 obrien

Style changes to reduce diff to things I did in the FSF repo.


# 95348 24-Apr-2002 obrien

Fix bug where we were loosing our platform-wide ASM_COMMENT_START
definition due to pollution in i386/unix.h.


# 93263 27-Mar-2002 obrien

Switch register numbers for DWARF2_DEBUG also.


# 91221 25-Feb-2002 obrien

Use the default 'ld' emulation rather than hard coding it.
For FreeBSD, 'ld' 2.12.0 uses a different emulation than in the past.
So this change makes the upgrade easier.


# 73325 02-Mar-2001 obrien

Change "NO_PROFILE_DATA" to "NO_PROFILE_COUNTERS" to match the commit by
the FSF/GCC people in the stock 2.97 source that is like our custom change
modulo the conditional compilation symbol.


# 73305 02-Mar-2001 obrien

Move the obvious bits of mixed ELF and a.out support down into this MD
header to reduce the difference of our sources to the stock GNU/FSF ones.
While the mix binary format support was nice to have in the FreeBSD MI
header as a frame work, it just clutters up too much and makes the FreeBSD
MI header more different from the FSF/GNU stock one than it needs to be.


# 68601 11-Nov-2000 obrien

Properly format the SUBTARGET_SWITCHES so that ``gcc -v --help'' prints
them out.

PR: 19326
Submitted by: Naohiko Tsuji <yakisoba@f2.dion.ne.jp>


# 60776 22-May-2000 obrien

Do not use DWARF2 unwinding mechanisms for C++ exceptions on all of our
platforms.


# 60731 20-May-2000 obrien

ASM_DECLARE_OBJECT_NAME and ASM_FINISH_DECLARE_OBJECT are ELF MI routines
to generate the special .type and .size directives which are used to set
the corresponding fields of the linker symbol table entries in the ELF
object file. As such they are not i386-specific and thus belong in our
MI header. Otherwise on the Alpha we don't properly give the type and
size of dynamic symbols. Bintuil versions past 2.9.1 warn of this and
w/o this change, `ld' generates a lot of warnings during a `make world'.


# 58478 23-Mar-2000 obrien

Clean up the FreeBSD configuration files -- includes removing the usage
of svr4.h on the i386, and moving all the shared arch neutral bits into
the FreeBSD general config header.


# 56810 29-Jan-2000 obrien

Fix our -mprofiler-epilogue code.

"The problem is that egcs/gcc-2.95's reorganisation of the prologue and
epilogue code to use rtl instead of output_asm_insn() completely broke our
hooks. rtl is emitted in a different order, only after optimisation, while
output_asm_insn() is emitted immediately. rtl is presumably used so that
the prologue and epilogue can be optimised.

I couldn't find any good examples to copy. gcc's own
FUNCTION_BLOCK_PROFILER still uses output_asm_insn() and seems to be
completely broken. One of the XXX comments points to this.

IIRC, the hacks here basically arrange to emit magic label names; then when
the magic names are output, they are transformed into prologue and epilogue
code."

Submitted by: bde


# 54813 19-Dec-1999 obrien

Use symbolic values rather than constants in TARGET_DEFAULT.

Submitted by: bde on -current


# 54807 19-Dec-1999 obrien

Use a unified CPP_SPEC.


# 54665 16-Dec-1999 obrien

Fix my CPP_SPEC synatax screwup.

Totally pissed at self: obrien


# 54630 15-Dec-1999 obrien

Remove the defining of __i486__ baesd on TARGET_CPU_DEFAULT and !m386 or m486.


# 52269 15-Oct-1999 obrien

Register the fact we want expand_main_function() to invoke __main.


# 52142 12-Oct-1999 obrien

Remove a useless blank line, I accidently added.


# 52112 10-Oct-1999 obrien

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


# 52111 10-Oct-1999 obrien

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.


# 51410 19-Sep-1999 obrien

"COMMENT_BEGIN" is no longer used.


# 51409 19-Sep-1999 obrien

Support linking against libgcc_r.

Submitted by: Luoqi Chen <luoqi@chen.ml.org>


# 51408 19-Sep-1999 obrien

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.


# 43052 22-Jan-1999 obrien

Update __FreeBSD__ and __FreeBSD_cc_version to be consistant with
__FreeBSD_version

Forgotten by: Eivind and Some anonymous release engineer


# 40736 29-Oct-1998 jdp

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.


# 40715 29-Oct-1998 jdp

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


# 38928 07-Sep-1998 jdp

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.


# 35168 13-Apr-1998 peter

-pg was causing a link with -lc_r... :-]

Submitted by: Dmitry Khrustalev <dima@xyzzy.machaon.ru>
PR: 6287


# 34363 09-Mar-1998 peter

Both our a.out (hacked) gas and the binutils gas support .weak

Prompted by: bde


# 34349 09-Mar-1998 peter

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!!).


# 34314 08-Mar-1998 peter

Spell -Bshareable correctly... :-]


# 34285 08-Mar-1998 peter

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.


# 34284 08-Mar-1998 peter

Cosmetic cleanup for a.out asm generation.. Don't put the end-of-file
markers that the stabs-in-elf system uses.


# 34269 08-Mar-1998 peter

Put the function stabs in traditional order on a.out, or gdb doesn't see
function local variables.


# 34230 08-Mar-1998 peter

Add hooks for John Birrell's kernel thread support library.

Submitted by: John Birrell <jb@cimlogic.com.au>


# 34229 08-Mar-1998 peter

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


# 25400 03-May-1997 jb

Let gcc know about libc_r. Use -pthread to link against libc_r instead
of libc.


# 24758 09-Apr-1997 jdp

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.


# 24658 05-Apr-1997 jdp

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.


# 24257 25-Mar-1997 asami

-current is now 3.0. NOT a 2.2 candidate. :)


# 23076 24-Feb-1997 obrien

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.


# 22809 16-Feb-1997 obrien

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.


# 18604 01-Oct-1996 peter

Activate the .weak code generation for libgcc.a and g++ now that it works.


# 18349 18-Sep-1996 peter

Merge in freebsd-specific changes


# 18337 18-Sep-1996 peter

This commit was generated by cvs2svn to compensate for changes in r18336,
which included commits to RCS files with non-trunk default branches.


# 18336 18-Sep-1996 peter

Import of 2.7.2.1 into vendor branch


# 18334 18-Sep-1996 peter

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.