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
Native Executable --no-pie #33524
Comments
This isn't entirely true - here is the code that decides whether the flag should be added or not: boolean isContainerBuild = nativeImageRunner.isContainerBuild();
if (!isContainerBuild && SystemUtils.IS_OS_LINUX) {
noPIE = detectNoPIE();
}and private static String detectNoPIE() {
String argument = testGCCArgument("-no-pie");
return argument.length() == 0 ? testGCCArgument("-nopie") : argument;
}
private static String testGCCArgument(String argument) {
try {
Process gcc = new ProcessBuilder("cc", "-v", "-E", argument, "-").start();
gcc.getOutputStream().close();
if (gcc.waitFor() == 0) {
return argument;
}
} catch (IOException | InterruptedException e) {
// eat
}
return "";
} |
|
I'll leave this one up to @zakkak to decide if there is anything we need to do in Quarkus |
|
@brunocaballero you should be able to override the |
|
no change, because is always added at the end of the linker command |
|
I was able to generate an application and run it on the target by keeping the temporary files of the build process and repeating the linker command without the I think you should add an option in order to make optional generating a no PIE binary., becuase PIE binaries are more secure. Is there a reason why you are disabling it? |
AFAIK the reason we don't want it enabled by default is performance, see https://www.redhat.com/en/blog/position-independent-executable-pie-performance
I see, that's because
I agree. |
|
I started a discussion on how to approach this in https://groups.google.com/g/quarkus-dev/c/8v20Edl5nl8/m/iGegsIA_CwAJ |
|
@brunocaballero can you give examples of which system configurations you are thinking about preferring pie? (not doubting they exist, just wondering if something specific about it. |
|
Android 5.0 and later only support position-independent executables. |
|
You plan to use Quarkus on Android? |
|
Android has all kinds of fun. |
@brunocaballero was in last year's GraalVM Community Meetup in Zurich, they help people run JVM and GraalVM in lesser known/used platforms. |
|
Very cool |
|
@brunocaballero FYI PR: #33931 |
|
Thanks a lot! |
Describe the bug
By default, the linker option
-H:NativeLinkerOption=-no-pieis used when building a native image with Quarkus.Please make this option configurable
Expected behavior
Some operating system configuration expects binaries to be PIE.
Actual behavior
_No respon
How to Reproduce?
Follow the instructions on
https://quarkus.io/guides/building-native-imageOutput of
uname -aorver6.1.0-8-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.25-1 (2023-04-22) x86_64 GNU/Linux
Output of
java -version17.0.7-release+8
GraalVM version (if different from Java)
22.3
Quarkus version or git rev
3.0.3.Final
Build tool (ie. output of
mvnw --versionorgradlew --version)3.8.7
Additional information
No response
The text was updated successfully, but these errors were encountered: