This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NDK bug: compile without optimization

Other Parts Discussed in Thread: SYSBIOS

Hi all,

I'm trying to compile NDK with debug information and without any optimization level for C66 devices, but I think that there's a bug in the library because it's not possible to compile it without optimization.

My enviroment is composed by:

NDK: 2.22.00.06

SYSBIOS: 6.34.01.14

XDC: 3.24.02.30

CGTOOLS: 7.4.1

According to the guide "http://processors.wiki.ti.com/index.php/Rebuilding_The_NDK_Core_Using_Gmake" I've modified the file ndk.mak in the NDK root directory specifying the path of XDC_TOOLS, SYSBIOS and compiler.

Moreover I've specified  in the ndk.bld the compiler options as follow:

var c6xOpts = " -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 -ms2 ";
/* Uncomment the following lines to build libraries for debug mode: */

c6xOpts += " -g -o0 ";

Before compilation I've cleaned the project (gmake -f ndk.mak clean), and after I've compiled the library (gmake -f ndk.mak all).

During this operation .mak files are automatically created; analyzing for example stk.ae66.mak file in /packages/ti/ndk/stack/lib the compiler options have "-g -o0" (as specified in the ndk.bld), but also -o2 option!

The following "make" code shows the compiler option for bind.c file.

package/lib/lib/stk/bind/bind.oe66: | .interfaces
package/lib/lib/stk/bind/bind.oe66: bind/bind.c lib/stk.ae66.mak
@$(RM) $@.dep
$(RM) $@
@$(MSG) cle66 $< ...
$(ti.targets.elf.C66.rootDir)/bin/cl6x -c -qq -pdsw225 -mv6600 --abi=eabi -eo.oe66 -ea.se66 -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 -ms2 -g -o0 -Dxdc_target_name__=C66 -Dxdc_target_types__=ti/targets/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_7_4_1 -O2 -D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE -I$(PKGROOT)/ti/ndk//inc -I$(PKGROOT)/ti/ndk//inc/tools $(XDCINCS) -I$(ti.targets.elf.C66.rootDir)/include -fs=./package/lib/lib/stk/bind -fr=./package/lib/lib/stk/bind -fc $<
$(MKDEP) -a $@.dep -p package/lib/lib/stk/bind -s oe66 $< -C -qq -pdsw225 -mv6600 --abi=eabi -eo.oe66 -ea.se66 -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 -ms2 -g -o0 -Dxdc_target_name__=C66 -Dxdc_target_types__=ti/targets/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_7_4_1 -O2 -D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE -I$(PKGROOT)/ti/ndk//inc -I$(PKGROOT)/ti/ndk//inc/tools $(XDCINCS) -I$(ti.targets.elf.C66.rootDir)/include -fs=./package/lib/lib/stk/bind -fr=./package/lib/lib/stk/bind
-@$(FIXDEP) $@.dep $@.dep

This bug is platform independent; the make file for C64P and C674 have the same problem.

How can I resolve the issue? I'm not a XDC expert and I have no idea where the bug could be.

Thanks,

Matteo