From b2261cf6d374230ab9bd3e25abced6182bffb71f Mon Sep 17 00:00:00 2001 From: Al Stone Date: Tue, 25 Feb 2020 17:13:42 -0700 Subject: [PATCH] Cleanup the armv7hl build issues with string usage Signed-off-by: Al Stone --- acpica-tools.spec | 4 ++-- armv7-str-fixes.patch | 12 ++++++++++++ utstring.patch | 28 ---------------------------- 3 files changed, 14 insertions(+), 30 deletions(-) create mode 100644 armv7-str-fixes.patch delete mode 100644 utstring.patch diff --git a/acpica-tools.spec b/acpica-tools.spec index 72d2ffc..7a69423 100644 --- a/acpica-tools.spec +++ b/acpica-tools.spec @@ -48,7 +48,7 @@ Patch20: aslcodegen.patch Patch21: facp.patch Patch22: dup-symbol.patch Patch23: no-common.patch -Patch24: utstring.patch +Patch24: armv7-str-fixes.patch Patch25: dbtest.patch BuildRequires: bison patchutils flex gcc @@ -125,7 +125,7 @@ gzip -dc %{SOURCE1} | tar -x --strip-components=1 -f - %patch21 -p1 -b .facp %patch22 -p1 -b .dup-symbol %patch23 -p1 -b .no-common -%patch24 -p1 -b .utstring +%patch24 -p1 -b .armv7-str-fixes %patch25 -p1 -b .dbtest cp -p %{SOURCE2} README.Fedora diff --git a/armv7-str-fixes.patch b/armv7-str-fixes.patch new file mode 100644 index 0000000..4de8226 --- /dev/null +++ b/armv7-str-fixes.patch @@ -0,0 +1,12 @@ +diff -Naur acpica-unix2-20200214.orig/source/include/actypes.h acpica-unix2-20200214/source/include/actypes.h +--- acpica-unix2-20200214.orig/source/include/actypes.h 2020-02-25 15:41:26.479349637 -0700 ++++ acpica-unix2-20200214/source/include/actypes.h 2020-02-25 15:44:49.519082258 -0700 +@@ -561,7 +561,7 @@ + #define ACPI_COPY_NAMESEG(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src))) + #else + #define ACPI_COMPARE_NAMESEG(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE)) +-#define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE)) ++#define ACPI_COPY_NAMESEG(dest,src) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE)) + #endif + + /* Support for the special RSDP signature (8 characters) */ diff --git a/utstring.patch b/utstring.patch deleted file mode 100644 index 626042c..0000000 --- a/utstring.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -Naur acpica-unix2-20200214.orig/source/components/utilities/utstring.c acpica-unix2-20200214/source/components/utilities/utstring.c ---- acpica-unix2-20200214.orig/source/components/utilities/utstring.c 2020-02-14 10:33:55.000000000 -0700 -+++ acpica-unix2-20200214/source/components/utilities/utstring.c 2020-02-25 11:21:31.329016004 -0700 -@@ -185,7 +185,7 @@ - { - UINT32 i; - BOOLEAN FoundBadChar = FALSE; -- UINT32 OriginalName; -+ char OriginalName[ACPI_NAMESEG_SIZE+1]; - - - ACPI_FUNCTION_NAME (UtRepairName); -@@ -228,13 +228,13 @@ - { - ACPI_WARNING ((AE_INFO, - "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", -- OriginalName, Name)); -+ (unsigned int)*OriginalName, Name)); - } - else - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", -- OriginalName, Name)); -+ (unsigned int)*OriginalName, Name)); - } - } - }