* as/z80/z80mch.c: fixed bug #1704376: missing as-z80 errors
[fw/sdcc] / src / pic16 / main.c
index 246007b22db0257a3d156946aa2cd9d935f5f53e..68172c6c07b7a5c0a843462ec27d509e527969f9 100644 (file)
@@ -51,7 +51,7 @@ static char *_pic16_keywords[] =
   "far",
   "interrupt",
   "near",
-  "pdata",
+  //"pdata",
   "reentrant",
   "sfr",
   "sfr16",
@@ -60,7 +60,7 @@ static char *_pic16_keywords[] =
   "_code",
   "_generic",
   "_near",
-  "_pdata",
+  //"_pdata",
   "_naked",
   "shadowregs",
   "wparam",
@@ -674,8 +674,8 @@ static void _pic16_linkEdit(void)
 
     shash_add(&linkValues, "linker", pic16_linkCmd[0]);
 
-    mergeSets(&tSet, libDirsSet);
     mergeSets(&tSet, libPathsSet);
+    mergeSets(&tSet, libDirsSet);
 
     shash_add(&linkValues, "incdirs", joinStrSet( appendStrSet(tSet, "-I\"", "\"")));
     shash_add(&linkValues, "lflags", joinStrSet(linkOptionsSet));
@@ -695,18 +695,18 @@ static void _pic16_linkEdit(void)
 
     if(!libflags.ignore) {
       if(libflags.want_libc)
-        addSet(&libFilesSet, Safe_strdup("libc18f.a"));
+        addSet(&libFilesSet, Safe_strdup("libc18f.lib"));
 
           if(libflags.want_libm)
-            addSet(&libFilesSet, Safe_strdup("libm18f.a"));
+            addSet(&libFilesSet, Safe_strdup("libm18f.lib"));
 
           if(libflags.want_libio) {
-            sprintf(temp, "libio%s.a", pic16->name[1]);   /* build libio18f452.a name */
+            sprintf(temp, "libio%s.lib", pic16->name[1]);   /* build libio18f452.lib name */
             addSet(&libFilesSet, Safe_strdup(temp));
           }
 
           if(libflags.want_libdebug)
-            addSet(&libFilesSet, Safe_strdup("libdebug.a"));
+            addSet(&libFilesSet, Safe_strdup("libdebug.lib"));
         }
 
     shash_add(&linkValues, "libs", joinStrSet(libFilesSet));
@@ -753,46 +753,34 @@ _pic16_finaliseOptions (void)
       char devlib[512];
 
       /* now add the library for the device */
-      sprintf(devlib, "libdev%s.a", pic16->name[1]);   /* e.g., libdev18f452.a */
+      sprintf(devlib, "libdev%s.lib", pic16->name[1]);   /* e.g., libdev18f452.lib */
       addSet(&libFilesSet, Safe_strdup(devlib));
 
       /* add the internal SDCC library */
-      addSet(&libFilesSet, Safe_strdup( "libsdcc.a" ));
+      addSet(&libFilesSet, Safe_strdup( "libsdcc.lib" ));
     }
 
   if (alt_asm && alt_asm[0] != '\0')
     {
-      size_t len = strlen(alt_asm);
-      char *cmd = malloc(len + 3);
-
-      cmd[0] = '"';
-      memcpy(&cmd[1], alt_asm, len);
-      cmd[len + 1] = '"';
-      cmd[len + 2] = '\0';
-      pic16_linkCmd[0] = cmd;
+      pic16_asmCmd[0] = alt_asm;
     }
 
   if (alt_link && alt_link[0] != '\0')
     {
-      size_t len = strlen(alt_asm);
-      char *cmd = malloc(len + 3);
-
-      cmd[0] = '"';
-      memcpy(&cmd[1], alt_link, len);
-      cmd[len + 1] = '"';
-      cmd[len + 2] = '\0';
-      pic16_linkCmd[0] = cmd;
+      pic16_linkCmd[0] = alt_link;
     }
 
-  if  (!pic16_options.no_crt)
+  if (!pic16_options.no_crt)
     {
       pic16_options.omit_ivt = 1;
       pic16_options.leave_reset = 0;
     }
 
-  if  (options.model == MODEL_SMALL)
-    addSet(&asmOptionsSet, Safe_strdup("-DSDCC_MODEL_SMALL"));
-  else if(options.model == MODEL_LARGE)
+  if (options.model == MODEL_SMALL)
+    {
+      addSet(&asmOptionsSet, Safe_strdup("-DSDCC_MODEL_SMALL"));
+    }
+  else if (options.model == MODEL_LARGE)
     {
       char buf[128];
 
@@ -803,7 +791,7 @@ _pic16_finaliseOptions (void)
       addSet(&asmOptionsSet, Safe_strdup(buf));
     }
 
-  if  (STACK_MODEL_LARGE)
+  if (STACK_MODEL_LARGE)
     {
       addSet(&preArgvSet, Safe_strdup("-DSTACK_MODEL_LARGE"));
       addSet(&asmOptionsSet, Safe_strdup("-DSTACK_MODEL_LARGE"));