Add NO_PIE option

This commit is contained in:
DanTheMan827 2021-01-24 14:48:15 -06:00 committed by GitHub
parent 0f68537e09
commit f9a26149eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -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