[llvm] [CMake] Fix __builtin_thread_pointer check with LTO (PR #70968)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 4 16:27:16 PDT 2023


MaskRay wrote:

Alternative: `int main(void) { return (long)__builtin_thread_pointer(); }`

gcc lto seems smart enough to optimize out `int main(void) { return (long)__builtin_thread_pointer() && 0; }` and not emit an error.

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


More information about the llvm-commits mailing list