From eada45dd4fda3ba0eb8795b62409cf67adddf7c9bc3742a88864e07362f407cb Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Wed, 27 May 2020 15:38:22 +0000 Subject: [PATCH] Accepting request 809200 from home:marxin:branches:X11:XOrg - Add add-lifetime-dse-fix.patch as a proper fix for boo#1171855. OBS-URL: https://build.opensuse.org/request/show/809200 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=958 --- Mesa-drivers.changes | 5 +++++ Mesa-drivers.spec | 5 ++++- add-lifetime-dse-fix.patch | 46 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 add-lifetime-dse-fix.patch diff --git a/Mesa-drivers.changes b/Mesa-drivers.changes index 9753ad4..3775005 100644 --- a/Mesa-drivers.changes +++ b/Mesa-drivers.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 19 19:22:02 UTC 2020 - Martin Liška + +- Add add-lifetime-dse-fix.patch as a proper fix for boo#1171855. + ------------------------------------------------------------------- Tue May 19 05:52:31 UTC 2020 - Martin Liška diff --git a/Mesa-drivers.spec b/Mesa-drivers.spec index 76ae8c5..4dc47e5 100644 --- a/Mesa-drivers.spec +++ b/Mesa-drivers.spec @@ -32,8 +32,9 @@ # Note that if you actually need to render something, you need the packages # from Mesa-driver. -# Disable LTO for now boo#1171855 +%ifarch armv6l armv6hl %define _lto_cflags %{nil} +%endif ##### WARNING: please do not edit this auto generated spec file. Use the Mesa.spec! ##### %define drivers 1 @@ -128,6 +129,7 @@ Source4: manual-pages.tar.bz2 Source6: %{name}-rpmlintrc Source7: Mesa.keyring Patch2: n_add-Mesa-headers-again.patch +Patch3: add-lifetime-dse-fix.patch # never to be upstreamed Patch54: n_drirc-disable-rgb10-for-chromium-on-amd.patch Patch58: u_dep_xcb.patch @@ -735,6 +737,7 @@ programs against the XA state tracker. rm -rf docs/README.{VMS,WIN32,OS2} %patch2 -p1 +%patch3 -p1 %patch54 -p1 %patch58 -p1 diff --git a/add-lifetime-dse-fix.patch b/add-lifetime-dse-fix.patch new file mode 100644 index 0000000..ae8f4dd --- /dev/null +++ b/add-lifetime-dse-fix.patch @@ -0,0 +1,46 @@ +From 9a72afaea7bf69f07623cae1af99f71be64688ba Mon Sep 17 00:00:00 2001 +From: Danylo Piliaiev +Date: Tue, 19 May 2020 20:35:49 +0300 +Subject: [PATCH] meson: Disable GCC's dead store elimination for memory + zeroing custom new + +Some classes use custom new operator which zeroes memory, however gcc does +aggressive dead-store elimination which threats all writes to the memory +before the constructor as "dead stores". + +For now we disable this optimization. + +The new operators in question are declared via: + DECLARE_RZALLOC_CXX_OPERATORS + DECLARE_LINEAR_ZALLOC_CXX_OPERATORS + +The issue was found with lto builds, however there is no guarantee that +it didn't happen with ordinary ones. + +CC: +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2977 +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1358 +Signed-off-by: Danylo Piliaiev +--- + meson.build | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/meson.build b/meson.build +index 1a207842c55..3d4ea165c99 100644 +--- a/meson.build ++++ b/meson.build +@@ -980,6 +980,11 @@ else + '-fno-math-errno', + '-fno-trapping-math', + '-Qunused-arguments', ++ # Some classes use custom new operator which zeroes memory, however ++ # gcc does aggressive dead-store elimination which threats all writes ++ # to the memory before the constructor as "dead stores". ++ # For now we disable this optimization. ++ '-flifetime-dse=1', + ] + # MinGW chokes on format specifiers and I can't get it all working + if not (cc.get_id() == 'gcc' and host_machine.system() == 'windows') +-- +2.26.2 +