Commit 3016281b authored by Vladimír Čunát's avatar Vladimír Čunát

make: fixup passing export-dynamic flags

It was breaking on Darwin, and clang was throwing warnings.
Problem since ddb699d3.
parent 07a0703a
......@@ -40,11 +40,6 @@ BUILD_CFLAGS += -I$(abspath .) -I$(abspath lib/generic) -I$(abspath contrib)
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
......
......@@ -36,6 +36,7 @@ else
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
......@@ -45,14 +46,18 @@ else
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment