BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\""
BUILD_CFLAGS += -fvisibility=hidden
-# Otherwise Fedora is making kresd symbols inaccessible for modules
-# TODO: clang needs different flag name, etc.
-BUILD_CFLAGS += -rdynamic
-BUILD_LDFLAGS += -export-dynamic
-
ifeq (,$(findstring -O,$(CFLAGS)))
BUILD_CFLAGS += -O2
endif
PLATFORM := Darwin
LIBEXT := .dylib
MODTYPE := dynamiclib
+ LDFLAGS += -Wl,-export_dynamic
# OS X specific hardening since -pie doesn't work
ifneq ($(HARDENING),no)
BINFLAGS += -Wl,-pie
SOVER = $(if $(1), -compatibility_version $(2) -current_version $(1),)
else
PLATFORM := POSIX
- LDFLAGS += -pthread -lm -Wl,-E
+ LDFLAGS += -pthread -lm -Wl,--export-dynamic
# ELF hardening options
ifneq ($(HARDENING),no)
BINFLAGS += -pie
LDFLAGS += -Wl,-z,relro,-z,now
endif
ifeq ($(UNAME),Linux)
- LDFLAGS += -ldl
+ LDFLAGS += -ldl
+ endif
+ ifeq ($(firstword $(shell $(CC) --version)),gcc)
+ # Otherwise Fedora is making kresd symbols inaccessible for modules?
+ CFLAGS += -rdynamic
endif
endif
endif