jkmcnk / sx-gcc

The GNU Compiler Collection port to NEC SX CPU architecture.
GNU General Public License v2.0
0 stars 2 forks source link

COFF/SDB debug format that is currently used by sx-gcc cannot be used with C++ programs #134

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
A number of "libstdc++-v3" (e.g. "18_support/numeric_limits/min_max.cc")
tests fail to compile with sx-gcc when the debugging information is enabled
(i.e. "-g" switch is used when compiling). The failure is, as follows:

/home/marko/XLAB/sx-linux/tests/test-gcc/test-gplusplus.s:1: Error: junk at
end of line, first unrecognized character is `7'

This error is thrown due to the gas's (GNU assembler) ".def"
pseudo-instruction, which is used for packing the debugging information
with the executable. This instruction doesn't allow the argument to start
with a number. Thus, the instruction below produces error when compiled
with gas:

".def 7extremaIaE;"

Unfortunately, in assembler, many c++ symbols start with number or _. The
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16588 clearly states that
SDB/COFF debugging format cannot be used in c++ programs.

Original issue reported on code.google.com by nou...@gmail.com on 8 Jun 2009 at 1:19

GoogleCodeExporter commented 8 years ago
The solution is to prefix all the symbol names that start with a number, with 
"_SDB_INCOMPATIBLE_" string. Of course this means those symbols will be useless 
for 
debugging, but since SDB debugging format cannot be used with C++ programs (see 
the
statement above), this is not a problem.

This issue is fixed in r291.

Original comment by nou...@gmail.com on 9 Jun 2009 at 9:09