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