Skip to content
Snippets Groups Projects
Verified Commit 3016281b authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

make: fixup passing export-dynamic flags

It was breaking on Darwin, and clang was throwing warnings.
Problem since ddb699d3.
parent 07a0703a
No related branches found
No related tags found
1 merge request!466osx and other fixes
...@@ -40,11 +40,6 @@ BUILD_CFLAGS += -I$(abspath .) -I$(abspath lib/generic) -I$(abspath contrib) ...@@ -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 += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\""
BUILD_CFLAGS += -fvisibility=hidden 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))) ifeq (,$(findstring -O,$(CFLAGS)))
BUILD_CFLAGS += -O2 BUILD_CFLAGS += -O2
endif endif
......
...@@ -36,6 +36,7 @@ else ...@@ -36,6 +36,7 @@ else
PLATFORM := Darwin PLATFORM := Darwin
LIBEXT := .dylib LIBEXT := .dylib
MODTYPE := dynamiclib MODTYPE := dynamiclib
LDFLAGS += -Wl,-export_dynamic
# OS X specific hardening since -pie doesn't work # OS X specific hardening since -pie doesn't work
ifneq ($(HARDENING),no) ifneq ($(HARDENING),no)
BINFLAGS += -Wl,-pie BINFLAGS += -Wl,-pie
...@@ -45,14 +46,18 @@ else ...@@ -45,14 +46,18 @@ else
SOVER = $(if $(1), -compatibility_version $(2) -current_version $(1),) SOVER = $(if $(1), -compatibility_version $(2) -current_version $(1),)
else else
PLATFORM := POSIX PLATFORM := POSIX
LDFLAGS += -pthread -lm -Wl,-E LDFLAGS += -pthread -lm -Wl,--export-dynamic
# ELF hardening options # ELF hardening options
ifneq ($(HARDENING),no) ifneq ($(HARDENING),no)
BINFLAGS += -pie BINFLAGS += -pie
LDFLAGS += -Wl,-z,relro,-z,now LDFLAGS += -Wl,-z,relro,-z,now
endif endif
ifeq ($(UNAME),Linux) 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 endif
endif endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment