summaryrefslogtreecommitdiff
path: root/debian/patches/0026-gcc-8-coverity-hack.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0026-gcc-8-coverity-hack.patch')
-rw-r--r--debian/patches/0026-gcc-8-coverity-hack.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/debian/patches/0026-gcc-8-coverity-hack.patch b/debian/patches/0026-gcc-8-coverity-hack.patch
new file mode 100644
index 00000000..f039a5c0
--- /dev/null
+++ b/debian/patches/0026-gcc-8-coverity-hack.patch
@@ -0,0 +1,74 @@
+From 28156667e5c7dc3c7b978f2d58c2a427038fedda Mon Sep 17 00:00:00 2001
+From: Jes Sorensen <jsorensen@fb.com>
+Date: Mon, 4 Jun 2018 14:49:59 -0400
+Subject: [PATCH 26/26] gcc-8 coverity hack
+
+Coverity still has issues with gcc-7, not to mention gcc-8. Hack around
+it, until they fix it.
+
+Signed-off-by: Jes Sorensen <jsorensen@fb.com>
+---
+ Makefile | 15 +++++++++++----
+ coverity-gcc-hack.h | 10 ++++++++++
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+ create mode 100644 coverity-gcc-hack.h
+
+diff --git a/Makefile b/Makefile
+index 188a2180..2767ac68 100644
+--- a/Makefile
++++ b/Makefile
+@@ -42,6 +42,10 @@ KLIBC=/home/src/klibc/klibc-0.77
+
+ KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
+
++ifdef COVERITY
++COVERITY_FLAGS=-include coverity-gcc-hack.h
++endif
++
+ CC ?= $(CROSS_COMPILE)gcc
+ CXFLAGS ?= -ggdb
+ CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
+@@ -177,6 +181,9 @@ everything-test: all mdadm.static swap_super test_stripe \
+ # mdadm.uclibc doesn't work on x86-64
+ # mdadm.tcc doesn't work..
+
++%.o: %.c
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(COVERITY_FLAGS) -o $@ -c $<
++
+ mdadm : $(OBJS) | check_rundir
+ $(CC) $(CFLAGS) $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS)
+
+@@ -291,10 +298,10 @@ test: mdadm mdmon test_stripe swap_super raid6check
+
+ clean :
+ rm -f mdadm mdmon $(OBJS) $(MON_OBJS) $(STATICOBJS) core *.man \
+- mdadm.tcc mdadm.uclibc mdadm.static *.orig *.porig *.rej *.alt .merge_file_* \
+- mdadm.Os mdadm.O2 mdmon.O2 swap_super \
+- init.cpio.gz mdadm.uclibc.static test_stripe raid6check raid6check.o mdmon \
+- mdadm.8
++ mdadm.tcc mdadm.uclibc mdadm.static *.orig *.porig *.rej *.alt \
++ .merge_file_* mdadm.Os mdadm.O2 mdmon.O2 swap_super init.cpio.gz \
++ mdadm.uclibc.static test_stripe raid6check raid6check.o mdmon mdadm.8
++ rm -rf cov-int
+
+ dist : clean
+ ./makedist
+diff --git a/coverity-gcc-hack.h b/coverity-gcc-hack.h
+new file mode 100644
+index 00000000..2d94a8b7
+--- /dev/null
++++ b/coverity-gcc-hack.h
+@@ -0,0 +1,10 @@
++#if !defined(__KERNEL__) && defined(__x86_64__) && defined(__COVERITY_GCC_VERSION_AT_LEAST)
++#if __COVERITY_GCC_VERSION_AT_LEAST(7, 0)
++typedef float _Float128 __attribute__((__vector_size__(128)));
++typedef float _Float64 __attribute__((__vector_size__(64)));
++typedef float _Float32 __attribute__((__vector_size__(32)));
++typedef float _Float128x __attribute__((__vector_size__(128)));
++typedef float _Float64x __attribute__((__vector_size__(64)));
++typedef float _Float32x __attribute__((__vector_size__(32)));
++#endif
++#endif
+--
+2.17.1
+