Skip to content

Commit 32d44b9

Browse files
committed
Add -fPIE to src/util/Makefile
1 parent 5fda229 commit 32d44b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/util/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ INCLUDES= -I ..
119119
include ../config.inc
120120
include ../common
121121

122+
ifeq ($(OS),Windows_NT)
123+
detected_OS := Windows
124+
else
125+
detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
126+
endif
127+
128+
ifeq ($(detected_OS),Linux)
129+
CFLAGS += -fPIE
130+
CXXFLAGS += -fPIE
131+
endif
132+
122133
# get version from git
123134
GIT_INFO = $(shell git describe --tags --always --dirty || echo "n/a")
124135
RELEASE_INFO = const char *CBMC_VERSION="$(CBMC_VERSION) ($(GIT_INFO))";

0 commit comments

Comments
 (0)