aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2019-03-22 16:41:20 -0600
committerLogan Gunthorpe <logang@deltatee.com>2019-03-22 16:41:20 -0600
commit662884bd08835875210a2c01674e5594fcae78c7 (patch)
treef5967ec160abee0ab17e121d8652da196bcd9748
parenta1c125dde740f5acd1e20a341cf3426ea44af292 (diff)
downloadpk-662884bd08835875210a2c01674e5594fcae78c7.zip
pk-662884bd08835875210a2c01674e5594fcae78c7.tar.gz
pk-662884bd08835875210a2c01674e5594fcae78c7.tar.bz2
Disable compiler protections features
The riscv compiler available in Ubuntu enables stack protection and FORTIFY source by default which breaks the build. Adding -fno-stack-protector and -U_FORTIFY_SOURCE to the tool flags fixes this without any side effects. The compiler available in debian do not have these protections enabled and work with or without the extra flag. Fixes: #105 Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
-rw-r--r--Makefile.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in
index 376670d..73e92d9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -102,7 +102,7 @@ VPATH := $(addprefix $(src_dir)/, $(sprojs_enabled))
CC := @CC@
READELF := @READELF@
OBJCOPY := @OBJCOPY@
-CFLAGS := @CFLAGS@ $(CFLAGS) $(march) $(mabi) -DBBL_PAYLOAD=\"bbl_payload\" -DBBL_LOGO_FILE=\"bbl_logo_file\"
+CFLAGS := @CFLAGS@ $(CFLAGS) $(march) $(mabi) -DBBL_PAYLOAD=\"bbl_payload\" -DBBL_LOGO_FILE=\"bbl_logo_file\" -fno-stack-protector -U_FORTIFY_SOURCE
BBL_PAYLOAD := @BBL_PAYLOAD@
COMPILE := $(CC) -MMD -MP $(CFLAGS) \
$(sprojs_include)
@@ -111,7 +111,7 @@ COMPILE := $(CC) -MMD -MP $(CFLAGS) \
# - LIBS : Library flags (eg. -l)
LD := $(CC)
-LDFLAGS := @LDFLAGS@ -nostartfiles -nostdlib -static $(LDFLAGS) $(march) $(mabi)
+LDFLAGS := @LDFLAGS@ -nostartfiles -nostdlib -static $(LDFLAGS) $(march) $(mabi) -fno-stack-protector
LIBS := @LIBS@
LINK := $(LD) $(LDFLAGS)