From 85be654ad415afe4c04cf9c88145ef97f08468004418880f8dfcba70eae6c176 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Tue, 6 Feb 2024 07:26:37 +0000 Subject: [PATCH] Accepting request 1144466 from home:michael-chang:bsc:1218949 - Fix build error on gcc-14 (bsc#1218949) * 0001-squash-ieee1275-ofpath-enable-NVMeoF-logical-device-.patch OBS-URL: https://build.opensuse.org/request/show/1144466 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=485 --- ...ofpath-enable-NVMeoF-logical-device-.patch | 60 +++++++++++++++++++ grub2.changes | 6 ++ grub2.spec | 1 + 3 files changed, 67 insertions(+) create mode 100644 0001-squash-ieee1275-ofpath-enable-NVMeoF-logical-device-.patch diff --git a/0001-squash-ieee1275-ofpath-enable-NVMeoF-logical-device-.patch b/0001-squash-ieee1275-ofpath-enable-NVMeoF-logical-device-.patch new file mode 100644 index 0000000..0b7c699 --- /dev/null +++ b/0001-squash-ieee1275-ofpath-enable-NVMeoF-logical-device-.patch @@ -0,0 +1,60 @@ +From 72a582b1c3954f9b917a4d687c95fc94faf551c6 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Wed, 24 Jan 2024 18:03:51 +0800 +Subject: [PATCH] squash! ieee1275/ofpath: enable NVMeoF logical device + translation + +Fixes build error on gcc-14: + +[ 73s] In file included from ../grub-core/osdep/ofpath.c:2: +[ 73s] ../grub-core/osdep/linux/ofpath.c: In function 'of_find_fc_host': +[ 73s] ../grub-core/osdep/linux/ofpath.c:427:22: error: allocation of insufficient size '8' for type 'struct ofpath_files_list_root' with size '16' [-Werror=alloc-size] +[ 73s] 427 | portnames_file_list=malloc(sizeof(portnames_file_list)); +[ 73s] | ^ +[ 73s] ../grub-core/osdep/linux/ofpath.c: In function 'of_path_of_nvme': +[ 73s] ../grub-core/osdep/linux/ofpath.c:589:21: error: allocation of insufficient size '8' for type 'struct ofpath_nvmeof_info' with size '32' [-Werror=alloc-size] +[ 73s] 589 | nvmeof_info = malloc(sizeof(nvmeof_info)); +[ 73s] | ^ +[ 73s] ../grub-core/osdep/linux/ofpath.c:618:21: error: allocation of insufficient size '8' for type 'struct ofpath_nvmeof_info' with size '32' [-Werror=alloc-size] +[ 73s] 618 | nvmeof_info = malloc(sizeof(nvmeof_info)); +[ 73s] | ^ + +Signed-off-by: Michael Chang +--- + grub-core/osdep/linux/ofpath.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c +index 7129099db..55ed7ddf2 100644 +--- a/grub-core/osdep/linux/ofpath.c ++++ b/grub-core/osdep/linux/ofpath.c +@@ -424,7 +424,7 @@ of_find_fc_host(char* host_wwpn){ + + struct ofpath_files_list_root* portnames_file_list; + +- portnames_file_list=malloc(sizeof(portnames_file_list)); ++ portnames_file_list=malloc(sizeof(*portnames_file_list)); + portnames_file_list->items=0; + portnames_file_list->first=NULL; + +@@ -586,7 +586,7 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)), + /* If is a NVMeoF */ + if(strstr(sysfs_path,"nvme-fabrics")){ + struct ofpath_nvmeof_info* nvmeof_info; +- nvmeof_info = malloc(sizeof(nvmeof_info)); ++ nvmeof_info = malloc(sizeof(*nvmeof_info)); + + of_path_get_nvmeof_adapter_info(sysfs_path, nvmeof_info); + +@@ -615,7 +615,7 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)), + sysfs_path = nvme_get_syspath (device); + if(strstr(sysfs_path,"nvme-fabrics")){ + struct ofpath_nvmeof_info* nvmeof_info; +- nvmeof_info = malloc(sizeof(nvmeof_info)); ++ nvmeof_info = malloc(sizeof(*nvmeof_info)); + + of_path_get_nvmeof_adapter_info(sysfs_path, nvmeof_info); + +-- +2.43.0 + diff --git a/grub2.changes b/grub2.changes index 2b9e8e2..a6c949b 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Feb 6 07:19:27 UTC 2024 - Michael Chang + +- Fix build error on gcc-14 (bsc#1218949) + * 0001-squash-ieee1275-ofpath-enable-NVMeoF-logical-device-.patch + ------------------------------------------------------------------- Mon Jan 29 06:24:11 UTC 2024 - Michael Chang diff --git a/grub2.spec b/grub2.spec index 8dcb5df..5fa7229 100644 --- a/grub2.spec +++ b/grub2.spec @@ -389,6 +389,7 @@ Patch195: 0004-Key-revocation-on-out-of-bound-file-access.patch Patch196: fix_no_extra_deps_in_release_tarball.patch Patch197: 0001-fs-xfs-always-verify-the-total-number-of-entries-is-.patch Patch198: 0001-loader-arm64-efi-linux-Remove-magic-number-header-fi.patch +Patch199: 0001-squash-ieee1275-ofpath-enable-NVMeoF-logical-device-.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140