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.

Linker define option

Hi,

How can I set a variable to linker command file by command line?

For example, in my linker.cmd

MEMORY
{
#ifdef CORE0
DDR3: o = 0x87000000 l = 0xf000000
#endif

#ifdef CORE1
DDR3: o = 0x87000000 l = 0xf000000
#endif

}

How can I define CORE0 or CORE1 via command line, in order to define a diferent DDR3 to each situation?

Weber

  • I've already tried the following as the 'Optimizing compiler' document says:

    "C:/ti/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" --define=CORE0="1" -mv6600 -g --display_error_number --diag_warning=225 --abi=eabi -z -m"ProjetoMaster.map" --warn_sections --display_error_number -i"C:/ti/ccsv5/tools/compiler/c6000_7.3.4/lib" -i"C:/ti/ccsv5/tools/compiler/c6000_7.3.4/include" --reread_libs --rom_model -o "ProjetoMaster.out" -l"./configPkg/linker.cmd"  "./message_multicore.obj" -l"libc.a" "C:/Users/Weber/workspace_v5_2_teste/superlinker.cmd" 

    Weber

  • Hello,

    the --define option would just apply to preprocessor statements in your code. It doesn't apply to the linker command file. As far as i know, I don't think such conditional behavior is supported with the linker command file. People either comment out parts of the linker command file as needed or use multiple build configurations with different copies of the linker command file to apply for each one.

    Thanks

    ki

  • Hi,

    I've found it. On properties > Build > C6000 Linker > Command File Preprocessing

    Just had to set the property 'Pre-define preprocessor macro_name_to_value' with COREn=1 to make my conditional linker file to work.

    Weber

  • sweet! learned something new every day. thanks for sharing