render / rpms / edk2

Forked from rpms/edk2 3 months ago
Clone

Blame 0032-Basetools-turn-off-gcc12-warning.patch

Gerd Hoffmann e3d786
From 15e8ff0438387a1737f136ab8f1ad513cfb52993 Mon Sep 17 00:00:00 2001
Gerd Hoffmann e3d786
From: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann e3d786
Date: Thu, 24 Mar 2022 10:28:45 +0100
Gerd Hoffmann e3d786
Subject: [PATCH 32/32] Basetools: turn off gcc12 warning
Gerd Hoffmann e3d786
MIME-Version: 1.0
Gerd Hoffmann e3d786
Content-Type: text/plain; charset=UTF-8
Gerd Hoffmann e3d786
Content-Transfer-Encoding: 8bit
Gerd Hoffmann e3d786
Gerd Hoffmann e3d786
In function ‘SetDevicePathEndNode’,
Gerd Hoffmann e3d786
    inlined from ‘FileDevicePath’ at DevicePathUtilities.c:857:5:
Gerd Hoffmann e3d786
DevicePathUtilities.c:321:3: error: writing 4 bytes into a region of size 1 [-Werror=stringop-overflow=]
Gerd Hoffmann e3d786
  321 |   memcpy (Node, &mUefiDevicePathLibEndDevicePath, sizeof (mUefiDevicePathLibEndDevicePath));
Gerd Hoffmann e3d786
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gerd Hoffmann e3d786
In file included from UefiDevicePathLib.h:22,
Gerd Hoffmann e3d786
                 from DevicePathUtilities.c:16:
Gerd Hoffmann e3d786
../Include/Protocol/DevicePath.h: In function ‘FileDevicePath’:
Gerd Hoffmann e3d786
../Include/Protocol/DevicePath.h:51:9: note: destination object ‘Type’ of size 1
Gerd Hoffmann e3d786
   51 |   UINT8 Type;       ///< 0x01 Hardware Device Path.
Gerd Hoffmann e3d786
      |         ^~~~
Gerd Hoffmann e3d786
Gerd Hoffmann e3d786
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann e3d786
---
Gerd Hoffmann e3d786
 BaseTools/Source/C/DevicePath/GNUmakefile | 3 +++
Gerd Hoffmann e3d786
 1 file changed, 3 insertions(+)
Gerd Hoffmann e3d786
Gerd Hoffmann e3d786
diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
Gerd Hoffmann e3d786
index 7ca08af9662d..b05d2bddfa68 100644
Gerd Hoffmann e3d786
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
Gerd Hoffmann e3d786
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
Gerd Hoffmann e3d786
@@ -13,6 +13,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
Gerd Hoffmann e3d786
 
Gerd Hoffmann e3d786
 include $(MAKEROOT)/Makefiles/app.makefile
Gerd Hoffmann e3d786
 
Gerd Hoffmann e3d786
+# gcc 12 trips over device path handling
Gerd Hoffmann e3d786
+BUILD_CFLAGS += -Wno-error=stringop-overflow
Gerd Hoffmann e3d786
+
Gerd Hoffmann e3d786
 LIBS = -lCommon
Gerd Hoffmann e3d786
 ifeq ($(CYGWIN), CYGWIN)
Gerd Hoffmann e3d786
   LIBS += -L/lib/e2fsprogs -luuid
Gerd Hoffmann e3d786
-- 
Gerd Hoffmann e3d786
2.35.1
Gerd Hoffmann e3d786