[all-commits] [llvm/llvm-project] e71c8e: [Driver] Fix _XOPEN_SOURCE definition on Solaris (...
Rainer Orth via All-commits
all-commits at lists.llvm.org
Sat Apr 26 08:06:26 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e71c8ea3cc73c8f7b0382468f355a254166d3a72
https://github.com/llvm/llvm-project/commit/e71c8ea3cc73c8f7b0382468f355a254166d3a72
Author: Rainer Orth <ro at gcc.gnu.org>
Date: 2025-04-26 (Sat, 26 Apr 2025)
Changed paths:
M clang/lib/Basic/Targets/OSTargets.h
Log Message:
-----------
[Driver] Fix _XOPEN_SOURCE definition on Solaris (#137141)
Since commit 613a077b05b8352a48695be295037306f5fca151, `flang` doesn't
build any longer on Solaris/amd64:
```
flang/lib/Evaluate/intrinsics-library.cpp:225:26:
error: address of overloaded function 'acos' does not match required type '__float128 (__float128)'
225 | FolderFactory<F, F{std::acos}>::Create("acos"),
| ^~~~~~~~~
```
That patch led to the version of `quadmath.h` deep inside `/usr/gcc/<N>`
to be found, thus `HAS_QUADMATHLIB` is defined. However, the `struct
HostRuntimeLibrary<__float128, LibraryVersion::Libm>` template is
guarded by `_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600`, while
`clang` only predefines `_XOPEN_SOURCE=500`.
This code dates back to commit 0c1941cb055fcf008e17faa6605969673211bea3
back in 2012. Currently, this is long obsolete and `gcc` prefefines
`_XOPEN_SOURCE=600` instead since GCC 4.6 back in 2011.
This patch follows that.
Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list