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.

c++ exception linking and performance problems



Hi Everybody,

 

I have two questions, a general and a specific one. (Compiler: C6000, CCS 4.1.2.00027, DSP: 64x+, EVM 6437 board)

 

1. It's said that enabling C++ exceptions means a performance loss because of the administration costs of exception handling even if we don't throw an exception at all.

Is there any estimation how slower the exceptions-enabled code compared to the exceptions-disabled code? 5%? 1%?

 

2. I made an ordinary CCS4 project. It's a simple "hello world" application:

#include <stdio.h>
#include <string>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    std::string str = "42"; 
    printf( "Hello baby %s\n", str.c_str() );

}

The compiler options:

-mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include" --include_path="X:/Odin/test/csp/measure_dsp6/Release" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c6000" --include_path="X:/Odin/main/lib" --diag_warning=225

I've got linker errors:

undefined first referenced
symbol in file
--------- ----------------
___catch_clause_number ./main.obj
___curr_eh_stack_entry ./main.obj
___eh_curr_region ./main.obj
___exception_caught ./main.obj
___free_thrown_object ./main.obj
___rethrow ./main.obj
___suppress_optim_on_vars_in_try ./main.obj


 

If I turn off the c++exception handling, it compiles without linking errors.

I tried to change Properties/CSS build/Runtime Support library from <automatic> to rts64plus_eh.lib. I got the same errors. 

After that, I changed  the include lib libc.a to rts64plus_eh.lib, and I got the followings:

error: symbol "__new_handler" redefined: first defined in "C:/Program
Files/Texas
Instruments/ccsv4/tools/compiler/c6000/lib/rts64plus.lib<vars.obj>";
redefined in "C:/Program Files/Texas
Instruments/ccsv4/tools/compiler/c6000/lib/rts64plus_eh.lib<vars.obj>"
error: symbol "___cadelete" redefined: first defined in "C:/Program Files/Texas
Instruments/ccsv4/tools/compiler/c6000/lib/rts64plus.lib<vec_newdel.obj>";
redefined in "C:/Program Files/Texas
Instruments/ccsv4/tools/compiler/c6000/lib/rts64plus_eh.lib<vec_newdel.obj>"

....


 

 Please help how I could enable c++ exceptions without linker errors.

 

Thanks,

Csaba

 

 

  • My guess is that a compiler upgrade will fix your problems.  But I cannot be sure.  So ...

    Please run one of the problem builds again and capture the results of the "Console" build window to a file, and attach that file to your next post.  That should show me exactly which compiler version you are using, and exactly how the linker is invoked.

    Thanks and regards,

    -George

     

  • CsabaP said:

    1. It's said that enabling C++ exceptions means a performance loss because of the administration costs of exception handling even if we don't throw an exception at all.

    Is there any estimation how slower the exceptions-enabled code compared to the exceptions-disabled code? 5%? 1%?

    There's one thing you need to know before I answer that.  There are two basic methods of implementing exception handling, the setjmp method (the old way, formerly the only method used by TI compilers) and the table-driven method (used only in EABI [ELF] mode for C6000 and TMS470).  The table-driven method (TDEH) was developed specifically to cut down on run-time penalty when exceptions are not taken.  In fact, using TDEH, the run-time penalty is almost zero when exceptions are not taken.  Best programming practice says that exceptions should only happen in truly exceptional circumstances, so the expected run-time penalty when using TDEH is very low.  This is accomplished by a minor increase in code size and data size for the exception-handling code and tables.  Although the overhead is expected to be very low, there is still some penalty compared to not handling exceptions at all.

    The setjmp method, on the other hand, is fairly intrusive and expensive at run-time, for fairly obvious reasons.

    I'm not aware of any performance metrics for exception-handling overhead for TI compilers.  One of the problems with trying to benchmark this sort of thing is that the overhead varies widely with the characteristics of the benchmark, such as how extensively exception handling is used.  As a rough guess, I'd say a 1% penalty for the TDEH method and a 10% penalty for the setjmp method would not be surprising.

  • Hi George,

    CSS4 says that no update is available, so I guess it's the latest version of the compiler.

    Here you are the console-output.

    **** Build of configuration Release for project measure_dsp6 ****
    
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all 
    'Building file: ../measure_dsp6.tcf'
    'Invoking: TConf Script Compiler'
    "C:/Program Files/Texas Instruments/xdctools_3_16_02_32/tconf" -b -Dconfig.importPath="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages;" "../measure_dsp6.tcf"
    'Finished building: ../measure_dsp6.tcf'
    ' '
    'Building file: ../main.cpp'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/bin/cl6x" -mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include" --include_path="X:/Odin/test/csp/measure_dsp6/Release" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c6000" --include_path="X:/Odin/main/lib" --verbose --verbose_diagnostics --diag_warning=225 --preproc_with_compile --preproc_dependency="main.pp"  "../main.cpp"
    TMS320C6x C/C++ Compiler                v6.1.12
    Tools Copyright (c) 1996-2009 Texas Instruments Incorporated
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include/xmemory"   ==> std::allocator<T1>::allocator<char>(const std::allocator<T1> &) [with T1=char]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include/xstring"   ==> std::_String_val<T1, T2>::_String_val<char, std::allocator<char>>(T2::rebind<T1>::other) [with T1=char, T2=std::allocator<char>]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include/xmemory"   ==> std::allocator<T1>::allocator<char>() [with T1=char]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include/xstring"   ==> void std::basic_string<T1, T2, T3>::_Copy(std::_String_val<T1, T3>::_Alty::size_type, std::_String_val<T1, T3>::_Alty::size_type) [with T1=char, T2=std::char_traits<char>, T3=std::allocator<char>]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include/xstring"   ==> std::basic_string<T1, T2, T3> &std::basic_string<T1, T2, T3>::erase(std::_String_val<T1, T3>::_Alty::size_type, std::_String_val<T1, T3>::_Alty::size_type) [with T1=char, T2=std::char_traits<char>, T3=std::allocator<char>]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include/xstring"   ==> std::basic_string<T1, T2, T3>::basic_string<char, std::char_traits<char>, std::allocator<char>>(const T1 *) [with T1=char, T2=std::char_traits<char>, T3=std::allocator<char>]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include/xstring"   ==> std::basic_string<T1, T2, T3>::~basic_string<char, std::char_traits<char>, std::allocator<char>>() [with T1=char, T2=std::char_traits<char>, T3=std::allocator<char>]
       "../main.cpp"   ==> main
    'Finished building: ../main.cpp'
    ' '
    'Building file: measure_dsp6cfg.s??'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/bin/cl6x" -mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include" --include_path="X:/Odin/test/csp/measure_dsp6/Release" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c6000" --include_path="X:/Odin/main/lib" --verbose --verbose_diagnostics --diag_warning=225 --preproc_with_compile --preproc_dependency="measure_dsp6cfg.pp"  "measure_dsp6cfg.s62"
    TMS320C6x C/C++ Compiler                v6.1.12
    Tools Copyright (c) 1996-2009 Texas Instruments Incorporated
    'Finished building: measure_dsp6cfg.s??'
    ' '
    'Building file: measure_dsp6cfg_c.c'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/bin/cl6x" -mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include" --include_path="X:/Odin/test/csp/measure_dsp6/Release" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c6000" --include_path="X:/Odin/main/lib" --verbose --verbose_diagnostics --diag_warning=225 --preproc_with_compile --preproc_dependency="measure_dsp6cfg_c.pp"  "measure_dsp6cfg_c.c"
    TMS320C6x C/C++ Compiler                v6.1.12
    Tools Copyright (c) 1996-2009 Texas Instruments Incorporated
    'Finished building: measure_dsp6cfg_c.c'
    ' '
    'Building target: measure_dsp6.out'
    'Invoking: Linker'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/bin/cl6x" -mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --verbose --verbose_diagnostics --diag_warning=225 -z -m"measure_dsp6.map" --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include" -i"X:/Odin/main/lib/../obj" -i"C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/lib/c6000" -i"C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/lib" --reread_libs --rom_model -o "measure_dsp6.out" -l"./measure_dsp6cfg.cmd"  "./measure_dsp6cfg_c.obj" "./measure_dsp6cfg.obj" "./main.obj" -l"libc.a" 
    TMS320C6x C/C++ Compiler                v6.1.12
    Tools Copyright (c) 1996-2009 Texas Instruments Incorporated
    <Linking>
    
     undefined                        first referenced
      symbol                              in file     
     ---------                        ----------------
     ___catch_clause_number           ./main.obj      
     ___curr_eh_stack_entry           ./main.obj      
     ___eh_curr_region                ./main.obj      
     ___exception_caught              ./main.obj      
     ___free_thrown_object            ./main.obj      
     ___rethrow                       ./main.obj      
     ___suppress_optim_on_vars_in_try ./main.obj      
    
    error: unresolved symbols remain
    error: errors encountered during linking; "measure_dsp6.out" not built
    
    >> Compilation failure
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [measure_dsp6.out] Error 1
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.
    Build complete for project measure_dsp6
    
    

     

     

  • Archaeologist, thanks for the clear answer.

     

    Due to the wiki pages the C6000 compiler release 7.0.x is needed to use EABI mode.

    My CSS4 doesn't offer an upgrade from the current compiler version (v6.1.12)  to the release 7. It says the compiler is up-to-date.

    Could you help me which is the proper way to upgrade the compiler  in CSS4?

     

    Maybe it'll be also the solution of my linker-errors as George mentioned.

     

     

  • Update:

     

    I tried with 7.0.2, too. :-) I'm sorry, I'm a CCS newbie yet.

     

    The problem is very similar. Without exception handling it compiles, with exception handling there are linker errors.

    **** Build of configuration Release for project measure_dsp6 ****
    
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all 
    'Building file: ../measure_dsp6.tcf'
    'Invoking: TConf Script Compiler'
    "C:/Program Files/Texas Instruments/xdctools_3_16_02_32/tconf" -b -Dconfig.importPath="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages;" "../measure_dsp6.tcf"
    'Finished building: ../measure_dsp6.tcf'
    ' '
    'Building file: ../main.cpp'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/bin/cl6x" -mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include" --include_path="X:/Odin/test/csp/measure_dsp6/Release" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c6000" --include_path="X:/Odin/main/lib" --verbose --verbose_diagnostics --diag_warning=225 --std_lib_func_defined --preproc_with_compile --preproc_dependency="main.pp"  "../main.cpp"
    TMS320C6x C/C++ Compiler                v7.0.2
    Tools Copyright (c) 1996-2010 Texas Instruments Incorporated
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include/xmemory"   ==> std::allocator<T1>::allocator<char>(const std::allocator<T1> &) [with T1=char]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include/xstring"   ==> std::_String_val<T1, T2>::_String_val<char, std::allocator<char>>(T2::rebind<T1>::other) [with T1=char, T2=std::allocator<char>]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include/xmemory"   ==> std::allocator<T1>::allocator<char>() [with T1=char]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include/xstring"   ==> void std::basic_string<T1, T2, T3>::_Copy(std::_String_val<T1, T3>::_Alty::size_type, std::_String_val<T1, T3>::_Alty::size_type) [with T1=char, T2=std::char_traits<char>, T3=std::allocator<char>]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include/xstring"   ==> std::basic_string<T1, T2, T3> &std::basic_string<T1, T2, T3>::erase(std::_String_val<T1, T3>::_Alty::size_type, std::_String_val<T1, T3>::_Alty::size_type) [with T1=char, T2=std::char_traits<char>, T3=std::allocator<char>]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include/xstring"   ==> std::basic_string<T1, T2, T3>::basic_string<char, std::char_traits<char>, std::allocator<char>>(const T1 *) [with T1=char, T2=std::char_traits<char>, T3=std::allocator<char>]
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include/xstring"   ==> std::basic_string<T1, T2, T3>::~basic_string<char, std::char_traits<char>, std::allocator<char>>() [with T1=char, T2=std::char_traits<char>, T3=std::allocator<char>]
       "../main.cpp"   ==> main
    'Finished building: ../main.cpp'
    ' '
    'Building file: measure_dsp6cfg.s??'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/bin/cl6x" -mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include" --include_path="X:/Odin/test/csp/measure_dsp6/Release" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c6000" --include_path="X:/Odin/main/lib" --verbose --verbose_diagnostics --diag_warning=225 --std_lib_func_defined --preproc_with_compile --preproc_dependency="measure_dsp6cfg.pp"  "measure_dsp6cfg.s62"
    TMS320C6x C/C++ Compiler                v7.0.2
    Tools Copyright (c) 1996-2010 Texas Instruments Incorporated
    'Finished building: measure_dsp6cfg.s??'
    ' '
    'Building file: measure_dsp6cfg_c.c'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/bin/cl6x" -mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include" --include_path="X:/Odin/test/csp/measure_dsp6/Release" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c6000" --include_path="X:/Odin/main/lib" --verbose --verbose_diagnostics --diag_warning=225 --std_lib_func_defined --preproc_with_compile --preproc_dependency="measure_dsp6cfg_c.pp"  "measure_dsp6cfg_c.c"
    TMS320C6x C/C++ Compiler                v7.0.2
    Tools Copyright (c) 1996-2010 Texas Instruments Incorporated
    'Finished building: measure_dsp6cfg_c.c'
    ' '
    'Building target: measure_dsp6.out'
    'Invoking: Linker'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/bin/cl6x" -mv64+ -g -O3 --relaxed_ansi --exceptions --cpp_default --static_template_instantiation --define=DSP64x --verbose --verbose_diagnostics --diag_warning=225 --std_lib_func_defined -z -m"measure_dsp6.map" --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools 7.0.2/include" -i"X:/Odin/main/lib/../obj" -i"C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/lib/c6000" -i"C:/Program Files/Texas Instruments/bios_5_41_02_14/packages/ti/bios/lib" --reread_libs --rom_model -o "measure_dsp6.out" -l"./measure_dsp6cfg.cmd"  "./measure_dsp6cfg_c.obj" "./measure_dsp6cfg.obj" "./main.obj" -l"libc.a" 
    TMS320C6x C/C++ Compiler                v7.0.2
    Tools Copyright (c) 1996-2010 Texas Instruments Incorporated
    <Linking>
    error: symbol "___cadelete" redefined: first defined in "C:/Program Files/Texas
       Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___array_new_zero" redefined: first defined in "C:/Program
       Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "__array_pointer_not_from_vec_new" redefined: first defined in
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code
       Generation Tools 7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in
       "C:\Program Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code
       Generation Tools 7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___anew" redefined: first defined in "C:/Program Files/Texas
       Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___acctor_eh" redefined: first defined in "C:/Program
       Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___canew" redefined: first defined in "C:/Program Files/Texas
       Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___vec_new_eh_zero" redefined: first defined in "C:/Program
       Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___adelete" redefined: first defined in "C:/Program Files/Texas
       Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___placement_array_new_zero" redefined: first defined in
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code
       Generation Tools 7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in
       "C:\Program Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code
       Generation Tools 7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___pcanew" redefined: first defined in "C:/Program Files/Texas
       Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___array_new_prefix_size" redefined: first defined in
       "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/C6000 Code
       Generation Tools 7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in
       "C:\Program Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code
       Generation Tools 7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: symbol "___anew_eh" redefined: first defined in "C:/Program Files/Texas
       Instruments/ccsv4/tools/compiler/C6000 Code Generation Tools
       7.0.2/lib/rts64plus.lib<vec_newdel.obj>"; redefined in "C:\Program
       Files\Texas Instruments\ccsv4\tools\compiler\C6000 Code Generation Tools
       7.0.2\lib\rts64plus_eh.lib<vec_newdel.obj>"
    error: errors encountered during linking; "measure_dsp6.out" not built
    
    >> Compilation failure
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [measure_dsp6.out] Error 1
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.
    Build complete for project measure_dsp6
    
    

     

     

     

     

     

  • CsabaP said:

    undefined first referenced
    symbol in file
    --------- ----------------
    ___catch_clause_number ./main.obj
    ___curr_eh_stack_entry ./main.obj
    ___eh_curr_region ./main.obj
    ___exception_caught ./main.obj
    ___free_thrown_object ./main.obj
    ___rethrow ./main.obj
    ___suppress_optim_on_vars_in_try ./main.obj

    Those are exactly the errors you would get if you somehow linked with the non-EH version of the library, leading me to believe there is something wrong with the project settings.

    CsabaP said:

    I tried to change Properties/CSS build/Runtime Support library from <automatic> to rts64plus_eh.lib. I got the same errors. 

    Doubly suspicious.

    CsabaP said:

    After that, I changed  the include lib libc.a to rts64plus_eh.lib, and I got the followings:

    error: symbol "__new_handler" redefined: first defined in "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/lib/rts64plus.lib<vars.obj>";
    redefined in "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/lib/rts64plus_eh.lib<vars.obj>"

    Duplicated library symbols mean you are somehow including the library twice.

    My guess is that the project is somehow specifying both libc.a and rts64plus_eh.lib; only one or the other should be used.

    I further guess that the libc.a library is being specified in the linker's command-line options before main.obj, which will confuse the linker.

  • I suspect you have found a bug in the compiler.  However, I cannot reproduce it.  I'd appreciate if you would zip up the project directory and post it.

    Thanks and regards,

    -George

  •  

     I also defined a DSP/BIOS v5 config file in the project.  By deleting this config file the project compiles and works on the target board.

     

    My project:

    0777.measure_dsp7.zip

     

     

     

     

  • Thanks for posting your project.  I can reproduce the error now.  I'm still not sure what is going on.

    Thanks and regards,

    -George

     

  • The problem is that BIOS and building with --exceptions does not work together.  The BIOS auto-generated linker command file contains the line ...

    -l rts64plus.lib

    Thus, regardless of whether you use --exceptions or not, that is the library which gets linked in.  For the --exceptions case, you need the library rts64plus_eh.lib instead.  I have not found a way configure BIOS so that line is not generated.  You can, however, change what library is used.  Modify your BIOS configuration as follows:

    System.Global Settings.Specify RTS library            TRUE
    System.Global Settings.Run Time Support Library       rts64plus_eh.lib

    And it will work.  I'll file something with the BIOS folks to get this issue addressed. 

    Thanks and regards,

    -George

     

     

  • Thanks, it works.

  • Georgem said:

    The problem is that BIOS and building with --exceptions does not work together.  The BIOS auto-generated linker command file contains the line ...

    -l rts64plus.lib

    Thus, regardless of whether you use --exceptions or not, that is the library which gets linked in.  For the --exceptions case, you need the library rts64plus_eh.lib instead.  I have not found a way configure BIOS so that line is not generated.  You can, however, change what library is used.  Modify your BIOS configuration as follows:

    System.Global Settings.Specify RTS library            TRUE
    System.Global Settings.Run Time Support Library       rts64plus_eh.lib

    And it will work.  I'll file something with the BIOS folks to get this issue addressed. 

    Thanks and regards,

    -George

     

     

     

    Hi George,

    I got the same errors, So  I want to modify my BIOS configuration ,but where to find this option. I'm a CCSv4 newbie.

    Thanks&regards.

  • Peter_nchu said:

    I got the same errors, So  I want to modify my BIOS configuration ,but where to find this option. I'm a CCSv4 newbie.

    Open your BIOS .tcf file. Expand System. Right-click on Global Settings and choose Properties. Check the box for "Specify RTS library" and specify the name of the runtime library in the "Run-time support library" field. This will force BIOS to use the specific library you specify instead of the default one it pulls in. You can double-check by looking at the BIOS generated .cmd file that the rts lib you specified is indeed the one linked in (look for a line like -l rts64plus_eh.lib).