
In message 1defaf580610251315l7a3ef385x73628d836daa2238@mail.gmail.com you wrote:
If you look at the as.texinfo file tagged as binutils_2_15, the -g option is only documented for certain targets, e.g. Alpha and MIPS:
I see.
Yes, "gcc -g" should always work. However, in Matthew's example, the command line also included "-Wa,-g", which injects the -g option
"-Wa,-g" is only set in AFLAGS_DEBUG.
directly into the command line for the assembler, and that seems to work only for 2.16 and later (or maybe not even that in case of ARM.)
But we've been using this for a long, long time. It's been working fine with ELDK 3.x (GCC-3.3.3 / binutils 2.14) on ARM, MIPS and PPC.
I wonder if gcc will automatically pass the correct -g<whatever> option to gas when it's given the -g option? If that's the case, I suppose we could simply remove -Wa,-g and everyone will be happy...
I think it does:
-> arm-linux-gcc -v -g -c foo.s Using built-in specs. Target: arm-linux Configured with: /opt/eldk/build/arm-2006-02-19/work/usr/src/denx/BUILD/crosstool-0.35/build/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/gcc-4.0.0/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/var/tmp/eldk.Ks4ZhN/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux --with-headers=/var/tmp/eldk.Ks4ZhN/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/arm-linux/include --with-local-prefix=/var/tmp/eldk.Ks4ZhN/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/arm-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long Thread model: posix gcc version 4.0.0 (DENX ELDK 4.0 4.0.0) /opt/eldk-4.0-2006-02-19/usr/bin/../lib/gcc/arm-linux/4.0.0/../../../../arm-linux/bin/as --gdwarf2 -mcpu=arm9 -mfpu=softvfp -o foo.o foo.s
See the "--gdwarf2" passed to as.
Best regards,
Wolfgang Denk