Support CMake response file to enable linking many objects
Closed, ResolvedPublic

Description

Many link objects for linker would caused command line paramaters too much for command line prompt. In this case linker could extract parameters from files instead of command line.
CMake will switched into this mode if command line is too long for linker; and it calls the file holds link objects a response file.
Each linker has different switches for extracting info from response file; gcc uses "@" and armlink uses "--via=".
Enabled response file as default for linkers; and set flags correctly.

KenLSoft created this task.Sep 18 2018, 2:36 AM
KenLSoft triaged this task as Normal priority.

First:
I wonder what cmake version you used when testing this change. According to my investigations 3.7 and the up-to-date version works different. Also there is an open issue for ARMCLang and response files: See: https://gitlab.kitware.com/cmake/cmake/issues/18457
Please add some details about your tests.

Second:
Library generation is affected by the same issue (too long command lines). For this I have a preliminary fix which works with the currently only supported cmake version (3.7.x). I suggest including my changes and thus fixing the library generation behavior in the same patch too.

Hi Gyuri,
Version 3.7 won't report the issue in my side.

I think we need to update the about page since user may goes to the cmake download link directly and download latest cmake and ignores the hints for old releases.

Note: cmake release CMake 3.9.0-rc1 has an important bugfix for response file handling. Fixing this issue shall be done after build-system is updated to support latest cmake version. See T228.

As a workaround try to make the path shorter. I refer to the directory where the tf-m, the mbedtls and the CMSIS5 working copy is as "work root" hereafter.
For this on windows:

  • you can use the subst command map the work root to a drive letter.
  • use the mklink command to link (hard link or junction point) the work root into c:\

On Linux:

  • use a hard link to link the work root to /

A new patch has been provided, to avoid set response file as default:
https://review.trustedfirmware.org/c/trusted-firmware-m/+/925

KenLSoft closed this task as Resolved.Apr 30 2019, 2:22 AM