[Skiboot] [PATCH 01/17] Makefile.check: Fix `make check`

Cyril Bur cyril.bur at au1.ibm.com
Fri Jul 21 16:35:52 AEST 2017


Recent reworks were tested on the travis-ci system. Unfortunately, there
are configurations of running `make check` which the travis-ci doesn't
do. On some systems extra problems crop up.

Removing the stack size check is only done for the host compiler as the
check is only critical for skiboot its self where stack space is
contained.

Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 Makefile.main                        |  7 +++----
 external/common/arch_flash_powerpc.c | 11 +++++++++--
 external/gard/config.h               | 19 ++++++++++++++-----
 3 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/Makefile.main b/Makefile.main
index 438dcb27..96447cb0 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -38,8 +38,7 @@ HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-std=gnu11)
 HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-m64)
 HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \
 	  $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=const) \
-	  $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn) \
-	  $(call try-cflag,$(HOSTCC),-Wstack-usage=1024)
+	  $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn)
 HOSTCFLAGS += -DDEBUG -DCCAN_LIST_DEBUG
 
 HOSTGCOVCFLAGS = -fprofile-arcs -ftest-coverage -lgcov -O0 -g -pg
@@ -180,10 +179,10 @@ include $(SRC)/libstb/Makefile.inc
 
 # hack for travis-ci and coverity
 gard:
-	(cd external/gard; CFLAGS="$(HOSTCFLAGS) $(HOSTGCOVCFLAGS)" make)
+	(cd external/gard; CROSS_COMPILE="" CFLAGS="$(HOSTCFLAGS) $(HOSTGCOVCFLAGS)" make)
 
 pflash:
-	(cd external/pflash; CFLAGS="$(HOSTCFLAGS) $(HOSTGCOVCFLAGS)" make)
+	(cd external/pflash; CROSS_COMPILE="" CFLAGS="$(HOSTCFLAGS) $(HOSTGCOVCFLAGS)" make)
 
 pflash-coverity:
 	(cd external/pflash; ./build-all-arch.sh)
diff --git a/external/common/arch_flash_powerpc.c b/external/common/arch_flash_powerpc.c
index 6f32a001..95402ee1 100644
--- a/external/common/arch_flash_powerpc.c
+++ b/external/common/arch_flash_powerpc.c
@@ -208,14 +208,19 @@ static struct blocklevel_device *arch_init_blocklevel(const char *file, bool kee
 }
 
 /* Skiboot will worry about this for us */
-int arch_flash_set_wrprotect(struct blocklevel_device *bl, int set)
+int __attribute__((const)) arch_flash_set_wrprotect(struct blocklevel_device *bl, int set)
 {
+	(void)bl;
+	(void)set;
+
 	return 0;
 }
 
-enum flash_access arch_flash_access(struct blocklevel_device *bl,
+enum flash_access __attribute__((const)) arch_flash_access(struct blocklevel_device *bl,
 		enum flash_access access)
 {
+	(void)bl;
+
 	if (access != PNOR_MTD)
 		return ACCESS_INVAL;
 
@@ -243,5 +248,7 @@ int arch_flash_init(struct blocklevel_device **r_bl, const char *file, bool keep
 
 void arch_flash_close(struct blocklevel_device *bl, const char *file)
 {
+	(void)file;
+
 	file_exit_close(bl);
 }
diff --git a/external/gard/config.h b/external/gard/config.h
index a132a01a..2e0347f1 100644
--- a/external/gard/config.h
+++ b/external/gard/config.h
@@ -6,13 +6,22 @@
 #define HAVE_TYPEOF			1
 #define HAVE_BUILTIN_TYPES_COMPATIBLE_P	1
 
-
+#ifndef HAVE_LITTLE_ENDIAN
+#ifndef HAVE_BIG_ENDIAN
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-#define HAVE_BIG_ENDIAN         0
-#define HAVE_LITTLE_ENDIAN      1
+#define HAVE_LITTLE_ENDIAN 1
 #else
-#define HAVE_BIG_ENDIAN         1
-#define HAVE_LITTLE_ENDIAN      0
+#define HAVE_BIG_ENDIAN 1
+#endif
+#endif
+#endif
+
+/* Keep -Wundef happy by defining whatever isn't on commandline to 0 */
+#if defined(HAVE_LITTLE_ENDIAN) && HAVE_LITTLE_ENDIAN
+#define HAVE_BIG_ENDIAN 0
+#endif
+#if defined(HAVE_BIG_ENDIAN) && HAVE_BIG_ENDIAN
+#define HAVE_LITTLE_ENDIAN 0
 #endif
 
 #define HAVE_BYTESWAP_H 1
-- 
2.13.3



More information about the Skiboot mailing list