-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
-Db_pie=false builds executables with PIE enabled #10885
Comments
Ok, after a huge amount of headache, I've discovered that explicitly passing |
If you could look at submitting a PR, that would be great! |
I feel like this came up previously in another issue and it was determined that Meson didn't pass -fno-pie if the toolchain was pie by default. Can't remember |
I haven't contributed to meson before so it'll take me a bit to figure out where the relevant code is, but I'd like to help fix it :) |
The b_pie argument is a boolean, and currently treated as "should Meson explicitly enable pie" rather than "determine whether the resulting binary is pie, regardless of compiler defaults". Changing this into a tristate option is a topic that has come up before, I think.
It's handled in the function
In mesonbuild/backend/, particularly in:
|
Duplicate of #4651? |
Yes, it’s a duplicate. I plan to fix this after my major rework of the build layer is done, so it’s on the radar |
Describe the bug
When trying to build my project to generate no-pie executables by passing
-Db_pie=false, executables are still built with PIE enabled.
Repro is at the bottom, but with the same meson version:
To Reproduce
The affected project is here: https://github.com/novafacing/cgc-challenges
Building it with the following steps exhibits the issue:
And the problematic result:
Expected behavior
I expect executables to be built with the
-no-pie
flag when-Db_pie=false
.system parameters
Below is a dockerfile to reproduce this issue. The reelvant versions in the
container are:
Here is a minimal Dockerfile to reproduce the issue, which
can be repro'd with:
The text was updated successfully, but these errors were encountered: