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

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