Skip to content
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

ld.bfd: ensure that ld.bfd is preferred over ld. #35674

Merged

Conversation

tejlmand
Copy link
Collaborator

Fixes: #32237

When building for native_posix, then host tools are used.
This means that gcc will link using /usr/bin/ld per default.

If ld points to lld, then linking will fail.

This commit will first look for ld.bfd, and if found then use
-fuse-ld=bfd for linking. If ld.bfd is not found, then ld is used as
fallback as that will be assumed to be the best working candidate.

Signed-off-by: Torsten Rasmussen Torsten.Rasmussen@nordicsemi.no

Fixes: zephyrproject-rtos#32237

When building for native_posix, then host tools are used.
This means that gcc will link using `/usr/bin/ld` per default.

If ld points to lld, then linking will fail.

This commit will first look for ld.bfd, and if found then use
-fuse-ld=bfd for linking. If ld.bfd is not found, then ld is used as
fallback as that will be assumed to be the best working candidate.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
@tejlmand tejlmand requested a review from nashif May 26, 2021 13:22
@tejlmand tejlmand added the bug The issue is a bug, or the PR is fixing a bug label May 26, 2021
@tejlmand tejlmand added this to the v2.6.0 milestone May 26, 2021
@galak galak merged commit 39f06e0 into zephyrproject-rtos:main May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

twister failing locally - fails to link native_posix w/lld
3 participants