diff --git a/Makefile b/Makefile index bef0cfb..7b4266c 100644 --- a/Makefile +++ b/Makefile @@ -10,20 +10,26 @@ ifeq ($(UNAME_SYS), Linux) -fno-strict-aliasing XMPPIPE_SANDBOX ?= seccomp XMPPIPE_SANDBOX_RLIMIT_NOFILE ?= 0 + LDFLAGS ?= -Wl,-z,relro,-z,now else ifeq ($(UNAME_SYS), FreeBSD) CFLAGS ?= -DHAVE_STRTONUM \ -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-strong \ -Wformat -Werror=format-security \ -fno-strict-aliasing XMPPIPE_SANDBOX ?= capsicum + LDFLAGS ?= -Wl,-z,relro,-z,now else ifeq ($(UNAME_SYS), OpenBSD) CFLAGS ?= -DHAVE_STRTONUM \ -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-strong \ -Wformat -Werror=format-security \ -fno-strict-aliasing XMPPIPE_SANDBOX ?= pledge + LDFLAGS ?= -Wl,-z,relro,-z,now else ifeq ($(UNAME_SYS), SunOS) else ifeq ($(UNAME_SYS), Darwin) + CFLAGS ?= -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-strong \ + -Wformat -Werror=format-security \ + -fno-strict-aliasing endif XMPPIPE_SANDBOX ?= rlimit @@ -36,7 +42,6 @@ CFLAGS += $(XMPPIPE_CFLAGS) \ -DXMPPIPE_SANDBOX_$(XMPPIPE_SANDBOX) \ -DXMPPIPE_SANDBOX_RLIMIT_NOFILE=$(XMPPIPE_SANDBOX_RLIMIT_NOFILE) -XMPPIPE_LDFLAGS ?= -Wl,-z,relro,-z,now LDFLAGS += $(XMPPIPE_LDFLAGS) all: $(PROG) diff --git a/src/xmppipe.c b/src/xmppipe.c index 717ed8c..dd880e3 100644 --- a/src/xmppipe.c +++ b/src/xmppipe.c @@ -15,7 +15,6 @@ #include "xmppipe.h" #include -#include #include #include #include diff --git a/src/xmppipe.h b/src/xmppipe.h index eeb16ff..c3db7f0 100644 --- a/src/xmppipe.h +++ b/src/xmppipe.h @@ -19,6 +19,7 @@ #include #include #include +#include #include