Skip to content

cmake: linker: separate toolchain_ld_options() calls for grouped flags #91515

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Fymyte
Copy link
Contributor

@Fymyte Fymyte commented Jun 12, 2025

Fixes #91045

Adding NO_SPLIT in the TOOLCHAIN_LD_FLAGS list caused every flags in the list to be checked together by the linker. This caused issues where incompatible flags was passed together, and the result was that none was propagated to the linker.

By using separate variables, we can achieve the initial goal of NO_SPLIT to only group a sub-set of flags.

@Fymyte
Copy link
Contributor Author

Fymyte commented Jun 18, 2025

Hi @tejlmand, does this fix seem ok to you ?

@Fymyte
Copy link
Contributor Author

Fymyte commented Jun 23, 2025

Sorry for the pings @nashif @tejlmand @stephanosio @nordicjm @57300, could you provide feedback on this ?

@Fymyte Fymyte force-pushed the toolchain-ld-flags branch from 39276db to 5c7c671 Compare June 26, 2025 07:40
@Fymyte
Copy link
Contributor Author

Fymyte commented Jun 26, 2025

I removed the surrounding if check for the existence of TOOLCHAIN_GROUPED_LD_FLAGS

@Fymyte
Copy link
Contributor Author

Fymyte commented Jul 2, 2025

Hi @tejlmand, I was wondering if someone could review this MR before the 4.2 release. The underlying issue prevents us from linking because the default -march/-mabi flags from the toolchain is not what we want, but this is what's get used by Zephyr rn.

@dkalowsk dkalowsk added this to the v4.2.0 milestone Jul 9, 2025
@Fymyte Fymyte closed this Jul 16, 2025
@Fymyte Fymyte reopened this Jul 16, 2025
@danieldegrasse danieldegrasse removed this from the v4.2.0 milestone Jul 21, 2025
Fixes zephyrproject-rtos#91045

Adding NO_SPLIT in the TOOLCHAIN_LD_FLAGS list caused every flags in the
list to be checked together by the linker. This caused issues where
incompatible flags was passed together, and the result was that none was
propagated to the linker.

By using separate variables, we can achieve the initial goal of NO_SPLIT to
only group a sub-set of flags.

Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
@Fymyte Fymyte force-pushed the toolchain-ld-flags branch from 5c7c671 to 055a7e3 Compare July 24, 2025 08:49
@Fymyte
Copy link
Contributor Author

Fymyte commented Jul 24, 2025

Rebased and fixed conflicts

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TOOLCHAIN_LD_FLAGS setting of -mabi/-march aren't propagated to linker invocation on RISC-V
4 participants