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.

TM4C1294NCPDT: compile the RTS in CCS, not the Makefile(mklib.exe)

Part Number: TM4C1294NCPDT


Tool/software:

I am using the tm4c1294X chip. I hope to single-step track the following process in CCS(i know using mklib tool to produce RTS lib is recommended ):
  1. Switch to user mode and set up the user mode stack.
  2. Set up status and configuration registers.
  3. Set up the stack.
  4. Process the special binit copy table, if present.
  5. Process the run-time initialization table to autoinitialize global variables (when using the --rom_model option).
  6. Call all global constructors.
  7. Call the function main.
  8. Call exit when main returns.

I hope to compile the entire rts with my program in CCS. I can use mklib.exe to build rtsv7M4_T_le_v4SPD16_xo_eabi.lib. When I copy all the files that generate rtsv7M4_T_le_v4SPD16_xo_eabi.lib and add them to the CCS project, and set up CCS according to the compilation and linking options in the Makefile, I find atomic.c(many founction are redefined) and debug.cpp have compiler errors. Therefore, I have two questions:

  1. Is it possible to compile the RTS in  CCS environment(let CCS produce the makefile) instead of using Makefile?
  2. If possible, can you provide a CCS project example or describe the specific compiler and linker option settings?


       My CCS is CCS1210

       the compiler flags:
-mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="D:/asmtest/tilibcworkspace/testlibc" --include_path="D:/asmtest/clib/src" --include_path="D:/asmtest/clib/src/AUTOSAR31" --include_path="D:/asmtest/clib/src/libcxx/include" --include_path="D:/asmtest/clib/src/libcxx/ext" --include_path="D:/asmtest/clib/src/libcxx/support" --include_path="D:/asmtest/clib/src/libcxx/support/runtime" --include_path="D:/asmtest/clib/src/libcxx/support/ti" --include_path="D:/asmtest/clib/src/machine" --include_path="D:/asmtest/clib/src/libcxx" --include_path="D:/asmtest/clib/src/sys" --include_path="D:/asmtest/clib/src/xlocale" --define=ccs="ccs" --define=PART_TM4C1294NCPDT -g --rtti --diag_warning=225 --diag_wrap=off --display_error_number --embedded_constants=off --abi=eabi

        the linker flags:

-mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --define=ccs="ccs" --define=PART_TM4C1294NCPDT -g --rtti --diag_warning=225 --diag_wrap=off --display_error_number --embedded_constants=off --abi=eabi -z -m"testlibc.map" --heap_size=0 --stack_size=512 --diag_wrap=off --display_error_number --warn_sections --xml_link_info="testlibc_linkInfo.xml" --rom_model


Thanks a lot.

  • This is simply a nightmare. I give up. Clearly, CCS12 was set up according to all the files and options in the mklib program and the Makefile in the src directory. However, there are still various errors. Compiling its own C library in CCS is too closely coupled with CCS itself. I originally thought that only the corresponding C, C++, and ASM files needed to be imported into CCS. Then, referring to the corresponding compilation and linking options in mklib and the Makefile to set up CCS,then all should be fine. Now i can say that it is almost an impossible task.

  • Is it possible to compile the RTS in  CCS environment(let CCS produce the makefile) instead of using Makefile?

    No one at TI has ever attempted it.  The only supported method is using mklib.

    Thanks and regards,

    -George

  • Hi, George,

    thanks very much for your replay, then when using mklib.exe, i got the custom rts lib(with the full debug info), in this way, can i still debug the rts lib at source code level step by step? 

  • I have tried, it is ok. Thanks again.

  • can i still debug the rts lib at source code level step by step?

    Your ability to do that has improved.  But because the code is optimized, expect some challenges along the way.  I don't know, in specific detail, what you might experience.  But you might see variables update at unexpected times, control may not pass through a function in the usual line by line manner, etc.  As long as your expectations are set correctly, I am confident you will be fine.

    Thanks and regards,

    -George

  • Yes,when using "-Ooff" flags in the Makefile,compile failed, then using "-O0", the RTS lib has been compiled successfully. I also notice that in compiler manaul, ti clang has three lib,libc for the C standard runtime feature, libc++abi and libc++,compiler-rt, only the first lib has the source, the other three libs have no source code within the ccs installation, am i right?

    Thanks

  • am i right?

    Yes.

    Note tiarmclang has no equivalent to mklib from the armcl compiler tools.

    Thanks and regards,

    -George