home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume13 / gcc-os9_68k / part07 < prev    next >
Text File  |  1990-05-27  |  27KB  |  648 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Faculty of Sci. and Tech., Keio Univ., Yokohama, Japan.
  3. subject: v13i011: GCC1.37 on OS-9/68000 (7/7) Doc in English
  4. from: bignum@math.keio.ac.jp (NIIMI Makoto)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 13, Issue 11
  8. Submitted-by: bignum@math.keio.ac.jp (NIIMI Makoto)
  9. Archive-name: gcc-os9_68k/part07
  10.  
  11. Here is a documentation of GCC Version 1.37 for OSK.  The distributed
  12. file is a compressed output from command `diff -rc2N'.  Please
  13. decompress it and patch original files of gcc 1.37.  It contains a new
  14. subdirectory `osksrc'.  To boot and use GCC, you need OS-9/68000 (OSK)
  15. of Version 2.2 or later and MicroWare's C compiler of Version 3.0 or
  16. later. 
  17.  
  18.   I would like to thank Takao Shinohara, Takeshi Yamada, Makoto Niimi,
  19. Akihiro Kosakada, Susumu Hara and Yoshinori Tanaka for their helpfull
  20. advices and bug reports.  Without their supports, it was difficult for
  21. me to transport GCC to OSK. 
  22.  
  23.                                             90/05/07  Atsushi Seyama
  24.  
  25.               5-7-20 HIGASHI MACHI, HOYA, TOKYO, JAPAN (Zip code 202)
  26.  
  27.  
  28. [I] Summary of system
  29.  
  30.   GCC for OSK is a system which uses gcc as a compiler driver, cccp as a
  31. preprocessor, cc1 as a compiler (all porting from GNU C), r68(020) as an
  32. assembler and l68 as a linker (these are standard Microware's commands). 
  33. It also uses Microware's standard header files and libraries. 
  34.  
  35.   Microware's OSK is distinguished from any other operating systems by
  36. unique position independent coding and modular structure .  This nature
  37. of OSK required to introduce a new definition, DATA_REF referring to
  38. data area into GNU's compiler cc1 for transporting GCC system.  The rest
  39. of work is concentrated to compromize the difference of the
  40. specifications of two OSs and to overcome the original bugs in OSK
  41. system itself. 
  42.  
  43.  
  44. [II] Install GCC
  45.  
  46.   To compile GCC by Microware's C compiler (Version Version 3.0), you
  47. take following steps. 
  48.  
  49.   1) At first, copy files from directory config as shown below. 
  50.  
  51.         $ copy config/m68osk.md md
  52.         $ copy config/tm_osk.h  tm.h
  53.         $ copy config/out_osk.c aux_output.c
  54.         $ copy config/xm_osk.h  config.h
  55.  
  56.   2) Next generate source file cexp.c from cexp.y using Bison.
  57.  
  58.         $ Bison -o cexp.c cexp.y
  59.  
  60.      We need GNU's cccp even when compiling GCC by Micrware C.  Cexp.c
  61.      is a one of source files of GNU's cccp. 
  62.  
  63.      If you don't have Bison, you must port it.  Changes are simple.
  64.  
  65.      a) change tmp_base in files.c for your system, and `unlink' 
  66.         temporary files after `fclose' it. 
  67.      b) #define bcopy via memcpy as in config/xm_osk.h.
  68.      c) assemble osksrc/alloca.a and link it.
  69.      d) change macro PARSERDIR in Makefile for your system.  PARSERDIR
  70.         is a directory in which Bison assumes bison.simple and
  71.         bison.hairy to exist.
  72.  
  73.   3) Change macros home_gcc and HOST_LIBDIR in Makefile.osk for your
  74.      system.
  75.  
  76.   4) Finally, execute shell script bootosk.sh.  Then bootosk.sh performs
  77.      three stages of compilation:
  78.  
  79.         stage0 to compile GCC via Microware's C. 
  80.         stage1 to compile GCC via GCC obtained by stage0. 
  81.         stage2 to compile GCC via GCC obtained by stage1. 
  82.  
  83.      After the completion of the last stage, bootosk.sh compares
  84.      objects created at stage1 and at stage2 to ensure the validity. 
  85.      If the objects coincide, bootsh.osk prints how to installe GCC. 
  86.      Bootosk.sh requires about 2MB of free area in memory and about 5MB
  87.      of disk storage. 
  88.  
  89.  
  90. [III]  Implementation of compiler
  91.  
  92.   1) Predefined macros
  93.  
  94.     Predefined macros of GCC for OSK are __GNUC__, __OSK__, __mc68000__. 
  95.     If you don't specify option `-ansi', OSK and mc68000 are also
  96.     predefined.  Macros __mc68020__ and mc68020 are not predefined
  97.     although you specify option -mc68020 (or -m68020) to generate codes
  98.     for 68020. 
  99.  
  100.   2) Size and format of fundamental data types
  101.  
  102.     They are the same as in Microware C.  `long double' of ANSI standard
  103.     C is the same as `double'.  64 bits integer `long long int' of GNU's
  104.     extension has little endian format, i.e., high 4 bytes in lower
  105.     address and low 4 bytes in higher address.  Alignment of structure
  106.     and union is the same as in Microware C at least those in standard
  107.     header files are concerned. 
  108.  
  109.   3) Environment variables affecting the execution of GCC
  110.  
  111.     a) TMPDIR
  112.  
  113.       If an environment variable `TMPDIR' is defined, its value is
  114.       regarded as a path of directory in which gcc makes temporary
  115.       files.  If not, gcc makes temporary files in the current working
  116.       directory.  Using gcc's option `-T', you can specify another
  117.       directory for temporary files. 
  118.  
  119.     b) GCCDEF
  120.  
  121.       If an environment variable GCCDEF is defined, its value is taken
  122.       as a path of directory in which gcc searches header files.  If it
  123.       is not defined or if header files are not found in that directory,
  124.       gcc examines directories /DD/DEFS, /H0/DEFS, /D0/DEFS in this
  125.       order.  You can use gcc's option `-I' to specify directories for
  126.       searching header files prior to any of above directories. 
  127.  
  128.     c) GCCLIB
  129.  
  130.       If an environment variable GCCLIB is defined, its value is taken
  131.       as a path of directory in which gcc searches library files, e.g.,
  132.       system's standard library files, startup file `cstart.r' and files
  133.       specified by -l option.  If it is not defined or if library files
  134.       are not found, gcc examines directories /DD/GNULIB, /H0/GNULIB,
  135.       /D0/GNULIB in this order.  You can use gcc's option `-L' to
  136.       specify directories for searching library files prior to any of
  137.       above directories. 
  138.  
  139.     d) GCC_EXEC_PREFIX
  140.  
  141.       The effect of environment variable GCC_EXEC_PREFIX is same as
  142.       original gcc.  One exception is that if a module is in memory, gcc
  143.       uses it.  Standard prefixes are /D0/CMDS/gcc_ and /H0/CMDS/gcc_. 
  144.  
  145.   4) Misc.
  146.  
  147.     To define a variable, its definition is admitted only once
  148.     regardless of the existence of initializer. 
  149.  
  150.  
  151. [IV]  Differences between GCC and Microware C
  152.  
  153.   1) Register usages
  154.  
  155.     Microware C generates codes which use d2 and d3 as temporary
  156.     registers.  GCC generates codes which use d2 and d3 as registers
  157.     being alive across function call.  If you need compatibility, you
  158.     can use gcc's options `-fcall-used-d2' and `-fcall-used-d3'.  Then
  159.     GCC treats d2 and d3 as temporary registers, and codes generated are
  160.     less efficient. 
  161.  
  162.   2) Structure and union as function argument and return value
  163.  
  164.     To get structure/union value, Microware C generates codes that
  165.     caller passes a pointer to static area, and callee sets the value on
  166.     the area which pointer points.  GCC uses similar mechanism, but
  167.     passed pointer points automatic area, so that the callee is
  168.     reentrant.  Microware's convention is the same as that of PCC, and
  169.     is not reentrant, but if you use gcc's option `-fpcc-struct-return',
  170.     then GCC uses PCC's convention and you get the compatibility. 
  171.  
  172.     In Microware C, structure/union arguments are always passed by
  173.     stack, and once an argument is passed by stack, subsequent arguments
  174.     are passed by stack.  In contrast to the usual register calling
  175.     convention, the convention is hardly to understand for most users. 
  176.     In GCC, structure/union arguments are also passed by registers if
  177.     registers are available and if the size is small enough to fit into
  178.     registers.  So at this point, there is no compatibility between
  179.     Microware C and GCC. 
  180.  
  181.   3) Variable number of parameters (stdarg.h)
  182.  
  183.     Function prototypes shall be declared before the use of functions
  184.     with variable number of parameters, except library functions,
  185.     printf, fprintf, sprintf, scanf, fscanf and sscanf.  For these
  186.     functions, function prototypes should not be declared. 
  187.  
  188.   4) Sizeof
  189.  
  190.     Sizeof of Microware C returns signed integer as described in K&R
  191.     first edition.  That of GCC returns unsigned integer as described in
  192.     ANSI standard C. 
  193.  
  194.   5) Special extension of Microware C
  195.  
  196.     The special features of Microware C are not available in GCC except
  197.     escape sequence `\l' representing linefeed character. 
  198.  
  199.   6) Float.h
  200.  
  201.     There are bugs in Microware's libraries, so that float.h isn't
  202.     present.  Bugs are that scanf reads floating points of small
  203.     absolute value incorrectly. 
  204.  
  205.   7) GCC's extension for OSK
  206.  
  207.     Option `-mremote' allocates all data in `remote vsect'.  It may help
  208.     to port a program which uses big array.  The default is `-mnoremote'
  209.     and all data are allocated in `vsect'. 
  210.       Option `-mgss' defines additional global symbol for static
  211.     function.  The name of the global symbol is of the form
  212.     function_name@file_name.  It may help your symbolic debugging.  The
  213.     default is `-mnogss'. 
  214.       Option `-mnostack-check' inhibits to generate codes that checks
  215.     stack overflow.  The default is `-mstack-check'. 
  216.       Other new options may be clear, and probably no misunderstanding
  217.     arises.  You will find a brief description of options by `gcc -?'. 
  218.     Cccp also accepts option `-?'. 
  219.  
  220.  
  221. [V]  Changes and reason
  222.  
  223. Three categories of works were done to transport GCC to OSK.
  224.  
  225.   1) Exptension of GCC's data type to fulfill the separate data area
  226.      access requirement of OSK.
  227.   2) To adapt the Microware OSK and C specification to that of GCC.
  228.   3) Detour the bugs of Microware C.
  229.  
  230.   In principle, all changes are conditionalized by macro definitions. 
  231. Followings are new macros to be introduced for this perpose. 
  232.  
  233.   a) MWC68
  234.  
  235.     It is used to enclose bugs of Microware C. 
  236.  
  237.   b) NO_BIT_FIELD
  238.  
  239.     If it is defined, source files of GCC never use bit-field. 
  240.     Microware C supports bit-field, but there are bugs, so that it is
  241.     defined if MWC68 is defined. 
  242.  
  243.   c) HAVE_SEPARATE_DATA_AREA
  244.  
  245.     DATA_REF takes effects only if this macro is defined.
  246.  
  247.   One exception against this principle is the common definition of
  248. variables.  In this case, except one definition, I add `extern' silently
  249. to all other definitions of the variable. 
  250.  
  251.   1)  Introduction of new DATA_REF
  252.  
  253.     Fundamental problem of porting GCC on OSK is that one can't use
  254.     absolute addressing and one must use offset addressing from a6 to
  255.     access the data.  To represent assembler label, GCC use two RTL
  256.     expressions, SYMBOL_REF and LABEL_REF.  LABEL_REF represents
  257.     assembler label which is a target of (conditional) branch
  258.     instructions, and SYMBOL_REF is used to access the data.  For OSK,
  259.     Mr. Shinohara introduces DATA_REF to resolve the problem.  He uses
  260.     DATA_REF to access data in data area (vsect), and uses SYMBOL_REF
  261.     only for accessing data in text area (psect) such as string literal. 
  262.     It is the only one major change for porting GCC on OSK. 
  263.  
  264.     As described above, in source codes independent of target machine,
  265.     changes concerning DATA_REF take effect only if macro
  266.     HAVE_SEPARATE_DATA_AREA is defined. 
  267.  
  268. Folowings are the files containining DATA_REF and changes made;
  269.  
  270.   i) varasm.c
  271.  
  272.     Make_decl_rtl and output_constant_def generate RTL expressions
  273.     SYMBOL_REF and DATA_REF.  Constant data allocated in text area are
  274.     string literal and arithmetic constants.  No other constants are
  275.     allocated in text area.  For example, although a pointer is declared
  276.     to be `const', it is allocated in data area. 
  277.  
  278.   ii) combine.c, cse.c, emit_rtl.c, explow.c, expmed.c, final.c, flow.c,
  279.       genconfig.c, genextract.c, integrate.c, jump.c, loop.c, recog.c,
  280.       regclass.c, reload.c, reload1.c, rtl.c, rtl.def, rtl.h, rtlanal.c,
  281.       stmt.c
  282.  
  283.     In rtl.def, DEF_RTL_EXPR of DATA_REF is added.  In other files,
  284.     codes for handling DATA_REF are added, those are almost all the same
  285.     as for SYMBOL_REF. 
  286.  
  287.   iii) m68osk.md, out_osk.c
  288.  
  289.     In out_osk.c, osk_data_ref_p, osk_data_addr_p, osk_symbol_ref_p and
  290.     osk_symbol_addr_p are defined to detect SYMBOL_REF and DATA_REF in
  291.     an insn.  Another new function modify_memref is defined to convert
  292.     %m in assembler output template to %p (resp. %v) if the
  293.     corresponding operand is a memory reference via SYMBOL_REF (resp. 
  294.     DATA_REF).  Modify_memref also supports code generation for the
  295.     option `-mremote', and this is the real reason that the new function
  296.     is needed. 
  297.  
  298.     M68osk.md is a machine description for OSK based on original
  299.     m68k.md.  Almost all define-insn patterns are same as in m68k.md. 
  300.     Sun's fpa is not supported.  In the constraint string of SImode
  301.     (Pmode) operand, `s' and `i' which permit address calculations are
  302.     replaced by `n'.  One anonymous define-insn is added to calculate
  303.     address. 
  304.  
  305.     The C codes to generate assembler output template are changed as
  306.     follows:
  307.  
  308.       if an insn uses SYMBOL_REF, it generates codes with pc-relative
  309.       addressing mode.
  310.  
  311.       if an insn uses DATA_REF, it generates codes with constant offset
  312.       addressing mode with base register a6.  
  313.  
  314.     To write template easily, three output formats `%mN', `%pN' and
  315.     `%vN' where N is a digit, are introduced.  `%mN' indicates that the
  316.     operand N may be a memory reference using SYMBOL_REF or DATA_REF. 
  317.     Such a template must be processed by modify_memref, and
  318.     modify_memref converts `%m' to `%p' or `%v' appropriately.  `%pN' is
  319.     an abbreviation for `%N(pc)' and `%vN' is an abbreviation for
  320.     `%N(a6)' or `(%N,a6)'.  Note that direct references of a6 still
  321.     remain in m68osk.md and in out_osk.c, and macro so called
  322.     BASE_REGISTER_REGNO is not yet introduced. 
  323.  
  324.   iv) rtl.h
  325.  
  326.     CONSTANT_P is true if CODE of an insn is DATA_REF.
  327.  
  328.   2)  For adapting GCC to the Microware OSK and C.
  329.  
  330.   First of all, character sets admitted for the file name are different
  331.   between OSK and Un*x.  The problem is that Un*x admits `-' but OSK
  332.   does not admit `-'.  So I replace all `-' in file names by `_', and
  333.   names of include files are also changed in source files. 
  334.  
  335.   i) xm_osk.h
  336.  
  337.     I don't use __builtin_alloca.  Because size of memory alloca
  338.     allocates is not predictable, for OSK which does not have virtual
  339.     memory mechanism, an implementation of alloca that uses malloc as
  340.     C-allcoa seems to be more flexible than __builtin_alloca that gets
  341.     memory directory from the stack area.  Incidentally, maximum size of
  342.     memory allocated by alloca is about 25K when compiling GCC by GCC. 
  343.  
  344.   ii) tm_m68k.h
  345.  
  346.     Since sun's fpa is not supported, `enum reg_class' is different from
  347.     other systems. 
  348.  
  349.   iii) tm_osk.h
  350.  
  351.     It is based on the original tm_m68k.h, but many macros were changed
  352.     as follows;
  353.  
  354.     PREFERRED_RELOAD_CLASS, CONST_COSTS
  355.  
  356.       DATA_REF is taken into account.
  357.  
  358.     FIXED_REGISTERS, CALL_USED_REGISTER, CONDITIONAL_REGISTER_USAGE,
  359.     FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM
  360.  
  361.       Fundamental usage of hardware registers is described.  A6 and a7
  362.       are fixed-registers; d0, d1, a0, a1, a6 and a7 are
  363.       call-used-registers; a5 is the frame-pointer and the
  364.       argument-pointer.  If you specify -mremote,
  365.       CONDITIONAL_REGISTER_USAGE marks d2 and d3 as fixed registers and
  366.       call-used registers.  In this case, d2 and d3 are used for loading
  367.       32bit constant offset. 
  368.  
  369.     LIBCALL_VALUE, FUNCTION_ARG_REGNO_P, FUNCTION_ARG,
  370.     FUNCTION_ARG_PARTIAL_NREGS
  371.  
  372.       On GCC for OSK, function's arguments are passed by registers d0
  373.       and d1.  No argument is passed partly in register and partly in
  374.       stack. 
  375.  
  376.     FUNCTION_PROLOGUE, FUNCTION_EPILOGUE
  377.  
  378.       Output codes are adapted for the use of r68.  No support of fpa
  379.       simplifies macros.  In FUNCTION_PROLOGUE, __stack_check is called,
  380.       which is a function to check stack overflow and is defined in
  381.       gnulibosk.c.  In FUNCTION_EPILOGUE, function free_allocaed is
  382.       called if alloca is used in the function.  It frees memory alloca
  383.       allocates. 
  384.  
  385.     FUNCTION_PROFILER, FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER
  386.  
  387.       The profiling is based on basic block profiler.  No standard
  388.       profiler is present on OSK, so codes are my own. 
  389.  
  390.     SDB_DEBUGGING_INFO, DBX_DEBUGGING_INFO
  391.  
  392.       These debugging information is useless in OSK, so flags are
  393.       undefined. 
  394.  
  395.     TARGET_NEWLINE, TARGET_LF
  396.  
  397.       TARGET_NEWLINE is defined to be 015.  The code is the same as
  398.       TARGET_CR, and there is no code for linefeed.  TARGET_LF exists
  399.       only for OSK, and its value is defined to be 012.  TARGET_LF
  400.       provides the value of the escape sequence `\l' representing
  401.       linefeed character. 
  402.  
  403.     CPP_PREDEFINES, LINK_SPEC, STARTFILE_SPEC, LIB_SPEC
  404.  
  405.       Predefined macros are `OSK' and `mc68000'.  Other specs are
  406.       defined appropriately.  You can't use math trap handler from GCC. 
  407.  
  408.     TARGET_SWITCHES
  409.  
  410.       OSK specific switches (no)remote, (no)stack-check and (no)gss are
  411.       defined.  For effects of these switches, see below. 
  412.  
  413.     OVERRIDE_OPTIONS
  414.  
  415.       It forces `flag_shared_data' to be 1.
  416.  
  417.     DOLLARS_IN_IDENTIFIER
  418.  
  419.       It is defined to be 1. 
  420.  
  421.     TARGET_MEM_FUNCTIONS
  422.  
  423.       It is defined to use memcpy memset and memcmp that are included in
  424.       OSK libraries. 
  425.  
  426.     ASM_FILE_START, ASM_FILE_END, ASM_IDENTIFY_GCC ASM_APP_ON, ASM_APP_OFF,
  427.     TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, ASM_OUTPUT_LABELREF,
  428.     ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_INT, ASM_OUTPUT_SHORT,
  429.     ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_REG_PUSH,
  430.     ASM_OUTPUT_REG_POP, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT,
  431.     ASM_OUTPUT_ALIGN, ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL,
  432.     ASM_OUTPUT_FLOAT_OPERAND, ASM_OUTPUT_DOUBLE_OPERAND,
  433.     PRINT_OPERAND_ADDRESS
  434.  
  435.       These macros are changed so as to output a text suitable for
  436.       r68(020), Microware's standard relocatable assembler. 
  437.  
  438.     ASM_OUTPUT_LABEL, ASM_GLOBALIZE_LABEL
  439.  
  440.       For a label to be global, r68 requires that the label name in
  441.       definition ends with `:'.  The convention is different from Unix,
  442.       and original ASM_OUTPUT_LABEL/ASM_GLOBALIZE_LABEL do not work
  443.       well.  A global variable label_is_global defined in varasm.c is
  444.       introduced to recover the difference. 
  445.  
  446.     ASM_DECLARE_FUNCTION_NAME
  447.  
  448.       It is defined to support the option `-mgss'.
  449.  
  450.     ASM_OUTPUT_INTERNAL_LABEL, ASM_GENERATE_INTERNAL_LABEL
  451.  
  452.       To avoid the name conflicts, internal labels generated by the
  453.       compiler end with `.'. 
  454.  
  455.     PRINT_OPERAND
  456.  
  457.       It processes new output formats %pN and %vN.  It does not support
  458.       %d for absolute addressing.  Also it does not support sun's fpa. 
  459.  
  460.     ASM_OUTPUT_ASCII
  461.  
  462.       It outputs strings for the use of r68.  It is never defined in
  463.       tm_m68k.h. 
  464.  
  465.     TARGET_FPA, REGNO_OSK_FOR_FPA_P, FPA_REG_P
  466.  
  467.       Because sun's fpa is not supported, these macros are undefined. 
  468.  
  469.     FIRST_PSEUDO_REGISTER, HARD_REGNO_MODE_OK, REG_CLASS_NAMES,
  470.     REG_CLASS_CONTENTS, REGNO_REG_CLASS, REG_CLASS_FROM_LETTER,
  471.     CONST_DOUBLE_OK_FOR_LETTER_P, CLASS_MAX_NREGS, NOTICE_UPDATE_CC,
  472.     REGISTER_NAMES
  473.  
  474.       Because sun's fpa is not supported, these macros are simplified. 
  475.  
  476.   iv) c_parse.y, c_exp.y
  477.  
  478.     Parse_escape in c_exp.y and skip_white_space, readescape, yylex in
  479.     c_parse.y support special escape sequence `\l' which represents
  480.     linefeed.  The code is taken from the macro TARGET_LF defined in
  481.     tm_osk.h. 
  482.  
  483.   v) expr.c, stmt.c
  484.  
  485.     Stack check codes are generated at three points; at the entry of
  486.     function; at the entry of a block in which array of dynamic size is
  487.     defined; and at the call of __builtin_alloca.  FUNCTION_PROLOGUE
  488.     generates stack check codes at the entry of function.  In stmt.c,
  489.     expand_decl generates stack check insns at the entry of a block.  In
  490.     expr.c, expand_builtin generates stack check insns at the call of
  491.     __builtin_alloca.  Note that gen_probe is not suitable because it is
  492.     called after stack grows. 
  493.  
  494.   vi) gccosk.c
  495.  
  496.     It is a source file of compiler driver gcc for OSK.  It is provided
  497.     only for the use of OSK, because there are many changes as follows. 
  498.  
  499.     As a first difference, OSK's system call fork is something like
  500.     Un*x's fork plus exec, so that gcc's codes to create process are
  501.     changed.  Similarly usage of pipe in OSK is different from Un*x, and
  502.     corresponding codes are changed.  Next, OSK's syntax of option with
  503.     an argument looks like -o=output and it is different from Un*x's
  504.     style.  So gcc is changed to generate both style of options. 
  505.  
  506.     Other changes are OSK specific.  At first, OSK's gcc removes
  507.     temporary files as soon as possible.  Secondarily, OSK's linker
  508.     lacks option to specify directories to be searched for libraries, so
  509.     OSK's gcc processes the option `-LDIR' for users' sake.  Thirdly,
  510.     linker l68 sometimes aborts by stack overflow, so an option `-F' is
  511.     added to specify additional stack size of processes forked by OSK's
  512.     gcc.  By this option you can specify also their priority. 
  513.  
  514.   vii) cccp.c
  515.  
  516.     Microware's preprocessor can't expand long macro, and Microware C
  517.     compiler c68 can't process long lines.  Thus Microware C compiler
  518.     system can't compile GCC by itself, and we use additionally GNU's
  519.     cccp to compile GCC.  A special option `-K' is added to cccp, and
  520.     under `-K', cccp outputs text suitable for the input of c68. 
  521.  
  522.   viii) gnulibosk.c
  523.  
  524.     It is a gnulib.c for OSK.  New function __stack_check is added,
  525.     which detects runtime stack overflow.  Other functions are the same
  526.     as in the original gnulib.c.  The reason of rewriting is as follows. 
  527.  
  528.     1) GCC's register usage is different from Microware C.
  529.  
  530.       Microware C generates codes that use d2 and d3 as temporary
  531.       registers, but GCC for OSK generates codes that use d2 and d3 as
  532.       register to live across function call.  So gnulib.c compiled by
  533.       Microware C may clobber d2 and d3, and it must be rewritten. 
  534.  
  535.     2) GCC's argument passing convention is different from Microware C.
  536.  
  537.       Although Microware C generates codes which use registers to pass
  538.       arguments, structure/union arguments are passed by stack and once
  539.       an argument is passed by stack, subsequent arguments are also
  540.       passed by stack.  On the other hand, GCC generates codes which use
  541.       registers to pass structure/union arguments if its sizeof is small
  542.       enough.  Since original gnulib.c use arguments of union type, it
  543.       must be rewritten. 
  544.  
  545.   ix) final.c
  546.  
  547.     It supports profile code generation.  Because OSK does not provide
  548.     OS level profiling, Un*x's style of profiler is not supported. 
  549.     Option `-p' generates profile codes to count the number of function
  550.     calls.  It is implemented as a part basic block profiler.  The basic
  551.     block profiler is now in stage of experiment, and no report command
  552.     nor libraries for profiling are included in the distribution. 
  553.  
  554.   x) bootosk.sh, Makefile.osk
  555.  
  556.     These are Shell script and makefile to boot GCC.  Makefile got dirty
  557.     because it supports both Un*x style options and those of OSK. 
  558.  
  559.   xi) osksrc/
  560.  
  561.     It is a new directory used to boot GCC for OSK.  It contains source
  562.     file of library functions, and a makefile to make cccp and cppcccp. 
  563.  
  564.   xi-1) osksrc/Makefile
  565.  
  566.     It is a makefile to make objects cppcccp, cccp, move_if_change and
  567.     really_new.  Cppcccp and cccp are used in stage0 booting, where cccp
  568.     helps Microware C to compile GCC.  Other objects move_if_change and
  569.     really_new are used in all stages of booting GCC.  (Do you believe
  570.     me if I say Microware's make needs "really_new"? Oh! trust me,
  571.     please.)
  572.  
  573.   xi-2) osksrc/cppcccp.c
  574.  
  575.     Cppcccp is a name of an executable file, which contains executable
  576.     module named cpp.  When compiling GCC by Microware C, it is loaded
  577.     into memory.  Then Microware cc forks cpp and cpp forks GNU's cccp
  578.     to preprocess source files. 
  579.  
  580.   xi-3) osksrc/config.h
  581.  
  582.     It is needed to compile cccp by pure Microware C compiler.  As
  583.     stated before, Microware's preprocessor does not expand long macros,
  584.     so the proper config.h can't be used.  It contains minimum number of
  585.     #defines for compiling cccp. 
  586.  
  587.   xi-4) osksrc/alloca.a
  588.  
  589.     It is an alloca based on alloca.c and adapted to OSK.  The reason
  590.     that original alloca.c is not adequate to OSK is as follows.  Codes
  591.     generated by Microware C use the stack-pointer as base register to
  592.     access local variables, and local variables in a block are allocated
  593.     dynamically.  So a call of alloca in a block of a function may free
  594.     a memory segment allocated by alloca in an inner block of the same
  595.     function.  It is undesirable since memory allocated by alloca must
  596.     be alive until the function returns. 
  597.       The adaptaion is done by using frame-pointer a5 instead of
  598.     stack-pointer a7 to mark level of alloca to be called, so it is safe
  599.     to use both in Microware C and GCC. 
  600.  
  601.   xi-5) osksrc/getcd.c
  602.  
  603.     It is a replacement of getwd.  Getcd is a function returning current
  604.     working/execution directory. 
  605.  
  606.   xi-6) osksrc/move_if_change.c
  607.  
  608.     OSK's shell is so poor and it can't execute original move-if-change. 
  609.     Move_if_change.c is a substitution of move-if-change written by C. 
  610.  
  611.   xi-7) osksrc/really_new.c
  612.  
  613.     Really_new is a command used in Makefile.osk.  Function is
  614.     self-explanatory from its name.  It is worth nothing to try to
  615.     understand why such command is needed in a makefile.  So please
  616.     simply accept it.  I have nothing to say about brain-damaged
  617.     Microware's make. 
  618.  
  619.   xi-8) osksrc/ldexp.c, osksrc/perror.c, osksrc/qsort.c, osksrc/stat.c,
  620.         osksrc/stat.h, osksrc/varargs.h
  621.  
  622.     These are OSK specific standard Un*x library functions and header
  623.     file.  Qsort.c is taken from tahoe library.  Qsort.c is needed
  624.     because register usage is different between Microware C and GCC. 
  625.     You can use varargs.h both in Microware C and GCC. 
  626.  
  627.   3) To avoid bugs of Microware C and OSK
  628.  
  629.   i) tm_osk.h (ASM_OUTPUT_COMMON)
  630.  
  631.     Microware's assembler and linker support `com.b' for common
  632.     definition, but there are bugs, so it can't be used.  Instead,
  633.     `ds.b' is used. 
  634.  
  635.   ii) genoutput.c
  636.  
  637.     There is a bug in kernel (Version 2.2) which does not allow to
  638.     execute modules with data size beyond 64KB.  If you compile GCC
  639.     Version 1.37 without changes, its data size exceeds 64KB, and you
  640.     can't execute cc1.  Thus the types of elements of tables which
  641.     genoutput generates are changed to `short' where it is possible. 
  642.  
  643.   iii) recog.h
  644.  
  645.     Corresponding to the change of types of elements of tables described
  646.     above, declarations of tables are changed. 
  647.  
  648.