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 | 
ayou...@marvell.com<mailto:ayou...@marvell.com>
M A R V E L L   | www.marvell.com<http://www.marvell.com/>

Attachment: build.sh
Description: build.sh

Attachment: link.sh
Description: link.sh

Attachment: LinuxRvdsToolchain.cmake
Description: LinuxRvdsToolchain.cmake

Attachment: CMakeASM-RVDSInformation.cmake
Description: CMakeASM-RVDSInformation.cmake

Attachment: CMakeTestASM-RVDSCompiler.cmake
Description: CMakeTestASM-RVDSCompiler.cmake

Attachment: CMakeDetermineASM-RVDSCompiler.cmake
Description: CMakeDetermineASM-RVDSCompiler.cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to