summaryrefslogtreecommitdiffstats
path: root/src/makefile
diff options
context:
space:
mode:
authorZach Clark <zach@ibm.com>2019-05-01 11:18:13 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-05-13 09:10:45 -0500
commit6a2bedba84d0cc0b4a8837341e516a491218b729 (patch)
tree97b465ab89b43692408a5d2329ff7fdb6a65f185 /src/makefile
parent06d0a08aa27fa9e28cc300fbd2814fd9b84d59cf (diff)
downloadtalos-hostboot-6a2bedba84d0cc0b4a8837341e516a491218b729.tar.gz
talos-hostboot-6a2bedba84d0cc0b4a8837341e516a491218b729.zip
Developer Improvement: Get code coverage tool working with Hostboot
This commit fixes GCOV code coverage for P9 with GCC 4.9.2 Change-Id: Ie1e7c35f67414531dbd6e7a771ac1529a9ebd59d RTC: 208351 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76812 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/makefile')
-rw-r--r--src/makefile28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/makefile b/src/makefile
index 460485629..48f4b30be 100644
--- a/src/makefile
+++ b/src/makefile
@@ -59,10 +59,6 @@ BASE_OBJECTS += sprintf.o
BASE_OBJECTS += crc32.o
BASE_OBJECTS += utilmisc.o
-ifdef HOSTBOOT_PROFILE
-BASE_OBJECTS += gcov.o
-endif
-
BL_BASE_OBJECTS += bl_builtins.o
BOOTLDR_OBJECTS += bl_start.o
@@ -135,6 +131,9 @@ DIRECT_BOOT_OBJECTS += assert.o
DIRECT_BOOT_OBJECTS += workitem.o
DIRECT_BOOT_OBJECTS += bltohbdatamgr.o
DIRECT_BOOT_OBJECTS += errno.o
+ifdef HOSTBOOT_PROFILE
+DIRECT_BOOT_OBJECTS += gcov.o
+endif
BASE_MODULES += trace
BASE_MODULES += errl
@@ -150,6 +149,11 @@ BASE_MODULES += vfs
BASE_MODULES += $(if $(CONFIG_AST2400) || $(CONFIG_AST2500), sio)
BASE_MODULES += $(if $(CONFIG_CONSOLE),console)
+# This is exported so that gcov knows the list of base modules to
+# exclude from instrumentation. We can't simply export BASE_MODULES or
+# else we get duplicate modules in the list which causes linker errors.
+export BASE_MODULES_GCOV_BLACKLIST:=$(BASE_MODULES)
+
EXTENDED_MODULES += istep06
EXTENDED_MODULES += istep07
EXTENDED_MODULES += istep08
@@ -283,7 +287,12 @@ RUNTIME_OBJECTS += rt_assert.o
RUNTIME_OBJECTS += rt_vfs.o
RUNTIME_OBJECTS += rt_task.o
RUNTIME_OBJECTS += rt_time.o
-RUNTIME_OBJECTS += ${RUNTIME_COMMON_OBJS}
+RUNTIME_OBJECTS += runtime_utils.o
+ifdef HOSTBOOT_PROFILE
+# we don't instrument runtime because we don't have space, but we
+# still link this in because it uses some object files that need it
+RUNTIME_OBJECTS += gcov.o
+endif
RUNTIME_MODULES += trace_rt
RUNTIME_MODULES += errl_rt
@@ -314,6 +323,11 @@ RUNTIME_MODULES += $(if $(CONFIG_NVDIMM),nvdimm_rt)
RUNTIME_MODULES += mss_rt
RUNTIME_MODULES += expaccess_rt
+# This is exported so that gcov knows the list of runtime modules to
+# exclude from instrumentation. We can't simply export RUNTIME_MODULES or
+# else we get duplicate modules in the list which causes linker errors.
+export RUNTIME_MODULES_GCOV_BLACKLIST:=$(RUNTIME_MODULES)
+
RUNTIME_DATA_MODULES +=
RUNTIME_TESTCASE_MODULES += cxxtest_rt
@@ -410,10 +424,10 @@ $(IMGDIR)/hbotStringFile : $(IMAGES)
#20K for bootloader code and data)
#PROCESS: get size of hbibl.bin, sort with respect to 32k (32768),
#then see if last word is 32k. If not, the bootloader image is too big.
+
MAX_BASE_SIZE = 925696
MAX_BTLDR_SIZE = 32768
+
imgsizecheck: ${IMGDIR}/hbicore.bin ${IMGDIR}/hbibl.bin
$(if $(findstring $(shell (stat -c%s ${IMGDIR}/hbicore.bin; echo $(MAX_BASE_SIZE)) | sort -n | tail -n1), $(MAX_BASE_SIZE)),true, @echo ERROR: ${IMGDIR}/hbicore.bin too large. Max allowed size is $(MAX_BASE_SIZE); false)
$(if $(findstring $(shell (stat -c%s ${IMGDIR}/hbibl.bin; echo $(MAX_BTLDR_SIZE)) | sort -n | tail -n1), $(MAX_BTLDR_SIZE)),true, @echo ERROR: ${IMGDIR}/hbibl.bin too large. Max allowed size is $(MAX_BTLDR_SIZE); false)
-
-
OpenPOWER on IntegriCloud