* src/SDCCmain.c (linkEdit): Added runtime path detection to the mcs51 port.
authormichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 2 Nov 2001 04:52:12 +0000 (04:52 +0000)
committermichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 2 Nov 2001 04:52:12 +0000 (04:52 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1485 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCmacro.c
src/SDCCmacro.h
src/SDCCmain.c
src/SDCCutil.c
src/SDCCutil.h
src/z80/ralloc.c

index b71c20da1a8802714dda4e32ba098ebca2dbc442..4bc7ce431941777cbc4bd27cce6f7f539785e625 100644 (file)
@@ -124,3 +124,19 @@ char *msprintf(hTab *pvals, const char *pformat, ...)
 
   return pret;
 }
+
+void
+mfprintf(FILE *fp, hTab *pvals, const char *pformat, ...)
+{
+  va_list ap;
+  char *p;
+
+  va_start(ap, pformat);
+
+  p = mvsprintf(pvals, pformat, ap);
+
+  va_end(ap);
+
+  fputs(p, fp);
+  Safe_free(p);
+}
index b6b499c9a42041b96759fde3c46788babbff5d8e..782096ba581f3e235c388fcd06c70d2b30bec888 100644 (file)
 
 #include "SDCChasht.h"
 #include <stdarg.h>
+#include <stdio.h>
 
 char *mvsprintf(hTab *pvals, const char *pformat, va_list ap);
 char *msprintf(hTab *pvals, const char *pformat, ...);
+void mfprintf(FILE *fp, hTab *pvals, const char *pformat, ...);
 
 #endif
 
index 63d3937bff1735c4efc9391d4e4db1a165d51939..705e408f2a8a711981d76f5899485a408311e226 100644 (file)
@@ -1132,7 +1132,7 @@ linkEdit (char **envp)
              break;
            }
        }
-      fprintf (lnkfile, "-k %s/%s\n", SDCC_LIB_DIR /*STD_LIB_PATH */ , c);
+      mfprintf (lnkfile, getRuntimeVariables(), "-k {libdir}{sep}%s\n", c);
 
       /* standard library files */
       /* if (strcmp (port->target, "ds390") == 0) */
index a4c9d932c776bf8404d383fdff1eecbff54720b8..75475d3db84dc76b4e9fec14efc7c05becf532c4 100644 (file)
@@ -313,3 +313,8 @@ chomp (char *sz)
     *nl = '\0';
 }
 
+hTab *
+getRuntimeVariables(void)
+{
+  return _mainValues;
+}
index 7d8f1e2b3c7420c21cf2e22fb7b05f3b2d1c7a20..e312256ca7d8cd96dd3fd92796a193e2a2320a69 100644 (file)
@@ -85,5 +85,8 @@ bool startsWith (const char *sz, const char *key);
 */
 void chomp (char *sz);
 
+hTab *
+getRuntimeVariables(void);
+
 #endif
 
index 95682c0f9f223efdca7f4c8408511081c5b8bb7d..dd248b713dad259261e08f6b3c7eae6bd78ca010 100644 (file)
@@ -2046,6 +2046,11 @@ packRegsForHLUse (iCode * ic)
       return;
     }
 
+  if (getSize (operandType (IC_RESULT (ic))) != 2)
+    {
+      D (D_HLUSE, ("  + Dropping as the result size is not 2\n"));
+    }
+
   if (IS_Z80)
     {
       if (ic->op == CAST && uic->op == IPUSH)
@@ -2064,7 +2069,7 @@ packRegsForHLUse (iCode * ic)
             {
               goto hluse;
             }
-          else if (uic->op == IPUSH)
+          else if (uic->op == IPUSH && getSize (operandType (IC_LEFT (uic))) == 2)
             {
               goto hluse;
             }