[clang] [Driver,sanitizer] Remove RequiresPIE and msan's NeedPIE setting (PR #77689)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 11:31:49 PST 2024


MaskRay wrote:

> @MaskRay I see that in [3bbc912](https://github.com/llvm/llvm-project/commit/3bbc912d37f03d9ad3be330b81d91c2eaf6c37f2) you removed some tests that fail because of this change. Why do you think that is an appropriate solution? I have some other tests in a downstream product that are failing because we build with CLANG_DEFAULT_PIE_ON_LINUX=OFF. You said in your initial comment here that "most builds set CLANG_DEFAULT_PIE_ON_LINUX to 1, making RequiresPIE/NeedPIE redundant on Linux." But apparently it's not redundant for builds that don't use that setting.
> 
> Do you have another solution in progress (or already committed that I haven't seen yet)? It seems that as long as this is a configurable option, we need to support both settings. Intel's SYCL project ([intel/llvm](https://github.com/intel/llvm)) currently sets CLANG_DEFAULT_PIE_ON_LINUX to zero for compatibility with gcc in Fedora releases (at least, I think that's the reason).

My internal users also use `CLANG_DEFAULT_PIE_ON_LINUX OFF`, so I definitely want to support both flavors.

The RUN lines removed by 3bbc912 no longer made sense (the commit message could have been reworded). They wanted to check that we defaulted to `-fPIE` even when no `-fno-pic/-fpie/-fpic` was specified. The force-PIC effect might be a previous limitation, or possibly just something cargo culted from the previous msan limitation.

If I use `scudo_flags = ["-fsanitize=scudo", "-fno-pic", "-no-pie"]` in `test/scudo/lit.cfg.py`, `check-scudo_standalone` still passes.

https://github.com/llvm/llvm-project/pull/77689


More information about the cfe-commits mailing list