Skip to content

[sanitizer_common] Remove <procfs.h> workaround on Solaris #142758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rorth
Copy link
Collaborator

@rorth rorth commented Jun 4, 2025

sanitizer_procmaps_solaris.cpp currently uses #undef _FILE_OFFSET_BITS to hack around the fact that old versions of Solaris <procfs.h> don't work in a largefile environment:

/usr/include/sys/procfs.h:42:2: error: #error "Cannot use procfs in the large file compilation environment"
   42 | #error  "Cannot use procfs in the large file compilation environment"
      |  ^~~~~

However, this is no longer an issue on either Solaris 11.4 or Illumos. The workaround only existed for the benefit of Solaris 11.3. While that had never been supported by LLVM, the sanitizer runtime libs were imported into GCC's libsanitzer. With the removal of Solaris 11.3 support in GCC 15, this is no longer an issue and the workaround can be removed.

Tested on amd64-pc-solaris2.11 and sparcv9-sun-solaris2.11.

`sanitizer_procmaps_solaris.cpp` currently uses `#undef _FILE_OFFSET_BITS`
to hack around the fact that old versions of Solaris `<procfs.h>` don't
work in a largefile environment:

```
/usr/include/sys/procfs.h:42:2: error: #error "Cannot use procfs in the large file compilation environment"
   42 | #error  "Cannot use procfs in the large file compilation environment"
      |  ^~~~~
```

However, this is no longer an issue on either Solaris 11.4 or Illumos.  The
workaround only existed for the benefit of Solaris 11.3.  While that had
never been supported by LLVM, the sanitizer runtime libs were imported into
GCC's `libsanitzer`.  With the removal of Solaris 11.3 support in GCC 15,
this is no longer an issue and the workaround can be removed.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Rainer Orth (rorth)

Changes

sanitizer_procmaps_solaris.cpp currently uses #undef _FILE_OFFSET_BITS to hack around the fact that old versions of Solaris &lt;procfs.h&gt; don't work in a largefile environment:

/usr/include/sys/procfs.h:42:2: error: #error "Cannot use procfs in the large file compilation environment"
   42 | #error  "Cannot use procfs in the large file compilation environment"
      |  ^~~~~

However, this is no longer an issue on either Solaris 11.4 or Illumos. The workaround only existed for the benefit of Solaris 11.3. While that had never been supported by LLVM, the sanitizer runtime libs were imported into GCC's libsanitzer. With the removal of Solaris 11.3 support in GCC 15, this is no longer an issue and the workaround can be removed.

Tested on amd64-pc-solaris2.11 and sparcv9-sun-solaris2.11.


Full diff: https://github.com/llvm/llvm-project/pull/142758.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp (-3)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
index 80b8158f43db9..452b30308be91 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp
@@ -9,9 +9,6 @@
 // Information about the process mappings (Solaris-specific parts).
 //===----------------------------------------------------------------------===//
 
-// Before Solaris 11.4, <procfs.h> doesn't work in a largefile environment.
-#undef _FILE_OFFSET_BITS
-
 // Avoid conflict between `_TIME_BITS` defined vs. `_FILE_OFFSET_BITS`
 // undefined in some Linux configurations.
 #undef _TIME_BITS

@rorth rorth merged commit 70fce92 into llvm:main Jun 5, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants