Skip to content

CMake: append to LINK_FLAGS instead of replacing them #1646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2021

Conversation

Xiretza
Copy link
Contributor

@Xiretza Xiretza commented Jan 28, 2021

Description

With INTERPROCEDURAL_OPTIMIZATION/LTO enabled, LDFLAGS from the environment are ignored.

Related Issue

N/A

Motivation and Context

CMake takes the default linker flags from the LDFLAGS environment variable and initializes the targets' LINK_FLAGS with it. If set_target_property() is used to overwrite a target's LINK_FLAGS, these initial linker flags from the environment are lost.

How Has This Been Tested?

$ env LDFLAGS=-Wl,-z,relro cmake -B build -S . -DVTR_IPO_BUILD=on
$ grep relro build/vpr/CMakeFiles/vpr.dir/link.txt

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@github-actions github-actions bot added blifexplorer external_libs libarchfpga Library for handling FPGA Architecture descriptions Odin Odin II Logic Synthesis Tool: Unsorted item VPR VPR FPGA Placement & Routing Tool labels Jan 28, 2021
@Xiretza Xiretza force-pushed the append-link-flags branch from 6e2f39e to b35fcfc Compare May 27, 2021 19:39
@vaughnbetz vaughnbetz merged commit 3509472 into verilog-to-routing:master May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blifexplorer external_libs libarchfpga Library for handling FPGA Architecture descriptions Odin Odin II Logic Synthesis Tool: Unsorted item VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants