patches/binutils/2.16.1/120-skip-comments.patch
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Wed Jun 08 15:47:43 2011 +0200 (2011-06-08)
changeset 2508 9e2761e59a75
parent 402 197e1b49586e
permissions -rw-r--r--
debug/cross-gdb: check host dependencies

Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.

Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"

Hence, expat should be considered mandatory.

On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.

This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
[yann.morin.1998@anciens.enib.fr: add comment for impossible static cross-gdb]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 [removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
     2 
     3 Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
     4 Fixes
     5 localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
     6 when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
     7 
     8 Paths adjusted to match crosstool's patcher.
     9 
    10 Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
    11 From: Andreas Schwab <schwab at suse dot de>
    12 To: Nathan Sidwell <nathan at codesourcery dot com>
    13 Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
    14 Date: Fri, 23 Apr 2004 22:27:19 +0200
    15 Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
    16 
    17 Nathan Sidwell <nathan@codesourcery.com> writes:
    18 
    19 > Index: read.c
    20 > ===================================================================
    21 > RCS file: /cvs/src/src/gas/read.c,v
    22 > retrieving revision 1.76
    23 > diff -c -3 -p -r1.76 read.c
    24 > *** read.c	12 Mar 2004 17:48:12 -0000	1.76
    25 > --- read.c	18 Mar 2004 09:56:05 -0000
    26 > *************** read_a_source_file (char *name)
    27 > *** 1053,1059 ****
    28 >   #endif
    29 >   	  input_line_pointer--;
    30 >   	  /* Report unknown char as ignored.  */
    31 > ! 	  ignore_rest_of_line ();
    32 >   	}
    33 >   
    34 >   #ifdef md_after_pass_hook
    35 > --- 1053,1059 ----
    36 >   #endif
    37 >   	  input_line_pointer--;
    38 >   	  /* Report unknown char as ignored.  */
    39 > ! 	  demand_empty_rest_of_line ();
    40 >   	}
    41 >   
    42 >   #ifdef md_after_pass_hook
    43 
    44 This means that the unknown character is no longer ignored, despite the
    45 comment.  As a side effect a line starting with a line comment character
    46 not followed by APP in NO_APP mode now triggers an error instead of just a
    47 warning, breaking builds of glibc on m68k-linux.  Earlier in
    48 read_a_source_file where #APP is handled there is another comment that
    49 claims that unknown comments are ignored, when in fact they aren't (only
    50 the initial line comment character is skipped).
    51 
    52 Note that the presence of #APP will mess up the line counters, but
    53 that appears to be difficult to fix.
    54 
    55 Andreas.
    56 
    57 2004-04-23  Andreas Schwab  <schwab@suse.de>
    58 
    59 	* read.c (read_a_source_file): Ignore unknown text after line
    60 	comment character.  Fix misleading comment.
    61 
    62 --- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
    63 +++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
    64 @@ -950,10 +950,14 @@ read_a_source_file (char *name)
    65  	      unsigned int new_length;
    66  	      char *tmp_buf = 0;
    67  
    68 -	      bump_line_counters ();
    69  	      s = input_line_pointer;
    70  	      if (strncmp (s, "APP\n", 4))
    71 -		continue;	/* We ignore it */
    72 +		{
    73 +		  /* We ignore it */
    74 +		  ignore_rest_of_line ();
    75 +		  continue;
    76 +		}
    77 +	      bump_line_counters ();
    78  	      s += 4;
    79  
    80  	      sb_new (&sbuf);
    81 @@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
    82  	    continue;
    83  #endif
    84  	  input_line_pointer--;
    85 -	  /* Report unknown char as ignored.  */
    86 +	  /* Report unknown char as error.  */
    87  	  demand_empty_rest_of_line ();
    88  	}
    89  
    90 
    91 -- 
    92 Andreas Schwab, SuSE Labs, schwab@suse.de
    93 SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
    94 Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
    95 "And now for something completely different."