Skip to content

Conversation

@rorth
Copy link
Collaborator

@rorth rorth commented Jun 2, 2025

openmp currently doesn't compile on 32-bit Solaris:

FAILED: projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_util.cpp.o
[...]
In file included from openmp/runtime/src/z_Linux_util.cpp:78:
In file included from /usr/include/libproc.h:25:
In file included from /usr/include/gelf.h:10:
/usr/include/libelf.h:22:2: error: "large files are not supported by libelf"
   22 | #error "large files are not supported by libelf"
      |  ^
In file included from openmp/runtime/src/z_Linux_util.cpp:78:
/usr/include/libproc.h:42:2: error: "Cannot use libproc in the large file compilation environment"
   42 | #error "Cannot use libproc in the large file compilation environment"
      |  ^

Looking closer, there's no point in using Pgrab (the only interface from <libproc.h>) at all: the resulting ps_prochandle_t * isn't used in the remainder of the code and the original PR #82930 gives no indication why it is deemed necessary/useful.

While at it, this patch switches to use /proc/self/xmap, matching compiler-rt's sanitizer_procmaps_solaris.cpp, and makes some minor formatting fixes.

Tested on sparc-sun-solaris2.11, sparcv9-sun-solaris2.11, i386-pc-solaris2.11, and amd64-pc-solaris2.11.

`openmp` currently doesn't compile on 32-bit Solaris:

```
FAILED: projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_util.cpp.o
[...]
In file included from openmp/runtime/src/z_Linux_util.cpp:78:
In file included from /usr/include/libproc.h:25:
In file included from /usr/include/gelf.h:10:
/usr/include/libelf.h:22:2: error: "large files are not supported by libelf"
   22 | #error "large files are not supported by libelf"
      |  ^
In file included from openmp/runtime/src/z_Linux_util.cpp:78:
/usr/include/libproc.h:42:2: error: "Cannot use libproc in the large file compilation environment"
   42 | #error "Cannot use libproc in the large file compilation environment"
      |  ^
```

Looking closer, there's no point in using `Pgrab` (the only interface from
`<libproc.h>`) at all: the resulting `ps_prochandle_t *` isn't used in the
remainder of the code and the original PR llvm#82930 gives no indication why it
is deemed necessary/useful.

While at it, this patch switches to use `/proc/self/xmap`, matching
`compiler-rt`'s `sanitizer_procmaps_solaris.cpp`, and makes some minor
formatting fixes.

Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`,
`i386-pc-solaris2.11`, and `amd64-pc-solaris2.11`.
@llvmbot llvmbot added the openmp:libomp OpenMP host runtime label Jun 2, 2025
@rorth rorth merged commit ba4f140 into llvm:main Jun 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

openmp:libomp OpenMP host runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants