This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Build failure on Linux - strnicmp undefined


The following change prevents GDB to build on Linux machines (and perhaps
others) where "strnicmp()" is not defined.

Note that the ChangeLog entry has the wrong date.  It was checked in this 
morning.

I reverted it in my sandbox.  If we can't get hold of Pierre because of
time differences I will revert the patch in the repository as well.


revision 1.2
date: 2000/12/01 10:40:10;  author: muller;  state: Exp;  lines: +22 -16

2000-10-27  Pierre Muller  <muller@ics.u-strasbg.fr>
        
        * p-exp.y (yylex): avoid problem with symbol name
        starting as a operator name.



Here is the build error:

gcc -g -O2         -o gdb main.o libgdb.a    ../bfd/libbfd.a ../readline/libreadline.a
../opcodes/libopcodes.a  ../libiberty/libiberty.a -lncurses    ../libgui/src/libgui.a
-L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/itcl/itcl/unix -litcl3.0
-L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/itcl/itk/unix -litk3.0
-L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/tix/unix/tk8.0 -ltix4.1.8.0
-L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/tk/unix -ltk8.0
-L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/tcl/unix -ltcl8.0  
-L/usr/X11R6/lib -lX11 -ldl  -lieee -lm -lm  ../libiberty/libiberty.a  -ldl -rdynamic
libgdb.a(p-exp.tab.o): In function `pascal_lex':
/home/fnasser/DEVO/insight-sourceware/src/gdb/p-exp.y:956: undefined reference to `strnicmp'
/home/fnasser/DEVO/insight-sourceware/src/gdb/p-exp.y:968: undefined reference to `strnicmp'
collect2: ld returned 1 exit status
make: *** [gdb] Error 1
make: Leaving directory `/big/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/gdb'


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9



Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.2
retrieving revision 1.1
diff -c -p -r1.2 -r1.1
*** p-exp.y     2000/12/01 10:40:10     1.2
--- p-exp.y     2000/06/14 12:27:59     1.1
*************** yylex ()
*** 942,978 ****
    char *uptokstart;
    char *tokptr;
    char *p;
!   int explen, tempbufindex;
    static char *tempbuf;
    static int tempbufsize;
  
   retry:
  
    tokstart = lexptr;
-   explen = strlen (lexptr);
    /* See if it is a special token of length 3.  */
!   if (explen > 2)
!     for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
!       if (strnicmp (tokstart, tokentab3[i].operator, 3) == 0
!           && (!isalpha (tokentab3[i].operator[0]) || explen == 3
!               || (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_')))
!         {
!           lexptr += 3;
!           yylval.opcode = tokentab3[i].opcode;
!           return tokentab3[i].token;
!         }
  
    /* See if it is a special token of length 2.  */
!   if (explen > 1)
!   for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
!       if (strnicmp (tokstart, tokentab2[i].operator, 2) == 0
!           && (!isalpha (tokentab2[i].operator[0]) || explen == 2
!               || (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_')))
!         {
!           lexptr += 2;
!           yylval.opcode = tokentab2[i].opcode;
!           return tokentab2[i].token;
!         }
  
    switch (c = *tokstart)
      {
--- 942,971 ----
    char *uptokstart;
    char *tokptr;
    char *p;
!   int tempbufindex;
    static char *tempbuf;
    static int tempbufsize;
  
   retry:
  
    tokstart = lexptr;
    /* See if it is a special token of length 3.  */
!   for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
!     if (STREQN (tokstart, tokentab3[i].operator, 3))
!       {
!       lexptr += 3;
!       yylval.opcode = tokentab3[i].opcode;
!       return tokentab3[i].token;
!       }
  
    /* See if it is a special token of length 2.  */
!   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
!     if (STREQN (tokstart, tokentab2[i].operator, 2))
!       {
!       lexptr += 2;
!       yylval.opcode = tokentab2[i].opcode;
!       return tokentab2[i].token;
!       }
  
    switch (c = *tokstart)
      {
*************** yyerror (msg)
*** 1450,1452 ****
--- 1443,1446 ----
  {
    error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
  }
+

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]