added option --no-std-crt0 for the z80 and gbz80 ports
authorjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 13 Jul 2003 19:31:19 +0000 (19:31 +0000)
committerjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 13 Jul 2003 19:31:19 +0000 (19:31 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2732 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
doc/sdccman.lyx
src/SDCCglobl.h
src/SDCCmain.c

index 9679048b9ad0b4b1346ebc14d7f0c07fa0ccba84..99666497b42f342c87da07d1ea4b5492a2ffa2c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-07-13  Jesus Calvino-Fraga <jesusc@ece.ubc.ca>
+
+    * src/SDCCmain.c, src/SDCCglobl.h: added option --no-std-crt0
+
 2003-07-12  Jesus Calvino-Fraga <jesusc@ece.ubc.ca>
 
     * sdcc.dsw, all.dsp, link/z80/linkgbz80.dsp, as/z80/as-gbz80.dsp:
index 091237156eee86da29a46cd52e9239e4a908eaa8..724d824d3888a4da089a9232cf223e0e1a745ef2 100644 (file)
@@ -5198,6 +5198,73 @@ status Collapsed
 ).
 \layout Subsubsection
 
+Z80 Options
+\begin_inset LatexCommand \index{Options Z80}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Z80 options}
+
+\end_inset 
+
+
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-callee-saves-bc
+\series default 
+
+\begin_inset LatexCommand \index{-\/-callee-saves-bc}
+
+\end_inset 
+
+
+\size large 
+\emph on 
+\size default 
+\emph default 
+Force a called function to always save BC.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-no-std-crt0
+\series default 
+
+\begin_inset LatexCommand \index{-\/-no-std-crt0}
+
+\end_inset 
+
+ When linking, skip the standard crt0.o object file.
+ You must provide your own crt0.o for your system when linking.
+\layout Subsubsection
+
 Optimization Options
 \begin_inset LatexCommand \index{Options optimization}
 
index 711aa74d8dbe7f5313fc7d9851fc516d9904269f..6262f815ef81fbc5fa5bbd3d4b1d96d3d7ea715d 100644 (file)
@@ -244,6 +244,7 @@ struct options
     int printSearchDirs;        /* display the directories in the compiler's search path */
     int vc_err_style;           /* errors and warnings are compatible with Micro$oft visual studio */
     int use_stdout;             /* send errors to stdout instead of stderr */
+    int no_std_crt0;            /*For the z80/gbz80 do not link default crt0.o*/
     /* sets */
     set *calleeSavesSet;        /* list of functions using callee save */
     set *excludeRegsSet;        /* registers excluded from saving */
index 84310c15d46b8aa9ae540869779e2fbee58a219c..9368e9fe035c3a4c9e9e33d10caa1bbec99e5a11 100644 (file)
@@ -182,7 +182,7 @@ optionsTable[] = {
     { 0,    OPTION_PEEP_FILE,       NULL, "<file> use this extra peep-hole file" },
     { 0,    OPTION_LIB_PATH,        NULL, "<path> use this path to search for libraries" },
     { 0,    "--int-long-reent",     &options.intlong_rent, "Use reenterant calls on the int and long support functions" },
-    { 0,    "--float-reent",        &options.float_rent, "Use reenterant calls on the floar support functions" },
+    { 0,    "--float-reent",        &options.float_rent, "Use reenterant calls on the float support functions" },
     { 0,    OPTION_OUT_FMT_IHX,     NULL, NULL },
     { 0,    "--out-fmt-s19",        &options.out_fmt, NULL },
     { 0,    "--cyclomatic",         &options.cyclomatic, NULL },
@@ -225,6 +225,9 @@ optionsTable[] = {
     { 0,    OPTION_PRINT_SEARCH_DIRS, &options.printSearchDirs, "display the directories in the compiler's search path"},
     { 0,    OPTION_MSVC_ERROR_STYLE, &options.vc_err_style, "messages are compatible with Micro$oft visual studio"},
     { 0,    OPTION_USE_STDOUT, &options.use_stdout, "send errors to stdout instead of stderr"},
+#if !OPT_DISABLE_Z80 || !OPT_DISABLE_GBZ80
+    { 0,    "--no-std-crt0", &options.no_std_crt0, "For the z80/gbz80 do not link default crt0.o"},
+#endif
     /* End of options */
 #if 0 /* 10jun03 !OPT_DISABLE_PIC16 */
     { 0,    "--no-movff",          &options.no_movff, "disable generating MOVFF opcode in PIC16 port"},
@@ -1481,7 +1484,7 @@ linkEdit (char **envp)
   /*For the z80 and gbz80 ports, try to find where crt0.o is...
   It is very important for this file to be first on the linking proccess
   so the areas are set in the correct order, expecially _GSINIT*/
-  if (TARGET_IS_Z80 || TARGET_IS_GBZ80) /*For the z80, gbz80*/
+  if ((TARGET_IS_Z80 || TARGET_IS_GBZ80) && !options.no_std_crt0) /*For the z80, gbz80*/
   {
       char crt0path[PATH_MAX];
       FILE * crt0fp;