fix(cmake): drop -pie from global link options#50
fix(cmake): drop -pie from global link options#50hillwoodroc wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
-pie forces building PIE executables and breaks shared library linking on ppc64le, resulting in undefined reference to main.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hillwoodroc The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @hillwoodroc. Thanks for your PR. 😃 |
|
Hi @hillwoodroc. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| # 安全编译选项 | ||
| add_compile_options(-fstack-protector-strong -D_FORTITY_SOURCE=1) | ||
| add_link_options(-z noexecstack -pie -fPIC) | ||
| add_link_options(-z noexecstack -fPIC) |
There was a problem hiding this comment.
This compilation parameter is required for security purposes.
There was a problem hiding this comment.
If the architecture for this parameter cannot be found, isolation is recommended.
There was a problem hiding this comment.
-pie is specifically used for generating executables; since this is merely a shared library, there is no need to use this parameter.
Refer:https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html?hl=zh-CN
--pie
Produce a dynamically linked position independent executable on targets that support it. For predictable results, you must also specify the same set of options used for compilation (-fpie, -fPIE, or model suboptions) when you specify this linker option.
There was a problem hiding this comment.
The parameters for fpic do seem incorrect; it's recommended to remove this unnecessary parameter. pie is indeed necessary.
There was a problem hiding this comment.
-pie forces building PIE executables and breaks shared library linking on ppc64le, resulting in undefined reference to main.