Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12610 Discussions

-g3 generates incorrect target.ld

Altera_Forum
Honored Contributor II
923 Views

I use the following global compiler flags in the nios2configtool "-g3 -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -DSYSTEM_BUS_WIDTH=32 -mno-hw-mul". I changed the default options -g and -O3 to -g3 and O0. According to the gcc documentation -g3 requests debugging information at level 3 (default is 2). The lib compiles fine but there seems to be a problem with the generated linker script target.ld in the lib dir. It now contains a lot of defines as in normal c- source code. The linker cannot handle these defines and exits because of a parse error. If I delete all the defines in target.ld the build succeeds. Is this a bug of the nios2configtool?

0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
218 Views

This is due to the way eCos generates it's linker script, and it effects all architectures (not just Nios II). The linker script is generated using the C pre-processor, and the linker can't cope with the macro debug information that the -g3 option creates. You can use anything up to and including -g2 when building eCos.

0 Kudos
Reply