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

cmake: linker: lld: add missing -no-pie flag #51900

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/linker/lld/target_base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ macro(toolchain_ld_base)
# TOOLCHAIN_LD_FLAGS comes from compiler/clang/target.cmake
# LINKERFLAGPREFIX comes from linker/lld/target.cmake
zephyr_ld_options(
-no-pie
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think other linkers will need this also? Maybe it should be added to compiler/clang/target.cmake instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure. I basically copied it from https://github.com/zephyrproject-rtos/zephyr/blob/main/cmake/linker/ld/target_base.cmake#L14 to the same place for lld. But i think it would probably be good to align setting the "-no-pie" option for the compiler and linker in a similar way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks reasonable to me with the current macro based linker handling we have.

At some point we might we might want to align more to the compiler approach, as in #24851, but that's a different story.

${TOOLCHAIN_LD_FLAGS}
)

Expand Down