[llvm] [Bazel] Define BUILTIN_THREAD_POINTER where appropriate on x86-64 linux (PR #74574)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 6 13:14:20 PST 2023
boomanaiden154 wrote:
> I guess in general this does require a configure check, since GCC __has_builtin returns true for this, but then errors out during code generation: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96952#c2
Right. Originally it was a `__has_builtin` check, but the broke specific platforms with older gcc versions due to the linked bug.
> We should have to replicate knowledge of which targets GCC supports this builtin on in order to forego the configure check.
Are you suggesting to do this through Bazel or still suggesting to sink it into the `BenchmarkRunner.cpp` file? I'd like to avoid changes there if possible as I believe the CMake check is a better solution than replicating that information with preprocessor macros.
Is there a way to easily do this in bazel?I saw https://github.com/llvm/llvm-project/blob/main/utils/bazel/llvm-project-overlay/llvm/config.bzl which seems like the place to put this, but I didn't find any way to select based on compiler version, which is critical to actually getting this to work (at least if we want to do it through Bazel).
https://github.com/llvm/llvm-project/pull/74574
More information about the llvm-commits
mailing list