mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-23 03:33:35 +00:00
Added check in makefile to test for -no-pie support before using it
This commit is contained in:
7
makefile
7
makefile
@@ -87,7 +87,7 @@ INCDIRS = -I. -Iopenssl/include -Imicrostack -Imicroscript -Imeshcore -Imeshcons
|
|||||||
|
|
||||||
# Compiler and linker flags
|
# 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
|
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
|
CEXTRA = -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fstack-protector -fno-strict-aliasing
|
||||||
LDEXTRA =
|
LDEXTRA =
|
||||||
|
|
||||||
@@ -278,6 +278,11 @@ ifeq ($(SSL_TRACE),1)
|
|||||||
CFLAGS += -DSSL_TRACE
|
CFLAGS += -DSSL_TRACE
|
||||||
endif
|
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
|
.PHONY: all clean
|
||||||
|
|
||||||
all: $(EXENAME) $(LIBNAME)
|
all: $(EXENAME) $(LIBNAME)
|
||||||
|
|||||||
3
meshcore/dummy.c
Normal file
3
meshcore/dummy.c
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user