From be9a2e5ae2105000b7ce92a30ed512b676280252 Mon Sep 17 00:00:00 2001 From: California Sullivan Date: Thu, 18 Jan 2018 13:33:35 -0800 Subject: intel-gpu-tools: backport patch fixing 32-bit builds Fixes the following error seen in 32-bit builds: | ../../intel-gpu-tools-1.20/lib/igt_x86.c:96:10: error: redefinition of 'igt_x86_features' | unsigned igt_x86_features(void) | ^~~~~~~~~~~~~~~~ | In file included from ../../intel-gpu-tools-1.20/lib/igt_x86.c:38:0: | ../../intel-gpu-tools-1.20/lib/igt_x86.h:47:24: note: previous definition of 'igt_x86_features' was here | static inline unsigned igt_x86_features(void) | ^~~~~~~~~~~~~~~~ | ../../intel-gpu-tools-1.20/lib/igt_x86.c:148:7: error: redefinition of 'igt_x86_features_to_string' | char *igt_x86_features_to_string(unsigned features, char *line) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | In file included from ../../intel-gpu-tools-1.20/lib/igt_x86.c:38:0: | ../../intel-gpu-tools-1.20/lib/igt_x86.h:51:21: note: previous definition of 'igt_x86_features_to_string' was here | static inline char *igt_x86_features_to_string(unsigned features, char *line) I unfortunately missed this before merging the upgrade. Signed-off-by: California Sullivan --- .../0001-lib-Fix-compilation-on-non-x86.patch | 82 ++++++++++++++++++++++ .../intel-gpu-tools/intel-gpu-tools_1.20.bb | 2 + 2 files changed, 84 insertions(+) create mode 100644 recipes-graphics/intel-gpu-tools/intel-gpu-tools/0001-lib-Fix-compilation-on-non-x86.patch diff --git a/recipes-graphics/intel-gpu-tools/intel-gpu-tools/0001-lib-Fix-compilation-on-non-x86.patch b/recipes-graphics/intel-gpu-tools/intel-gpu-tools/0001-lib-Fix-compilation-on-non-x86.patch new file mode 100644 index 00000000..0c8c24c1 --- /dev/null +++ b/recipes-graphics/intel-gpu-tools/intel-gpu-tools/0001-lib-Fix-compilation-on-non-x86.patch @@ -0,0 +1,82 @@ +From 4fbb4b9c12d1944e5d60bc4f3d0cbd0bf7bed36d Mon Sep 17 00:00:00 2001 +From: Thierry Reding +Date: Thu, 12 Oct 2017 10:33:37 +0200 +Subject: [PATCH] lib: Fix compilation on non-x86 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The meson build avoids the failure by excluding the igt_x86.c file from +the compilation. autotools being what they are don't support that in an +easy way, so just use the preprocessor to avoid the duplicate function +definitions. + +Since igt_x86.c will now be ignored for non-x86 builds, the meson work- +around can be removed. + +Upstream-Status: backport. + +Reviewed-by: Ville Syrjälä +Signed-off-by: Thierry Reding +--- + lib/igt_x86.c | 2 ++ + lib/igt_x86.h | 2 +- + lib/meson.build | 5 +---- + 3 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/lib/igt_x86.c b/lib/igt_x86.c +index 0f0963ce..0ed3c6f1 100644 +--- a/lib/igt_x86.c ++++ b/lib/igt_x86.c +@@ -93,6 +93,7 @@ + + #define has_YMM 0x1 + ++#if defined(__x86_64__) || defined(__i386__) + unsigned igt_x86_features(void) + { + unsigned max = __get_cpuid_max(BASIC_CPUID, 0); +@@ -172,3 +173,4 @@ char *igt_x86_features_to_string(unsigned features, char *line) + + return ret; + } ++#endif +diff --git a/lib/igt_x86.h b/lib/igt_x86.h +index d6dcfa10..27b7f0fd 100644 +--- a/lib/igt_x86.h ++++ b/lib/igt_x86.h +@@ -40,7 +40,7 @@ + #define AVX 0x80 + #define AVX2 0x100 + +-#if defined(__x86_64__) ++#if defined(__x86_64__) || defined(__i386__) + unsigned igt_x86_features(void); + char *igt_x86_features_to_string(unsigned features, char *line); + #else +diff --git a/lib/meson.build b/lib/meson.build +index b31c68e4..ddf93ec6 100644 +--- a/lib/meson.build ++++ b/lib/meson.build +@@ -64,6 +64,7 @@ lib_sources = [ + 'igt_syncobj.c', + 'igt_sysfs.c', + 'igt_vgem.c', ++ 'igt_x86.c', + 'instdone.c', + 'intel_batchbuffer.c', + 'intel_chipset.c', +@@ -96,10 +97,6 @@ lib_sources = [ + 'igt_kmod.c', + ] + +-if ['x86', 'x86_64'].contains(host_machine.cpu_family()) +- lib_sources += 'igt_x86.c' +-endif +- + lib_deps = [ + cairo, + glib, +-- +2.14.3 + diff --git a/recipes-graphics/intel-gpu-tools/intel-gpu-tools_1.20.bb b/recipes-graphics/intel-gpu-tools/intel-gpu-tools_1.20.bb index c4939a64..4fdd0911 100644 --- a/recipes-graphics/intel-gpu-tools/intel-gpu-tools_1.20.bb +++ b/recipes-graphics/intel-gpu-tools/intel-gpu-tools_1.20.bb @@ -9,6 +9,8 @@ LICENSE_append = " & ISC" inherit autotools gtk-doc +SRC_URI += "file://0001-lib-Fix-compilation-on-non-x86.patch" + DEPENDS += "libdrm libpciaccess cairo udev glib-2.0 libxv libx11 libxext libxrandr procps" RDEPENDS_${PN} += "bash" RDEPENDS_${PN}-tests += "bash" -- cgit v1.2.3-54-g00ecf