1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-06 00:13:33 +00:00

Added check in makefile to test for -no-pie support before using it

This commit is contained in:
Bryan Roe
2019-01-16 22:59:09 -08:00
parent 9faccc6756
commit a632839e79
2 changed files with 9 additions and 1 deletions

View File

@@ -87,7 +87,7 @@ INCDIRS = -I. -Iopenssl/include -Imicrostack -Imicroscript -Imeshcore -Imeshcons
# Compiler and linker flags
CFLAGS ?= -std=gnu99 -g -Wall -D_POSIX -DMICROSTACK_PROXY $(CWEBLOG) $(CWATCHDOG) -fno-strict-aliasing $(INCDIRS) -DDUK_USE_DEBUGGER_SUPPORT -DDUK_USE_INTERRUPT_COUNTER -DDUK_USE_DEBUGGER_INSPECT -DDUK_USE_DEBUGGER_PAUSE_UNCAUGHT
LDFLAGS ?= -L. -lpthread -ldl -lutil -lm -no-pie
LDFLAGS ?= -L. -lpthread -ldl -lutil -lm
CEXTRA = -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fstack-protector -fno-strict-aliasing
LDEXTRA =
@@ -278,6 +278,11 @@ ifeq ($(SSL_TRACE),1)
CFLAGS += -DSSL_TRACE
endif
GCCTEST := $(shell $(CC) meshcore/dummy.c -o /dev/null -no-pie > /dev/null 2>&1 ; echo $$? )
ifeq ($(GCCTEST),0)
LDFLAGS += -no-pie
endif
.PHONY: all clean
all: $(EXENAME) $(LIBNAME)

3
meshcore/dummy.c Normal file
View File

@@ -0,0 +1,3 @@
int main(int argc, char **argv)
{
}