Skip to content

Commit

Permalink
Add NO_PIE option
Browse files Browse the repository at this point in the history
  • Loading branch information
DanTheMan827 authored Jan 24, 2021
1 parent 0f68537 commit f9a2614
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f9a2614

Please sign in to comment.