Add #define _GNU_SOURCE so that transaction.go can reference C.RTLD_NEXT#35
Add #define _GNU_SOURCE so that transaction.go can reference C.RTLD_NEXT#35astudentofblake wants to merge 1 commit intomsteinert:masterfrom
Conversation
| #cgo CFLAGS: -Wall -Wno-unused-variable -std=c99 | ||
| #cgo LDFLAGS: -ldl -lpam | ||
|
|
||
| #define _GNU_SOURCE |
There was a problem hiding this comment.
Maybe this should be only in #ifdef __linux__ and other UNIX systems using glibc?
There was a problem hiding this comment.
Otherwise you can define _GNU_SOURCE for all, then you add an #ifndef RTLD_NEXT that sets it to 0 if unset? I'm not aware of platforms where that is not set, but it's safer to go this way.
There was a problem hiding this comment.
Or #if defined(__GLIBC__) maybe?
There was a problem hiding this comment.
Sorry for the delayed response
Not obvious what the best solution is here,
GLIBC is defined in features.h, which I could include to test the define, however features.h sets defines based on _GNU_SOURCE, so its not really correct.
I'll update the request with the second suggestion, define _GNU_SOURCE and add the ifndef, from the include file: -
define RTLD_NEXT ((void *) -1l)
I'm assuming this is what you mean (rather than set to zero).
There was a problem hiding this comment.
sorry, the define text being really large is a copy-paste error.
There was a problem hiding this comment.
I ran into this issue recently as well. May I suggest placing these changes into transaction_linux.go, and perhaps use #cgo CFLAGS: -D_GNU_SOURCE, which seems to be the preferred method.
RTLD_NEXT is inside a #ifdef __USE_GNU block in dlfcn.h, which causes the build to fail This in AlmaLinux release 8.10 (Cerulean Leopard), binary compatible with RHEL
8db7d3c to
da637a2
Compare
RTLD_NEXT is inside a #ifdef __USE_GNU block in dlfcn.h, which causes the build to fail
This in AlmaLinux release 8.10 (Cerulean Leopard), binary compatible with RHEL
fixes #34