From 1ac4c2369638324415f3546815cb7a57155952be Mon Sep 17 00:00:00 2001 From: cn Date: Tue, 25 Dec 2018 22:16:17 +0100 Subject: [PATCH] module: enable PIE and RELRO binary protections in go build --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a344081..65d6e42 100644 --- a/Makefile +++ b/Makefile @@ -35,12 +35,12 @@ remote-run: clean .PHONY: cmd/munin-miflora/miflorad cmd/munin-miflora/miflorad: - cd cmd/miflorad && CGO_ENABLED=0 go build -ldflags "-X main.version=$(MIFLORAD_VERSION)" && cd ../.. + cd cmd/miflorad && CGO_ENABLED=0 go build -buildmode=pie -ldflags "-X main.version=$(MIFLORAD_VERSION)" && cd ../.. .PHONY: cmd/munin-miflora/munin-miflora cmd/munin-miflora/munin-miflora: - cd cmd/munin-miflora && CGO_ENABLED=0 go build && cd ../.. + cd cmd/munin-miflora && CGO_ENABLED=0 go build -buildmode=pie && cd ../.. .PHONY: cmd/munin-miflora/munin-miflora-gatt cmd/munin-miflora/munin-miflora-gatt: - cd cmd/munin-miflora-gatt && CGO_ENABLED=0 go build && cd ../.. + cd cmd/munin-miflora-gatt && CGO_ENABLED=0 go build -buildmode=pie && cd ../..