From d9333ff8a007bf93c5566bbda1362b70ce547e05 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 11 Feb 2022 15:44:57 +0100 Subject: fix build error with GCC 12 using workaround to https://github.com/nginx/unit/issues/639 --- unit-gcc12.patch | 12 ++++++++++++ unit-upstream.patch | 16 ---------------- unit.spec | 20 ++++++++++++++------ 3 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 unit-gcc12.patch delete mode 100644 unit-upstream.patch diff --git a/unit-gcc12.patch b/unit-gcc12.patch new file mode 100644 index 0000000..f62ea5d --- /dev/null +++ b/unit-gcc12.patch @@ -0,0 +1,12 @@ +diff -up ./src/nxt_malloc.c.old ./src/nxt_malloc.c +--- ./src/nxt_malloc.c.old 2022-02-11 15:39:10.953121985 +0100 ++++ ./src/nxt_malloc.c 2022-02-11 15:39:14.419109057 +0100 +@@ -61,6 +61,8 @@ nxt_zalloc(size_t size) + } + + ++# pragma GCC diagnostic ignored "-Wuse-after-free" ++ + void * + nxt_realloc(void *p, size_t size) + { diff --git a/unit-upstream.patch b/unit-upstream.patch deleted file mode 100644 index 8304f65..0000000 --- a/unit-upstream.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/nxt_main_process.c b/src/nxt_main_process.c ---- a/src/nxt_main_process.c -+++ b/src/nxt_main_process.c -@@ -972,9 +972,11 @@ nxt_main_process_sigchld_handler(nxt_tas - - if (rt->nprocesses <= 1) { - nxt_runtime_quit(task, 0); -+ -+ return; - } - -- return; -+ continue; - } - - nxt_port_remove_notify_others(task, process); diff --git a/unit.spec b/unit.spec index 39c2743..eb99906 100644 --- a/unit.spec +++ b/unit.spec @@ -11,13 +11,13 @@ %global gh_owner nginx %global project unit -%global gh_commit 3f9d5872692b9ce617abdd82e69609897631b531 +%global gh_commit 8b954d833110c70f641561fd141b27b2b72a5022 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) Name: unit Summary: NGINX Unit application server -Version: 1.26.0 -Release: 3%{?dist} +Version: 1.26.1 +Release: 2%{?dist} License: ASL 2.0 URL: https://unit.nginx.org/ @@ -33,8 +33,9 @@ Patch0: %{project}-syspol.patch # Workaround for OpenSSL 3.0 # https://github.com/nginx/unit/pull/598 Patch1: %{project}-openssl3.patch -# https://github.com/nginx/unit/issues/600 -Patch2: %{project}-upstream.patch +# Woraroung use-afer-free +# https://github.com/nginx/unit/issues/639 +Patch2: %{project}-gcc12.patch BuildRequires: make BuildRequires: gcc @@ -70,7 +71,7 @@ Library and include files required for NGINX Unit modules development. %setup -qn %{project}-%{gh_commit} %patch0 -p1 -b .syspol %patch1 -p1 -b .openssl3 -%patch2 -p1 -b .stop +%patch2 -p1 -b .gcc12 cp pkg/rpm/rpmbuild/SOURCES/unit.example.config example.config @@ -194,6 +195,13 @@ BANNER %changelog +* Fri Feb 11 2022 Remi Collet - 1.26.1-2 +- fix build error with GCC 12 using workaround to + https://github.com/nginx/unit/issues/639 + +* Thu Dec 2 2021 Remi Collet - 1.26.1-1 +- update to 1.26.1 + * Mon Nov 22 2021 Remi Collet - 1.26.0-3 - add patch proposal for https://github.com/nginx/unit/issues/600 -- cgit