This speeds up lit testing on systems where the host toolchain enables
PIE by default. For example on my Ubuntu 22.04 system, using the host's
default clang and lld, this speeds up check-llvm by around 1.75x.
Details
- Reviewers
- None
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you elaborate on the scope of what builds this change touches in the commit description?
I think we should do this, but there should probably be a build option to use the default behavior or an explicit use PIE
You probably want https://cmake.org/cmake/help/v3.16/module/CheckPIESupported.html
That being said, i don't think this can be just set, at best it should be hidden under an opt-in flag.
That being said, i don't think this can be just set, at best it should be hidden under an opt-in flag.
I don't think there's much point doing this at all if it's opt-in. If you already know that you're suffering from a slow development cycle due to PIE, you might as well just type cmake -DCMAKE_EXE_LINKER_FLAGS=-no-pie. The idea of doing by default was to fix the problem for developers who didn't even know they had the problem.
There is a point because it requires I know the flag for this, the cmake flag for this, and need to know I should think about this in the first place. This should be an option prominently advertised in the llvm cmake usage documentation and put in the developer guide
Right. I get that. The problem is that this *is* going to affect everyone,
including distributions, that wanted PIE to be the default in the first place.
So once again, i don't think that's generally viable.
There is a point because it requires I know the flag for this, the cmake flag for this, and need to know I should think about this in the first place. This should be an option prominently advertised in the llvm cmake usage documentation and put in the developer guide
My point was that an off-by-default flag would not help you "to know I should think about this in the first place". But it hadn't occurred to me that we could document it, and people would actually read that. :-)
The problem is that this *is* going to affect everyone, including distributions, that wanted PIE to be the default in the first place.
I accept that there is probably conflict between what developers want and what distributors want. This patch was my way of voting for the developers. :-)
We probably should have an example "this is the set of flags you actually want" there too. I spent way too much time when I'm on a new system figuring out the full set of LLVM_USE_LINKER=lld and the link threads options and all the others you need for fast builds