Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Mar 1998 21:29:54 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.ORG>
To:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-contrib@FreeBSD.ORG, cvs-gnu@FreeBSD.ORG
Subject:   cvs commit: src/contrib/gcc function.c gcc.c libgcc2.c src/contrib/gcc/config/i386 freebsd.h freebsd-elf.h src/contrib/gcc/cp except.c src/gnu/usr.bin/cc Makefile.inc src/gnu/usr.bin/cc/cc Makefile src/gnu/usr.bin/cc/cc_tools ...
Message-ID:  <199803080529.VAA27130@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
peter       1998/03/07 21:29:54 PST

  Modified files:
    contrib/gcc          function.c gcc.c libgcc2.c 
    contrib/gcc/config/i386 freebsd.h 
    contrib/gcc/cp       except.c 
    gnu/usr.bin/cc       Makefile.inc 
    gnu/usr.bin/cc/cc    Makefile 
    gnu/usr.bin/cc/cc_tools Makefile 
  Removed files:
    contrib/gcc/config/i386 freebsd-elf.h 
  Log:
  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
  
  Revision  Changes    Path
  1.2       +13 -8     src/contrib/gcc/function.c
  1.5       +78 -0     src/contrib/gcc/gcc.c
  1.2       +1 -5      src/contrib/gcc/libgcc2.c
  1.10      +461 -216  src/contrib/gcc/config/i386/freebsd.h
  1.3       +4 -0      src/contrib/gcc/cp/except.c
  1.23      +3 -3      src/gnu/usr.bin/cc/Makefile.inc
  1.13      +2 -4      src/gnu/usr.bin/cc/cc/Makefile
  1.8       +12 -27    src/gnu/usr.bin/cc/cc_tools/Makefile



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803080529.VAA27130>