aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2019-10-22 10:03:10 -0700
committerGitHub <noreply@github.com>2019-10-22 10:03:10 -0700
commit6208fce3dcd4e976fde4b63d319924f1a2b4bd93 (patch)
tree72f5143d405c6f1de9fe7b63ee15caf0ceaa769c
parent99d6d0a93f9c83b63343a00693d5085e3949fe1a (diff)
parentb54479d8e7aaec0a29fca0844cae7485dff50b7d (diff)
downloadpk-6208fce3dcd4e976fde4b63d319924f1a2b4bd93.zip
pk-6208fce3dcd4e976fde4b63d319924f1a2b4bd93.tar.gz
pk-6208fce3dcd4e976fde4b63d319924f1a2b4bd93.tar.bz2
Merge pull request #150 from lsgunth/build_fixes
Build fixes
-rw-r--r--Makefile.in11
-rw-r--r--bbl/bbl.mk.in5
2 files changed, 11 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in
index 507d1a2..8d89184 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)
@@ -283,11 +283,11 @@ $$($(2)_install_prog_exes) : % : %.o $$($(2)_prog_libnames)
$(2)_c_deps += $$($(2)_install_prog_deps)
$(2)_junk += \
$$($(2)_install_prog_objs) $$($(2)_install_prog_deps) \
- $$($(2)_install_prog_exes)
+ $$($(2)_install_prog_exes) $($(2)_extra_targets)
# Subproject specific targets
-all-$(1) : lib$(1).a $$($(2)_install_prog_exes)
+all-$(1) : lib$(1).a $$($(2)_install_prog_exes) $($(2)_extra_targets)
check-$(1) : $$($(2)_test_outs)
echo; grep -h -e'Unit Tests' -e'FAILED' -e'Segementation' $$^; echo
@@ -311,6 +311,7 @@ test_outs += $$($(2)_test_outs)
install_hdrs += $$(addprefix $(src_dir)/$(1)/, $$($(2)_hdrs))
install_libs += lib$(1).a
install_exes += $$($(2)_install_prog_exes)
+extra_targets += $($(2)_extra_targets)
endef
@@ -446,7 +447,7 @@ junk += $(project_name)-*.tar.gz
# Default
#-------------------------------------------------------------------------
-all : $(install_hdrs) $(install_libs) $(install_exes)
+all : $(install_hdrs) $(install_libs) $(install_exes) $(extra_targets)
.PHONY : all
#-------------------------------------------------------------------------
diff --git a/bbl/bbl.mk.in b/bbl/bbl.mk.in
index f91dfbf..b0ef476 100644
--- a/bbl/bbl.mk.in
+++ b/bbl/bbl.mk.in
@@ -35,3 +35,8 @@ bbl_test_srcs =
bbl_install_prog_srcs = \
bbl.c \
+
+bbl.bin: bbl
+ $(OBJCOPY) -S -O binary --change-addresses -0x80000000 $< $@
+
+bbl_extra_targets = bbl.bin