-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add optional native flag to build PIE binaries #33931
Conversation
This comment has been minimized.
This comment has been minimized.
The JVM test failure is unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a suggestion and in any case could you squash the commits?
@@ -198,6 +198,11 @@ public interface NativeConfig { | |||
*/ | |||
Optional<Boolean> containerBuild(); | |||
|
|||
/** | |||
* Explicit configuration option to generate PIE native binaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand when PIE will be enabled, especially when this is not set. I think we should make it more explicit in the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, other than the documentation part (see my suggestion)
@@ -198,6 +198,11 @@ public interface NativeConfig { | |||
*/ | |||
Optional<Boolean> containerBuild(); | |||
|
|||
/** | |||
* Explicit configuration option to generate PIE native binaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @gsmet that a more explicit (and consistent with the rest) documentation is needed.
* Explicit configuration option to generate PIE native binaries. | |
* If this build should build a Position Independent Executable (PIE). Not setting the option results in using the | |
* underlying system's defaults. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't find the doc clear enough. Added some suggestions.
@@ -198,6 +198,15 @@ public interface NativeConfig { | |||
*/ | |||
Optional<Boolean> containerBuild(); | |||
|
|||
/** | |||
* Explicit configuration option to generate Position Independent Executable (PIE) native executables for Linux. | |||
* If the system supports, the default behaviour is to generate native binaries without PIE for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the system supports what?
I suggest:
* If the system supports, the default behaviour is to generate native binaries without PIE for | |
* If the system we are building on supports PIE generation, the default behaviour is to disable it |
@@ -198,6 +198,15 @@ public interface NativeConfig { | |||
*/ | |||
Optional<Boolean> containerBuild(); | |||
|
|||
/** | |||
* Explicit configuration option to generate Position Independent Executable (PIE) native executables for Linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid redundant "executable":
* Explicit configuration option to generate Position Independent Executable (PIE) native executables for Linux. | |
* Explicit configuration option to generate a native Position Independent Executable (PIE) for Linux. |
* Some systems only support PIE executables, | ||
* so this option offers the opportunity to generate native executables with PIE instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid redundant "executable" and reduce words:
* Some systems only support PIE executables, | |
* so this option offers the opportunity to generate native executables with PIE instead. | |
* Some systems, however, only support platform independent executables (PIEs), | |
* this option enables the generation of such native executables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't see the need to introduce again what is a PIE.
This comment has been minimized.
This comment has been minimized.
Pushed another round of updates for the PIE option javadoc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @galderz
This comment has been minimized.
This comment has been minimized.
680b1a0
to
df25342
Compare
Thx @zakkak. Squashed the commits and pushed. |
This comment has been minimized.
This comment has been minimized.
df25342
to
c83272a
Compare
Rebased to resolve conflict. Can someone integrate this? |
@galderz do you think it's worth backporting to 3.2? |
@zakkak Yeah I think it's worth it. I'll send a PR for it. |
See #34944 for the 3.2.x backport. |
I added the |
Closes #33524. Adds
quarkus.native.pie
configuration option. Usage and verification:Compared with:
Commits need squashing once review passes.
@zakkak is away so maybe @Karm or @jerboaa can review?