Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

We do not gain any additional security from having PIE on the test binaries, and this does have an impact on test times. It is about 10% from my measurements. Not as much as previous reports (https://reviews.llvm.org/D140880), but still significant. This is a similar gain to finish enabling the lit internal shell, which will take significantly more effort. I also do not think this is a meaningful enough difference from the "default" configuration to keep it the default, especially given the option is mostly set by distros.

We do not gain any additional security from having PIE on the test
binaries, and this does have an impact on test times. It is about 10%
from my measurements. Not as much as previous reports
(https://reviews.llvm.org/D140880), but still significant. This is a
similar gain to finish enabling the lit internal shell, which will take
significantly more effort.
@cmtice
Copy link
Contributor

cmtice commented Aug 20, 2025

This seems reasonable to me, but I would prefer a second opinion on this?

@dschuff
Copy link
Member

dschuff commented Aug 21, 2025

I think this is pretty reasonable. PIE improves ASLR, reducing the ability of a binary to be exploited, but for PRs, people can write whatever code they want into LLVM and we will happily compile and execute it :D
So if there's a performance win, LGTM

@dschuff
Copy link
Member

dschuff commented Aug 21, 2025

We might even consider doing this in CMake. I'd probably use it on our CI if we had it.

@boomanaiden154
Copy link
Contributor Author

We might even consider doing this in CMake. I'd probably use it on our CI if we had it.

What do you mean do this in CMake? As in add an additional flag? In https://reviews.llvm.org/D140880 the consensus seemed to be that having a flag doesn't make a lot of sense because it's more complexity in the CMake for about the same number of characters as explicitly setting CMAKE_EXE_LINKER_FLAGS.

@boomanaiden154 boomanaiden154 merged commit 0319a79 into llvm:main Aug 21, 2025
11 checks passed
@boomanaiden154 boomanaiden154 deleted the premerge-disable-pie-linux branch August 21, 2025 17:21
@dschuff
Copy link
Member

dschuff commented Aug 21, 2025

Ah yeah I didn't actually read the discussion there. makes sense, and it's easy enough to just do ourselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants