Hi
    I got this boring security bug report on sdcc:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559840
I would like to ask for your opinion. Shouldnt it be enough to copy ltdl.c from 
libtool version 2.2.6b to the sdcc source files and rebuild?
Older Debian versions need to be patched but I guess I can fix that if I get 
this correct.

Attached is the patch I used for making sdcc-2.9.0 build nicely with gcc-4.4 if 
anyone is interested.

Then I got this FTBS bug yesterday that can be fixed by adding 
#indluce <cstdio>
to cmdlex.cc
/* begin standard C++ headers. */
#include <iostream>
#include <errno.h>
#include <cstdlib>
#include <cstring>
+#include <cstdio>
/* end standard C++ headers. */
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560520

Thanks for any advice
Gudjon
--- a/as/link/hc08/Makefile.in
+++ b/as/link/hc08/Makefile.in
@@ -46,7 +46,7 @@
 
 ASXXLIBSRC = strcmpi.c
 
-LKLIBSRC = getline.c lkaomf51.c lkar.c lkdata.c lkeval.c \
+LKLIBSRC = lk_readnl.c lkaomf51.c lkar.c lkdata.c lkeval.c \
            lkhead.c lklex.c lklib.c lklibr.c lklist.c \
            lknoice.c lkrel.c lksdcclib.c lkstore.c lksym.c
 
--- a/as/link/lklib.c
+++ b/as/link/lklib.c
@@ -31,7 +31,7 @@
 
 #include <string.h>
 
-#include "getline.h"
+#include "lk_readnl.h"
 #include "aslink.h"
 #include "lklibr.h"
 #include "lkrel.h"
@@ -51,7 +51,7 @@
 {
   char relfil[NINPUT];
 
-  while (getline (relfil, sizeof (relfil), libfp) != NULL)
+  while (lk_readnl (relfil, sizeof (relfil), libfp) != NULL)
     {
       FILE *fp;
       char str[PATH_MAX];
@@ -126,7 +126,7 @@
 
   D ("Searching symbol: %s\n", name);
 
-  while (getline (relfil, sizeof (relfil), libfp) != NULL)
+  while (lk_readnl (relfil, sizeof (relfil), libfp) != NULL)
     {
       char str[PATH_MAX];
       FILE *fp;
@@ -206,7 +206,7 @@
  *
  *   functions called:
  *      int     fclose()    c_library
- *      char    *getline()  getline.c
+ *      char    *lk_readnl()  lk_readnl.c
  *      FILE *  fopen()     c_library
  *      VOID    link_main() lkmain.c
  *      int     strlen()    c_library
--- a/as/link/lksdcclib.c
+++ b/as/link/lksdcclib.c
@@ -32,13 +32,13 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "getline.h"
+#include "lk_readnl.h"
 #include "aslink.h"
 #include "lklibr.h"
 #include "lkrel.h"
 
 #define EQ(A,B) !strcmp((A),(B))
-#define MAXLINE 254             /*when using getline */
+#define MAXLINE 254             /*when using lk_readnl */
 
 
 static int
@@ -72,14 +72,14 @@
   char str[NINPUT];
   int state = 0;
 
-  while (getline (str, sizeof (str), libfp) != NULL)
+  while (lk_readnl (str, sizeof (str), libfp) != NULL)
     {
       switch (state)
         {
         case 0:
           if (EQ (str, "<FILE>"))
             {
-              if (NULL != getline (str, sizeof (str), libfp) && EQ (str, ModName))
+              if (NULL != lk_readnl (str, sizeof (str), libfp) && EQ (str, ModName))
                 state = 1;
               else
                 return 0;
@@ -105,7 +105,7 @@
   long IndexOffset = 0;
   pmlibrarysymbol ThisSym = NULL;
 
-  while (getline (FLine, sizeof (FLine), libfp))
+  while (lk_readnl (FLine, sizeof (FLine), libfp))
     {
       switch (state)
         {
@@ -113,7 +113,7 @@
           if (EQ (FLine, "<INDEX>"))
             {
               /*The next line has the size of the index */
-              getline (FLine, sizeof (FLine), libfp);
+              lk_readnl (FLine, sizeof (FLine), libfp);
               IndexOffset = atol (FLine);
               state = 1;
             }
@@ -128,7 +128,7 @@
 
               /* The next line has the name of the module and the offset
                  of the corresponding embedded file in the library */
-              getline (FLine, sizeof (FLine), libfp);
+              lk_readnl (FLine, sizeof (FLine), libfp);
               sscanf (FLine, "%s %ld", ModName, &FileOffset);
               state = 2;
 
@@ -205,7 +205,7 @@
   int state = 0;
   int ret = 0;
 
-  while (getline (str, sizeof (str), libfp) != NULL)
+  while (lk_readnl (str, sizeof (str), libfp) != NULL)
     {
       switch (state)
         {
@@ -239,7 +239,7 @@
   int state = 0;
   long IndexOffset = 0, FileOffset;
 
-  while (getline (FLine, sizeof (FLine), libfp))
+  while (lk_readnl (FLine, sizeof (FLine), libfp))
     {
       char filspc[PATH_MAX];
 
@@ -260,7 +260,7 @@
           if (EQ (FLine, "<INDEX>"))
             {
               /* The next line has the size of the index */
-              getline (FLine, sizeof (FLine), libfp);
+              lk_readnl (FLine, sizeof (FLine), libfp);
               IndexOffset = atol (FLine);
               state = 1;
             }
@@ -271,7 +271,7 @@
             {
               /* The next line has the name of the module and the offset
                  of the corresponding embedded file in the library */
-              getline (FLine, sizeof (FLine), libfp);
+              lk_readnl (FLine, sizeof (FLine), libfp);
               sscanf (FLine, "%s %ld", ModName, &FileOffset);
               state = 2;
             }
--- a/sim/ucsim/cmd.src/newcmdposix.cc
+++ b/sim/ucsim/cmd.src/newcmdposix.cc
@@ -207,7 +207,7 @@
   char *s= NULL;
 
 #ifdef HAVE_GETLINE
-  if (getline(&s, 0, in) < 0)
+  if (lk_readln(&s, 0, in) < 0)
     return(0);
 #elif defined HAVE_GETDELIM
   size_t n= 30;
--- a/as/link/lkrel.c
+++ b/as/link/lkrel.c
@@ -32,7 +32,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include "getline.h"
+#include "lk_readnl.h"
 #include "aslink.h"
 #include "lkrel.h"
 
@@ -79,7 +79,7 @@
 
       end = (size >= 0) ? ftell (libfp) + size : -1;
 
-      while ((end < 0 || ftell (libfp) < end) && getline (str, sizeof (str), libfp) != NULL)
+      while ((end < 0 || ftell (libfp) < end) && lk_readnl (str, sizeof (str), libfp) != NULL)
         {
           if (0 == strcmp (str, "</REL>"))
             return 1;
@@ -110,7 +110,7 @@
    * our object file and don't go into the next one.
    */
 
-  while ((end < 0 || ftell (fp) < end) && getline (buf, sizeof (buf), fp) != NULL)
+  while ((end < 0 || ftell (fp) < end) && lk_readnl (buf, sizeof (buf), fp) != NULL)
     {
       char symname[NINPUT];
       char c;
--- a/as/link/mcs51/Makefile.in
+++ b/as/link/mcs51/Makefile.in
@@ -46,7 +46,7 @@
 
 ASXXLIBSRC = strcmpi.c
 
-LKLIBSRC = getline.c lkaomf51.c lkar.c lkdata.c lkeval.c \
+LKLIBSRC = lk_readnl.c lkaomf51.c lkar.c lkdata.c lkeval.c \
            lkhead.c lklex.c lklib.c lklibr.c lklist.c \
            lknoice.c lkrel.c lksdcclib.c lkstore.c lksym.c
 
--- a/as/link/z80/Makefile.in
+++ b/as/link/z80/Makefile.in
@@ -13,7 +13,7 @@
 
 LKLIB = $(srcdir)/..
 
-LKLIBSRC = getline.c lkaomf51.c lkar.c lkdata.c lkeval.c \
+LKLIBSRC = lk_readnl.c lkaomf51.c lkar.c lkdata.c lkeval.c \
            lkhead.c lklex.c lklib.c lklibr.c lklist.c \
            lknoice.c lkrel.c lksdcclib.c lkstore.c lksym.c
 
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to