[PATCH] D119695: [Support] Fix build on illumos

Joshua M. Clulow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 15 20:26:00 PST 2022


jclulow added inline comments.


================
Comment at: llvm/lib/Support/Unix/Path.inc:121
 
+#if defined(__sun__)
+// The madvise() declaration on Illumos cannot be made visible if _XOPEN_SOURCE
----------------
ro wrote:
> The canonical way to check for Solaris/Illumos is `defined(__sun__ && defined(__svr4__)`.
> 
> As issues like this don't come up for the first time, it would be extremely helpful if Illumos would provide a predefine to support that, something like `__illumos__` or whatever the community sees fit.
We are part way through making that happen with [13726 distinguish ourselves
with a macro](https://www.illumos.org/issues/13726).  Indeed, the definition is already exposed by GCC 10.X, the default compiler shipped with OmniOS r151038 LTS systems (a popular distribution):

```
$ head -1 /etc/release
  OmniOS v11 r151038ag
$ gcc --version | head -1
gcc (OmniOS 151038/10.3.0-il-1) 10.3.0
$ gcc -E - <<< 'is this __illumos__?' | tail -1
is this 1?
```

We do still need to circle back around and get a fallback definition added to a core header file -- but we're definitely committed to `__illumos__` and you should be able to start using it.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119695/new/

https://reviews.llvm.org/D119695



More information about the llvm-commits mailing list