From 40ecf1a81f2ac688d0a43490a0bb01aef03e1a8edefd135cb762b53bf7ed461f Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 9 Jan 2020 14:28:55 +0000 Subject: [PATCH] Accepting request 762024 from home:mcepl:branches:devel:libraries:c_c++ - Add fno-common-build-errs.patch which fixes gh#libuv/libuv#2603 (bsc#1160280) OBS-URL: https://build.opensuse.org/request/show/762024 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libuv?expand=0&rev=37 --- fno-common-build-errs.patch | 82 +++++++++++++++++++++++++++++++++++++ libuv.changes | 6 +++ libuv.spec | 7 +++- 3 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 fno-common-build-errs.patch diff --git a/fno-common-build-errs.patch b/fno-common-build-errs.patch new file mode 100644 index 0000000..267bb00 --- /dev/null +++ b/fno-common-build-errs.patch @@ -0,0 +1,82 @@ +From 35a43bdbfd9c4d6d875e92903799e693d5ac18ac Mon Sep 17 00:00:00 2001 +From: Ben Noordhuis +Date: Tue, 7 Jan 2020 15:21:03 +0100 +Subject: [PATCH 1/2] test: fix -fno-common build errors + +Fixes: https://github.com/libuv/libuv/issues/2603 +--- + test/test-poll-close-doesnt-corrupt-stack.c | 6 ++---- + test/test-poll-closesocket.c | 5 ++--- + 2 files changed, 4 insertions(+), 7 deletions(-) + +diff --git a/test/test-poll-close-doesnt-corrupt-stack.c b/test/test-poll-close-doesnt-corrupt-stack.c +index 3393820fc4..1d7e84f603 100644 +--- a/test/test-poll-close-doesnt-corrupt-stack.c ++++ b/test/test-poll-close-doesnt-corrupt-stack.c +@@ -31,11 +31,9 @@ + # define NO_INLINE __attribute__ ((noinline)) + #endif + +- +-uv_os_sock_t sock; +-uv_poll_t handle; +- + #ifdef _WIN32 ++static uv_os_sock_t sock; ++static uv_poll_t handle; + static int close_cb_called = 0; + + +diff --git a/test/test-poll-closesocket.c b/test/test-poll-closesocket.c +index ecaa9e54a2..1a1c364112 100644 +--- a/test/test-poll-closesocket.c ++++ b/test/test-poll-closesocket.c +@@ -25,10 +25,9 @@ + #include "uv.h" + #include "task.h" + +-uv_os_sock_t sock; +-uv_poll_t handle; +- + #ifdef _WIN32 ++static uv_os_sock_t sock; ++static uv_poll_t handle; + static int close_cb_called = 0; + + + +From 5de278e32e50e7600e7aa3d88199e0a51d016b79 Mon Sep 17 00:00:00 2001 +From: Ben Noordhuis +Date: Tue, 7 Jan 2020 15:21:03 +0100 +Subject: [PATCH 2/2] build: turn on -fno-common to catch regressions + +Refs: https://github.com/libuv/libuv/issues/2603 +--- + common.gypi | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/common.gypi b/common.gypi +index 2297bdf0fb..8e2aa7160b 100644 +--- a/common.gypi ++++ b/common.gypi +@@ -35,7 +35,7 @@ + }, + 'conditions': [ + ['OS != "zos"', { +- 'cflags': [ '-O0', '-fwrapv' ] ++ 'cflags': [ '-O0', '-fno-common', '-fwrapv' ] + }], + ['OS == "android"', { + 'cflags': [ '-fPIE' ], +@@ -80,9 +80,10 @@ + 'conditions': [ + ['OS != "zos"', { + 'cflags': [ +- '-fomit-frame-pointer', + '-fdata-sections', + '-ffunction-sections', ++ '-fno-common', ++ '-fomit-frame-pointer', + ], + }], + ] diff --git a/libuv.changes b/libuv.changes index 238cdad..7a4ca58 100644 --- a/libuv.changes +++ b/libuv.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 8 23:29:48 CET 2020 - Matej Cepl + +- Add fno-common-build-errs.patch which fixes gh#libuv/libuv#2603 + (bsc#1160280) + ------------------------------------------------------------------- Sun Sep 1 09:34:38 UTC 2019 - Andreas Stieger diff --git a/libuv.spec b/libuv.spec index 193f165..07fa17f 100644 --- a/libuv.spec +++ b/libuv.spec @@ -1,7 +1,7 @@ # # spec file for package libuv # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,9 @@ Source1: https://dist.libuv.org/dist/v%{version}/libuv-v%{version}.tar.gz # https://github.com/libuv/libuv/blob/v1.x/MAINTAINERS.md Source2: %{name}.keyring Patch1: fix_tests.patch +# PATCH-FIX-UPSTREAM fno-common-build-errs.patch gh#libuv/libuv#2603 mcepl@suse.com +# Builds with -fno-common fails in run_tests-test-poll-close-doesnt-corrupt-stack.c +Patch2: fno-common-build-errs.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool @@ -63,7 +66,7 @@ Mozilla's Rust language, Luvit, Julia, pyuv, and others. %prep %setup -q -n %{name}-v%{version} -%patch1 -p1 +%autopatch -p1 %build ./autogen.sh