diff --git a/Makefile b/Makefile index 772f31a..621aedd 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,9 @@ TARGET_WEB ?= 0 # Makeflag to enable OSX fixes OSX_BUILD ?= 0 +# Enable -no-pie linker option +NO_PIE ?= 1 + # Specify the target you are building for, TARGET_BITS=0 means native TARGET_ARCH ?= native TARGET_BITS ?= 0 @@ -638,9 +641,13 @@ else ifeq ($(OSX_BUILD),1) LDFLAGS := -lm $(BACKEND_LDFLAGS) -no-pie -lpthread else - LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm $(BACKEND_LDFLAGS) -no-pie -lpthread + LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm $(BACKEND_LDFLAGS) -lpthread -ldl + ifeq ($(NO_PIE), 1) + LDFLAGS += -no-pie + endif + ifeq ($(DISCORDRPC),1) - LDFLAGS += -ldl -Wl,-rpath . + LDFLAGS += -Wl,-rpath . endif endif # End of LDFLAGS