Blame SOURCES/dbtest.patch

214d7a
On s390, GCC does not like the string initialization in this case.  When
214d7a
ValueToWrite is initialized this way, GCC tries to copy the entire string
214d7a
into an ACPI_OBJECT instead of just the pointer (see the use in the call
214d7a
to memcpy()).  So, move the init so GCC recognizes that ValueToWrite is
214d7a
only a pointer, and not a whole string that needs to be moved.
214d7a
214d7a
Index: acpica-unix2-20200925/source/components/debugger/dbtest.c
214d7a
===================================================================
214d7a
--- acpica-unix2-20200925.orig/source/components/debugger/dbtest.c
214d7a
+++ acpica-unix2-20200925/source/components/debugger/dbtest.c
214d7a
@@ -719,9 +719,10 @@ AcpiDbTestStringType (
214d7a
     ACPI_OBJECT             *Temp1 = NULL;
214d7a
     ACPI_OBJECT             *Temp2 = NULL;
214d7a
     ACPI_OBJECT             *Temp3 = NULL;
214d7a
-    char                    *ValueToWrite = "Test String from AML Debugger";
214d7a
+    char                    *ValueToWrite = NULL;
214d7a
     ACPI_OBJECT             WriteValue;
214d7a
     ACPI_STATUS             Status;
214d7a
+    const char              *TestStr = "Test String from AML Debugger";
214d7a
 
214d7a
 
214d7a
     /* Read the original value */
214d7a
@@ -737,6 +738,9 @@ AcpiDbTestStringType (
214d7a
 
214d7a
     /* Write a new value */
214d7a
 
214d7a
+    ValueToWrite = AcpiOsAllocateZeroed(strlen(TestStr)+1);
214d7a
+    strncpy(ValueToWrite, TestStr, strlen(TestStr)+1);
214d7a
+
214d7a
     WriteValue.Type = ACPI_TYPE_STRING;
214d7a
     WriteValue.String.Length = strlen (ValueToWrite);
214d7a
     WriteValue.String.Pointer = ValueToWrite;
214d7a
@@ -790,6 +794,7 @@ Exit:
214d7a
     if (Temp1) {AcpiOsFree (Temp1);}
214d7a
     if (Temp2) {AcpiOsFree (Temp2);}
214d7a
     if (Temp3) {AcpiOsFree (Temp3);}
214d7a
+    if (ValueToWrite) {AcpiOsFree (ValueToWrite);}
214d7a
     return (Status);
214d7a
 }
214d7a