Commit 22e6d59
authored
Fix manylinux1 build: O_CLOEXEC fallback in getauxval shim (#3268)
### Description of changes:
The `/proc/self/auxv` fallback added in #3250 unconditionally references
`O_CLOEXEC`, which breaks the build on manylinux1 (CentOS 5, glibc 2.5).
`O_CLOEXEC` was introduced in Linux 2.6.23 / glibc 2.7 (Oct 2007), so
it's absent from manylinux1's `<fcntl.h>`.
Defining `O_CLOEXEC` to `0` when not provided is sufficient. In this
fallback path the fd is opened, read, and closed synchronously inside
`getauxval()` with no intervening `fork()`, so the close-on-exec
semantics aren't security-relevant here — it's purely a syntactic
dependency.
### Call-outs:
manylinux1 is exactly the environment that should land on this fallback
path: it doesn't ship `<sys/auxv.h>`, so `__has_include` correctly
steers it into the `/proc/self/auxv` reader. The bug is just that the
reader itself wasn't quite portable enough.
### Testing:
Existing CI exercises both code paths via
`OPENSSL_GETAUXVAL_FORCE_PROC_FALLBACK`. Locally verified that the
fallback compiles cleanly with `O_CLOEXEC` undefined (simulating the
manylinux1 condition).
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.1 parent 958a4d4 commit 22e6d59
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
| |||
0 commit comments