diff --git a/0001-Fix-GCC-12-dangling-pointer-warning.patch b/0001-Fix-GCC-12-dangling-pointer-warning.patch new file mode 100644 index 0000000..d136517 --- /dev/null +++ b/0001-Fix-GCC-12-dangling-pointer-warning.patch @@ -0,0 +1,54 @@ +From aea0a5cfce262ce2ab16fd96d87c12cf5e756380 Mon Sep 17 00:00:00 2001 +From: Philip Prindeville +Date: Wed, 12 Apr 2023 10:18:20 -0600 +Subject: [PATCH] Fix GCC 12 dangling-pointer warning + +We're storing a persistent pointer to an ephemeral local variable +which technically is a dangling pointer and the compiler is correct. +However, since we never indirect the pointer, this is a safe +operation and we can suppress the warning. + +Also, some C run-times (like MUSL) aren't including +indirectly so we must include it explicitly or we won't have the +type definition for uintptr_t. + +Fixes issue #867. + +Signed-off-by: Philip Prindeville +--- + source/components/utilities/utdebug.c | 5 +++++ + source/include/platform/aclinux.h | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c +index 0060fdf..2f60bca 100644 +--- a/source/components/utilities/utdebug.c ++++ b/source/components/utilities/utdebug.c +@@ -77,7 +77,12 @@ AcpiUtInitStackPtrTrace ( + ACPI_SIZE CurrentSp; + + ++#pragma GCC diagnostic push ++#if defined(__GNUC__) && __GNUC__ >= 12 ++#pragma GCC diagnostic ignored "-Wdangling-pointer=" ++#endif + AcpiGbl_EntryStackPointer = &CurrentSp; ++#pragma GCC diagnostic pop + } + + +diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h +index 52a3293..20680d0 100644 +--- a/source/include/platform/aclinux.h ++++ b/source/include/platform/aclinux.h +@@ -198,6 +198,7 @@ + + #ifdef ACPI_USE_STANDARD_HEADERS + #include ++#include + #endif + + /* Define/disable kernel-specific declarators */ +-- +2.33.0 + diff --git a/acpica-tools.spec b/acpica-tools.spec index 563d6ec..790043b 100644 --- a/acpica-tools.spec +++ b/acpica-tools.spec @@ -1,6 +1,6 @@ Name: acpica-tools Version: 20210604 -Release: 2 +Release: 3 Summary: Tools for OS-independent reference implementation of ACPI License: GPLv2 @@ -10,12 +10,12 @@ Source0: https://acpica.org/sites/acpica/files/acpica-unix2-%{version}.ta Source1: https://acpica.org/sites/acpica/files/acpitests-unix-%{version}.tar.gz Source2: COPYING -Patch0001: cve-2017-13693.patch -Patch0002: cve-2017-13694.patch -Patch0003: cve-2017-13695.patch -Patch0004: openEuler-harden.patch +Patch0001: cve-2017-13693.patch +Patch0002: cve-2017-13694.patch +Patch0003: cve-2017-13695.patch +Patch0004: openEuler-harden.patch Patch0005: 0001-add-loongarch64-support-for-acpica-tools.patch - +Patch0006: 0001-Fix-GCC-12-dangling-pointer-warning.patch BuildRequires: bison patchutils flex gcc Provides: acpixtract >= 20120913-7 iasl = %{version}-%{release} acpidump >= 20100513-5 Provides: pmtools = %{version}-%{release} @@ -86,6 +86,9 @@ fi %{_docdir}/* %changelog +* Tue Jul 18 2023 Ni Cunshu - 20210604-3 +- fix building error caused by gcc 12 dangling pointer warning + * Mon May 8 2023 Wenlong Zhang - 20210604-2 - add loongarch64 support