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.

Compiler/CC2538: --wchar_t

Part Number: CC2538

Tool/software: TI C/C++ Compiler

I'm just going to describe the simplest example. If I create a new project, choose cc2538SF for the chip with the hello world template, then change the --wchar_t to 32 in the run time model options, I'm getting errors such as undefined symbol __STACK_SIZE.

How are we suppose to change  --wchar_t to 32 without getting errors?

  • Thank you for reporting this problem.  I can reproduce the same result.  Here is a way to see the problem when building from the command line ...

    % armcl --silicon_version=7m3 --endian=little --code_state=16 hello.c --wchar_t=32 -z -o hello.out
    <Linking>
    warning: automatic RTS selection:  could not resolve index library "libc.a" to
       a compatible library
    error: no input section is linked in
    warning: entry-point symbol "_c_int00" undefined
    warning: no suitable entry-point found; setting to 0
    error: errors encountered during linking; "hello.out" not built
    
    >> Compilation failure

    A new RTS library should be built that supports --wchar_t=32.  But that does not happen.  I don't know why.  So filed the entry CODEGEN-6665 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • I presume your actual application program uses some of the wchar_t functions in the RTS library, and needs those functions to operate on a 32-bit wide wchar_t type.

    It turns out an RTS library that supports 32-bit wchar_t is considered a custom RTS library, and you have to build such a library yourself.  Please search the ARM compiler manual for the sub-chapter titled Library-Build Process.  Focus on the sub-sub-chapter titled Building Libraries With Custom Options.  In your case, a command similar to this one will build the needed library ...

    mklib.exe --pattern=rtsv7M3_T_le_eabi.lib --name=rtsv7M3_wchar32_T_le_eabi.lib --install_to=\some\path\here --extra_options="--wchar_t=32"

    Thanks and regards,

    -George