[TUHS] What did cc -2 do?

Richard Tobin richard at inf.ed.ac.uk
Tue Jun 27 23:54:06 AEST 2017


> Browsing the source for "cc" in v6 and v7, if invoked with -2 would
> replace crt0.o with crt2.o. If the -2 were followed by another character
> (probably intended to be -20), it would use crt20.o and use -l2 instead
> of -lc.
> 
> These options seem to be undocumented, and I can't find any source code
> of these libraries or indication as to what the purpose was.

The "scc" man page for System V may be enlightening, as it mentions
similarly-named files:

  NAME
    scc - C compiler for stand-alone programs

  SYNOPSIS
    scc [ +[ lib ] ] [ option ] ... [ file ] ...
    
  DESCRIPTION
    Scc prepares the named files for stand-alone execution.
    [...]
    
  FILES
    /lib/crt2.o       execution start-off
    /usr/lib/lib2.a   stand-alone library    
    /usr/lib/lib2A.a  +A configuration library
    /usr/lib/lib2B.a  +B configuration library

-- Richard

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the TUHS mailing list