Page MenuHomePhabricator

Update build system to support latest cmake version.
Closed, ResolvedPublic

Description

Currently the build system only supports cmake version 3.7. This is a problem because:

  • 3.7 is an old version and this makes life of Linux and OSX users harder.
      • Linux distros come with newer versions put into the package repositories:
        • Ubuntu 18.04: 3.10
        • Ubuntu 18.10: 3.12
        • Ubuntu devel: 3.13
      • Zephyr uses chocolatey on windows which has v3.13.3
      • OSX homebrew seems to have 3.13
    • 3.7 uses an outdated version of "response file" support. This makes fixing T95 problematic.

As a result of the above the build system shall be updated to support cmake 3.10->3.13.

Event Timeline

After extensive testing no blocking issues could be identified and this effort turned to be a documentation update. See https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/661/
All mentioned cmake versions work fine win the build-system..

Hi Gyuri,
I saw the document update patch, but cmake 3.10 still fails in my side. Which means the document is updated first before cmake change?
Thanks.

Hi,

In my test environment I could not re-create any failure. Can you please provide more details about your case?

/George

Hi,
I am using ARMCLANG build on AN521, with latest master branch:

https://git.trustedfirmware.org/trusted-firmware-m.git/commit/?h=refs/heads/master&id=807fedbb8070b6d735e1c9e2103e6c1ea632fe8c

Sources cloned at:

c:/Users/username/git/tfm-internal/

Cmake version:

$ cmake --version
cmake version 3.12.4

Build command (in DS5):

cmd /C cmake -E remove_directory build & cmake -E make_directory build & cd build & cmake -G"Unix Makefiles" -DPROJ_CONFIG=c:/Users/username/git/tfm-internal/ConfigCoreIPC.cmake -DCMAKE_BUILD_TYPE=Debug -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG ../
cmake --build ./build -- install

Remember to use ConfigCoreIPC.cmake

Hi,

and what error do you get?

/George

Fatal error: L6002U: Could not open file @CMakeFiles/tfm_s.dir/objects1.rsp: No such file or directory
Finished: 0 information, 0 warning, 0 error and 1 fatal error messages.
make.exe[2]: *** [app/secure_fw/CMakeFiles/tfm_s.dir/build.make:167: app/secure_fw/tfm_s.axf] Error 1
make.exe[1]: *** [CMakeFiles/Makefile2:252: app/secure_fw/CMakeFiles/tfm_s.dir/all] Error 2
make.exe: *** [Makefile:118: all] Error 2

The response file problem is another ticket. See https://developer.trustedfirmware.org/T95

Does it mean that patches mentioned in T95 could be merged?

No. T95 needs deeper investigation to check what cmake version the fix supports and if all aspects are addressed. Response files not only affect the linker but the archiver too.
There was an important bugfix for response file handling merged into cmake 3.9 so we might need to drop support for anything below 3.10.

gyuri-szing closed this task as Resolved.Apr 3 2019, 2:18 PM

Turned to be a documentation update task. Fixed in https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/661/ .

CJKay added a subscriber: CJKay.EditedDec 4 2019, 12:31 AM

Snapcraft distributes builds for the latest stable versions of CMake: https://snapcraft.io/cmake

Perhaps consider recommended it be installed through that? On Ubuntu it is as simple as sudo snap install cmake --classic.

In T228#6978, @CJKay wrote:

Snapcraft distributes builds for the latest stable versions of CMake: https://snapcraft.io/cmake

Perhaps consider recommended it be installed through that? On Ubuntu it is as simple as sudo snap install cmake --classic.

Thanks for the info. Cmake is available from may different sources and we shall stick with the one being the most native to the host OS. This way we can use the OS integrators invested work and get a more stable experience. For example cmake built for cygwin works different than the native windows or the msys/mingw executable.

This page lists cmake versions available in different Linux distributions.
https://gitlab.kitware.com/cmake/community/-/wikis/CMake-Versions-on-Linux-Distros