Blame SOURCES/0001-Fix-build-on-F28-and-later.patch

8dbced
From 9c1151b4d65c356f0d25d952fe1a10c89fdb834a Mon Sep 17 00:00:00 2001
8dbced
From: Adam Jackson <ajax@redhat.com>
8dbced
Date: Mon, 5 Mar 2018 11:03:18 -0500
8dbced
Subject: [PATCH] Fix build on F28 and later
8dbced
8dbced
Newer gcc complains that it doesn't know how to always-inline memcpy():
8dbced
8dbced
  /usr/include/bits/string_fortified.h:31:1: error: inlining failed in
8dbced
  call to always_inline 'memcpy': target specific option mismatch
8dbced
8dbced
This is because we need to wrap our declaration of memcpy() in the
8dbced
options we're trying to push at the top of blt.c. So: include compiler.h
8dbced
to define sse2, then push options, then include everything else.
8dbced
8dbced
However if you do that, the word 'nonnull' collides with the usage in
8dbced
<X11/Xfuncproto.h>. I'm too lazy to fix that properly, just expand it to
8dbced
the __attribute__ form in the few places we say it.
8dbced
8dbced
Signed-off-by: Adam Jackson <ajax@redhat.com>
8dbced
---
8dbced
 src/sna/blt.c         | 6 ++++--
8dbced
 src/sna/compiler.h    | 2 --
8dbced
 src/sna/gen6_common.h | 6 +++---
8dbced
 3 files changed, 7 insertions(+), 7 deletions(-)
8dbced
8dbced
diff --git a/src/sna/blt.c b/src/sna/blt.c
8dbced
index cb90437a..fb357d35 100644
8dbced
--- a/src/sna/blt.c
8dbced
+++ b/src/sna/blt.c
8dbced
@@ -29,13 +29,15 @@
8dbced
 #include "config.h"
8dbced
 #endif
8dbced
 
8dbced
-#include "sna.h"
8dbced
-#include <pixman.h>
8dbced
+#include "compiler.h"
8dbced
 
8dbced
 #if defined(sse2)
8dbced
 #pragma GCC push_options
8dbced
 #pragma GCC target("sse2,inline-all-stringops,fpmath=sse")
8dbced
 #pragma GCC optimize("Ofast")
8dbced
+
8dbced
+#include <pixman.h>
8dbced
+#include "sna.h"
8dbced
 #include <xmmintrin.h>
8dbced
 
8dbced
 #if __x86_64__
8dbced
diff --git a/src/sna/compiler.h b/src/sna/compiler.h
8dbced
index 0f3775ec..3c176a16 100644
8dbced
--- a/src/sna/compiler.h
8dbced
+++ b/src/sna/compiler.h
8dbced
@@ -39,7 +39,6 @@
8dbced
 #define pure __attribute__((pure))
8dbced
 #define tightly_packed __attribute__((__packed__))
8dbced
 #define flatten __attribute__((flatten))
8dbced
-#define nonnull __attribute__((nonnull))
8dbced
 #define page_aligned __attribute__((aligned(4096)))
8dbced
 #else
8dbced
 #define likely(expr) (expr)
8dbced
@@ -52,7 +51,6 @@
8dbced
 #define pure
8dbced
 #define tighly_packed
8dbced
 #define flatten
8dbced
-#define nonnull
8dbced
 #define page_aligned
8dbced
 #endif
8dbced
 
8dbced
diff --git a/src/sna/gen6_common.h b/src/sna/gen6_common.h
8dbced
index b53ec0c9..119a2d5d 100644
8dbced
--- a/src/sna/gen6_common.h
8dbced
+++ b/src/sna/gen6_common.h
8dbced
@@ -133,7 +133,7 @@ inline static bool force_blt_ring(struct sna *sna, struct kgem_bo *bo)
8dbced
 	return false;
8dbced
 }
8dbced
 
8dbced
-nonnull inline static bool
8dbced
+__attribute__((nonnull)) inline static bool
8dbced
 prefer_blt_ring(struct sna *sna, struct kgem_bo *bo, unsigned flags)
8dbced
 {
8dbced
 	if (PREFER_RENDER)
8dbced
@@ -148,7 +148,7 @@ prefer_blt_ring(struct sna *sna, struct kgem_bo *bo, unsigned flags)
8dbced
 	return can_switch_to_blt(sna, bo, flags);
8dbced
 }
8dbced
 
8dbced
-nonnull inline static bool
8dbced
+__attribute__((nonnull)) inline static bool
8dbced
 prefer_render_ring(struct sna *sna, struct kgem_bo *bo)
8dbced
 {
8dbced
 	if (sna->kgem.ring == KGEM_RENDER)
8dbced
@@ -191,7 +191,7 @@ prefer_blt_composite(struct sna *sna, struct sna_composite_op *tmp)
8dbced
 	return prefer_blt_bo(sna, tmp->src.bo, tmp->dst.bo);
8dbced
 }
8dbced
 
8dbced
-nonnull static inline bool
8dbced
+__attribute__((nonnull)) static inline bool
8dbced
 prefer_blt_fill(struct sna *sna, struct kgem_bo *bo, unsigned flags)
8dbced
 {
8dbced
 	if (PREFER_RENDER)
8dbced
-- 
8dbced
2.16.2
8dbced