From aa3b36e39a8980f9ab18eedb88a74feee38847d567290c14a7266e97c8b8a2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 20 Nov 2019 10:44:19 +0000 Subject: [PATCH] Accepting request 749849 from home:dimstar:Factory - Add 174.patch (https://patch-diff.githubusercontent.com/raw/linuxwacom/libwacom/pull/174.patch): + Disable deprecated symbol test when using LTO. OBS-URL: https://build.opensuse.org/request/show/749849 OBS-URL: https://build.opensuse.org/package/show/hardware/libwacom?expand=0&rev=9 --- 174.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ libwacom.changes | 7 +++++++ libwacom.spec | 2 ++ 3 files changed, 61 insertions(+) create mode 100644 174.patch diff --git a/174.patch b/174.patch new file mode 100644 index 0000000..425e2b8 --- /dev/null +++ b/174.patch @@ -0,0 +1,52 @@ +From b81ab0fec2273f2ff20664660fe5e9b58dc67a9c Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 4 Nov 2019 14:55:24 +1000 +Subject: [PATCH] meson.build: disable the deprecated symbols test with LTO + +If I understand this correctly: +- our deprecated symbols are remapped into a specific library version +- nothing in the test calls those symbols, so they're optimized away (they end + up as local symbols) +- our test uses asm to link to those functions but by then they're already + gone + +Rather than fixing this let's just disable the test, it doesn't provide us +with anything useful in the LTO condition anyway. + +Fixes #152 + +Signed-off-by: Peter Hutterer +--- + meson.build | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +diff --git a/meson.build b/meson.build +index 8283613..28d93a3 100644 +--- a/meson.build ++++ b/meson.build +@@ -543,13 +543,18 @@ if get_option('tests') + message('valgrind not found, disabling valgrind test suite') + endif + +- test_deprecated = executable('test-deprecated', +- 'test/test-deprecated.c', +- dependencies: [dep_libwacom, dep_dl], +- include_directories: [includes_src], +- c_args: tests_cflags, +- install: false) +- test('test-deprecated', test_deprecated, suite: ['all']) ++ # because of the tricks we use in calling the function and exposing ++ # it to begin with, LTO gets confused and this fails to link. ++ # Let's just disable it here. ++ if not get_option('b_lto') ++ test_deprecated = executable('test-deprecated', ++ 'test/test-deprecated.c', ++ dependencies: [dep_libwacom, dep_dl], ++ include_directories: [includes_src], ++ c_args: tests_cflags, ++ install: false) ++ test('test-deprecated', test_deprecated, suite: ['all']) ++ endif + endif + + # This is a non-optional test diff --git a/libwacom.changes b/libwacom.changes index 45cf0f0..e833f5b 100644 --- a/libwacom.changes +++ b/libwacom.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Nov 20 10:06:24 UTC 2019 - Dominique Leuenberger + +- Add 174.patch + (https://patch-diff.githubusercontent.com/raw/linuxwacom/libwacom/pull/174.patch): + + Disable deprecated symbol test when using LTO. + ------------------------------------------------------------------- Thu Nov 14 00:46:28 UTC 2019 - Michael Gorse diff --git a/libwacom.spec b/libwacom.spec index f183983..c5d7c91 100644 --- a/libwacom.spec +++ b/libwacom.spec @@ -32,6 +32,7 @@ Source: https://github.com/linuxwacom/libwacom/releases/download/%{name} Source2: https://github.com/linuxwacom/libwacom/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2.sig Source3: %{name}.keyring Source99: baselibs.conf +Patch0: https://patch-diff.githubusercontent.com/raw/linuxwacom/libwacom/pull/174.patch %if %{with meson} BuildRequires: meson >= 0.47.0 %endif @@ -85,6 +86,7 @@ built-in on-screen tablet", "what is the size of this model", etc. %prep %setup -q +%patch0 -p1 %build %if %{with meson}