Skip to content
Commit 2d78cb74 authored by Daniel Leung's avatar Daniel Leung Committed by Anas Nashif
Browse files

cmake: modules/FindGnuLd: cache variable GNULD_VERSION_STRING



This changes to cache variable GNULD_VERSION_STRING across cmake
runs. This variable is used to determine whether -Wl,-no-pie is
being passed to linker. However, if cmake is run multiple times
without clearing the build directory, GNULD_VERSION_STRING was
lost and the script falsely assumed the linker could not take
this argument, and thus omitting it during linking. Depending on
the host, it would warn on something like this:

  /usr/bin/ld.bfd: app/libapp.a(main.c.obj):
      warning: relocation in read-only section
      `.text._posix_zephyr_main'
  /usr/bin/ld.bfd: warning: creating DT_TEXTREL in a PIE

To fix this, simply caches GNULD_VERSION_STRING so it can be
used during subsequent cmake runs.

Fixes #61725

Signed-off-by: default avatarDaniel Leung <daniel.leung@intel.com>
parent 69643d57
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment