diff --git a/mflash-add-missing-stlib-include.patch b/mflash-add-missing-stlib-include.patch new file mode 100644 index 0000000..3d8a871 --- /dev/null +++ b/mflash-add-missing-stlib-include.patch @@ -0,0 +1,40 @@ +commit df180102768284a7223ada6d7243531f9e9be2c7 +Author: Nicolas Morey +Date: Thu Sep 5 14:08:06 2024 +0200 + + mflash: add missing stlib include + + Add missing include to fix GCC 14 build error: + In file included from mflash_dev_capability.c:42: + mflash_dev_capability.c: In function 'get_flash_gen': + mflash_dev_capability.h:67:27: error: implicit declaration of function 'getenv' [-Wimplicit-function-declaration] + 67 | char* reacDebug = getenv("FLASH_DEBUG"); \ + | ^~~~~~ + mflash_dev_capability.c:186:5: note: in expansion of macro 'DPRINTF' + 186 | DPRINTF(("get_flash_gen: flash_gen = %d\n", gen)); + | ^~~~~~~ + mflash_dev_capability.c:43:1: note: 'getenv' is defined in header ''; this is probably fixable by adding '#include ' + 42 | #include "mflash_dev_capability.h" + +++ |+#include + 43 | + mflash_dev_capability.h:67:27: error: initialization of 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] + 67 | char* reacDebug = getenv("FLASH_DEBUG"); \ + | ^~~~~~ + mflash_dev_capability.c:186:5: note: in expansion of macro 'DPRINTF' + 186 | DPRINTF(("get_flash_gen: flash_gen = %d\n", gen)); + | ^~~~~~~ + + Signed-off-by: Nicolas Morey + +diff --git mflash/mflash_dev_capability.h mflash/mflash_dev_capability.h +index d63b7cffaf90..ce850a982d84 100644 +--- mflash/mflash_dev_capability.h ++++ mflash/mflash_dev_capability.h +@@ -42,6 +42,7 @@ + #ifndef USER_MFLASH_MFLASH_DEV_CAPABILITY_H_ + #define USER_MFLASH_MFLASH_DEV_CAPABILITY_H_ + ++#include + #include "mflash_pack_layer.h" + + #ifndef UEFI_BUILD diff --git a/mstflint.changes b/mstflint.changes index 870bc05..87f5fc7 100644 --- a/mstflint.changes +++ b/mstflint.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 5 12:11:14 UTC 2024 - Nicolas Morey + +- Add mflash-add-missing-stlib-include.patch to fix compilation + with GCC >= 14 + ------------------------------------------------------------------- Thu Feb 22 13:26:27 UTC 2024 - pgajdos@suse.com diff --git a/mstflint.spec b/mstflint.spec index a83ed2f..6d4553f 100644 --- a/mstflint.spec +++ b/mstflint.spec @@ -31,6 +31,7 @@ Patch1: Remove-date-time-info-from-build.patch Patch4: Fix-gcc7-and-gcc8.patch Patch5: fix-race-condition-during-install.patch Patch6: PIE.patch +Patch7: mflash-add-missing-stlib-include.patch BuildRequires: gcc-c++ BuildRequires: infiniband-diags-devel BuildRequires: libibverbs-devel