Fix AlmaLinux/RHEL 8 build failure (#26) #78

Merged
claude merged 1 commit from issue26_almalinux_pam_build_fix into main 2026-07-08 19:00:47 +01:00
claude commented 2026-07-08 16:36:14 +01:00 (Migrated from gitlab.keyop.co.uk)

Closes #26.

msteinert/pam/v2's cgo preamble references C.RTLD_NEXTunder-std=c99, but RTLD_NEXT is gated behind glibc's #ifdef __USE_GNUindlfcn.h- without_GNU_SOURCEdefined, glibc 2.28 (RHEL/Alma 8) doesn't expose it under strict c99, and the build fails withcould not determine what C.RTLD_NEXT refers to`. Debian's glibc doesn't hit this, which is why CI and the packaged release binaries were already unaffected.

Fix: export CGO_CFLAGS = -D_GNU_SOURCE in the Makefile.

Verified against a real almalinux:8.10 container, not just reasoned about - reproduced the exact reported error with both a minimal repro and this project's actual go build ./..., then confirmed the fix resolves both.

Upstream has an approved-but-unmerged fix (msteinert/pam#34); this workaround can be dropped once that lands and the dependency is bumped.

make lint/make test/make build all still pass on the (unaffected) Debian sandbox too.

Closes #26. `msteinert/pam/v2's cgo preamble references `C.RTLD_NEXT` under `-std=c99`, but RTLD_NEXT is gated behind glibc's `#ifdef __USE_GNU` in `dlfcn.h` - without `_GNU_SOURCE` defined, glibc 2.28 (RHEL/Alma 8) doesn't expose it under strict c99, and the build fails with `could not determine what C.RTLD_NEXT refers to`. Debian's glibc doesn't hit this, which is why CI and the packaged release binaries were already unaffected. Fix: `export CGO_CFLAGS = -D_GNU_SOURCE` in the Makefile. **Verified against a real `almalinux:8.10` container**, not just reasoned about - reproduced the exact reported error with both a minimal repro and this project's actual `go build ./...`, then confirmed the fix resolves both. Upstream has an approved-but-unmerged fix ([msteinert/pam#34](https://github.com/msteinert/pam/issues/34)); this workaround can be dropped once that lands and the dependency is bumped. `make lint`/`make test`/`make build` all still pass on the (unaffected) Debian sandbox too.
claude commented 2026-07-08 16:36:14 +01:00 (Migrated from gitlab.keyop.co.uk)

requested review from @danny

requested review from @danny
claude commented 2026-07-08 16:36:14 +01:00 (Migrated from gitlab.keyop.co.uk)

assigned to @claude

assigned to @claude
danny (Migrated from gitlab.keyop.co.uk) approved these changes 2026-07-08 16:36:14 +01:00
danny commented 2026-07-08 19:00:43 +01:00 (Migrated from gitlab.keyop.co.uk)

Absolutely fine with this one.

Absolutely fine with this one.
danny commented 2026-07-08 19:00:43 +01:00 (Migrated from gitlab.keyop.co.uk)

approved this merge request

approved this merge request
danny commented 2026-07-08 19:00:47 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit e701ff5e0c

mentioned in commit e701ff5e0c60cf5c52b19769359a674b9176aa77
danny (Migrated from gitlab.keyop.co.uk) merged commit e701ff5e0c into main 2026-07-08 19:00:47 +01:00
claude commented 2026-07-08 19:08:42 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit 6c88be75e0

mentioned in commit 6c88be75e0f996b0ffe54670834541f629fc841d
claude commented 2026-07-08 19:09:06 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in merge request !79

mentioned in merge request !79
claude commented 2026-07-08 19:09:46 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in issue #26

mentioned in issue #26
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
keyop-go/nfq_forwarder!78
No description provided.