[CMake] Support for RVDS 4.1: ARM C/C++ and ASM compilers.

Abdelrazak Younes ayounes at marvell.com
Thu Dec 8 05:34:14 EST 2011


Hello,

We (MARVELL Switzerland) have created some CMake support files in order to use RVDS 4.1 ARM C/C++ and ASM compilers.

What works:

* The ASM compilation works just fine, except for <FLAGS>, we don't know how to use that so we just hardcoded the flags in the CMakeASM-RVDSInformation.cmake file.

* The C and C++ compilation and static libraries generation work with one caveat: we hardcoded "armar" in CMAKE_C_CREATE_STATIC_LIBRARY and CMAKE_CXX_CREATE_STATIC_LIBRARY because setting CMAKE_AR doesn't work for us.

What doesn't work:

* We cannot use armcc for linking because we need to  use a scatter file for memory and this requires using armlink. Unfortunately, setting CMAKE_CXX_LINK_EXECUTABLE doesn't work for us because:
1) we did not find how to set the arguments of armlink correctly
2) armlink requires an object file as first input, giving only static libraries doesn't work

So, as a workaround, we install our static libraries in a dedicated "archive" folder and we use a build script for the final linking step thanks to a custom target:

  file(GLOB archives ${CMAKE_BINARY_DIR}/archive/*.a)

  add_custom_target(fw ${CMAKE_SOURCE_DIR}/../cmake/link.sh ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}
                    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/archive)

I also attach our build script for reference.

This works for us but obviously is far from optimal. So we are contributing this in the hope that it is useful to you and also that it can be improved. If some CMake developer can help us improve this, we would be happy to test and help of course.

Thanks in advance and regards,
Abdel

Abdelrazak Younes | Marvell Switzerland SARL - Etoy
Office +41 21 821 0086 | Fax +41 21 612 8052 | ayounes at marvell.com<mailto:ayounes at marvell.com>
M A R V E L L   | www.marvell.com<http://www.marvell.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111208/d05d2efb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.sh
Type: application/octet-stream
Size: 158 bytes
Desc: build.sh
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111208/d05d2efb/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: link.sh
Type: application/octet-stream
Size: 412 bytes
Desc: link.sh
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111208/d05d2efb/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LinuxRvdsToolchain.cmake
Type: application/octet-stream
Size: 1130 bytes
Desc: LinuxRvdsToolchain.cmake
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111208/d05d2efb/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeASM-RVDSInformation.cmake
Type: application/octet-stream
Size: 243 bytes
Desc: CMakeASM-RVDSInformation.cmake
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111208/d05d2efb/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeTestASM-RVDSCompiler.cmake
Type: application/octet-stream
Size: 72 bytes
Desc: CMakeTestASM-RVDSCompiler.cmake
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111208/d05d2efb/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeDetermineASM-RVDSCompiler.cmake
Type: application/octet-stream
Size: 127 bytes
Desc: CMakeDetermineASM-RVDSCompiler.cmake
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111208/d05d2efb/attachment-0005.obj>


More information about the CMake mailing list