Browse Source

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>
pull/150/head
Logan Gunthorpe 7 years ago
parent
commit
662884bd08
  1. 4
      Makefile.in

4
Makefile.in

@ -102,7 +102,7 @@ VPATH := $(addprefix $(src_dir)/, $(sprojs_enabled))
CC := @CC@ CC := @CC@
READELF := @READELF@ READELF := @READELF@
OBJCOPY := @OBJCOPY@ 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@ BBL_PAYLOAD := @BBL_PAYLOAD@
COMPILE := $(CC) -MMD -MP $(CFLAGS) \ COMPILE := $(CC) -MMD -MP $(CFLAGS) \
$(sprojs_include) $(sprojs_include)
@ -111,7 +111,7 @@ COMPILE := $(CC) -MMD -MP $(CFLAGS) \
# - LIBS : Library flags (eg. -l) # - LIBS : Library flags (eg. -l)
LD := $(CC) LD := $(CC)
LDFLAGS := @LDFLAGS@ -nostartfiles -nostdlib -static $(LDFLAGS) $(march) $(mabi) LDFLAGS := @LDFLAGS@ -nostartfiles -nostdlib -static $(LDFLAGS) $(march) $(mabi) -fno-stack-protector
LIBS := @LIBS@ LIBS := @LIBS@
LINK := $(LD) $(LDFLAGS) LINK := $(LD) $(LDFLAGS)

Loading…
Cancel
Save