1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00
Mirror of the FreeBSD src repository https://git.FreeBSD.org/src.git .
Go to file
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
bin Fixed existence test for secure sources (don't test for secure objects). 1998-03-06 16:05:18 +00:00
contrib First round of changes to support generation of assembler for the old 1998-03-08 05:29:49 +00:00
crypto Make the ticket filename the same as for our old eBones. I am going to 1998-02-16 12:39:25 +00:00
etc New moused flag. 1998-03-07 09:02:08 +00:00
games Don't use the FreeBSD misfeature DPSRCS or give explicit dependencies 1998-03-06 07:00:28 +00:00
gnu First round of changes to support generation of assembler for the old 1998-03-08 05:29:49 +00:00
include Add a POSIX sched header. pthread_yield() in draft 4 becomes 1998-03-08 02:17:26 +00:00
kerberos5 Fix a break in the includes where the build blows chunks if it is 1997-10-02 15:03:23 +00:00
kerberosIV Kerberized telnet is not built here. Remove telnet(d). 1998-02-16 12:23:23 +00:00
lib Add sched_yield() witch is the draft 10 equivalent of pthread_yield() 1998-03-08 02:37:27 +00:00
libexec Enable rtld-elf when building an ELF system on the i386. 1998-03-07 19:43:48 +00:00
lkm Don't add files handled by bsd.kmod.mk to CLEANFILES. Don't add never- 1998-02-25 01:40:55 +00:00
release Add a mouse configuration menu. 1998-03-07 08:59:32 +00:00
sbin Oops, merge back 32bit fat description from -stable. 1998-03-07 22:00:31 +00:00
secure Staticise a variable. 1997-10-08 07:02:48 +00:00
share Revert previous commit. Despite the names, these files contain 1998-03-07 22:34:23 +00:00
sys Sync with sys/i386/i386/machdep.c revision 1.292. 1998-03-08 03:55:35 +00:00
tools httpd-error is a shell script which print a summary about 1998-02-15 18:54:26 +00:00
usr.bin Support a couple of new "-s" stats. 1998-03-07 23:40:23 +00:00
usr.sbin Added forgotten new file for -Lfoo -lbar' -> foo/bar.a' change. 1998-03-08 00:19:19 +00:00
COPYRIGHT This is the official 4.4 Lite copyright. 1994-09-11 07:53:28 +00:00
Makefile Change the bootstrap makefile inclusion to be general based on the 1998-02-19 07:34:46 +00:00
Makefile.alpha With the exception of tools that should come from GNU binutils, 1998-02-19 07:25:03 +00:00
README Note that /etc is not installed by world target either. 1997-08-09 14:36:20 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on: $Id: README,v 1.10 1997/02/23 09:18:39 peter Exp $

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel and the contents of /etc.  Please see the top of the Makefile
in this directory for more information on the standard build targets
and compile-time flags.

Building a kernel with config(8) is a somewhat more involved process,
documentation for which can be found at:
   http://www.freebsd.org/handbook/kernelconfig.html
And in the config(8) man page.

The sample kernel configuration files reside in the sys/i386/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file LINT contains entries for all possible devices, not
just those commonly used, and is meant more as a general reference
than an actual kernel configuration file (a kernel built from it
wouldn't even run).


Source Roadmap:
---------------
bin		System/User commands.

contrib		Packages contributed by 3rd parties.

eBones		Kerberos package - NOT FOR EXPORT!

etc		Template files for /etc

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

lib		System libraries.

libexec		System daemons.

lkm		Loadable Kernel Modules.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		DES and DES-related utilities - NOT FOR EXPORT!

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/handbook/synching.html