Skip to content

Conversation

@astudentofblake
Copy link

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

#cgo CFLAGS: -Wall -Wno-unused-variable -std=c99
#cgo LDFLAGS: -ldl -lpam
#define _GNU_SOURCE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be only in #ifdef __linux__ and other UNIX systems using glibc?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or #if defined(__GLIBC__) maybe?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, the define text being really large is a copy-paste error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails in RHEL8 "could not determine what C.RTLD_NEXT refers to"

4 participants