* [Buildroot] [PATCH] boot/edk2: fix build with gcc 15
@ 2026-03-24 15:02 Vincent Stehlé
2026-03-24 21:02 ` Julien Olivain via buildroot
2026-04-03 10:28 ` Thomas Perale via buildroot
0 siblings, 2 replies; 3+ messages in thread
From: Vincent Stehlé @ 2026-03-24 15:02 UTC (permalink / raw)
To: buildroot; +Cc: Vincent Stehlé, Dick Olsson
The edk2 package fails to build with gcc 15, with the following error:
EfiRom.c:78:17: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
Cherry-pick one patch from edk2-stable202602 to fix this.
This can be verified with the tests.boot.test_edk2 python tests.
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Dick Olsson <hi@senzilla.io>
---
...aseTools-EfiRom-fix-compiler-warning.patch | 46 +++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 boot/edk2/0001-BaseTools-EfiRom-fix-compiler-warning.patch
diff --git a/boot/edk2/0001-BaseTools-EfiRom-fix-compiler-warning.patch b/boot/edk2/0001-BaseTools-EfiRom-fix-compiler-warning.patch
new file mode 100644
index 0000000000..c1e688cfe0
--- /dev/null
+++ b/boot/edk2/0001-BaseTools-EfiRom-fix-compiler-warning.patch
@@ -0,0 +1,46 @@
+From 9af06ef3cbb052b142f9660c2c01e7aeb401300c Mon Sep 17 00:00:00 2001
+From: Gerd Hoffmann <kraxel@redhat.com>
+Date: Mon, 8 Dec 2025 10:28:50 +0100
+Subject: [PATCH] BaseTools/EfiRom: fix compiler warning
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+New warning after updating gcc:
+
+EfiRom.c: In function ‘main’:
+EfiRom.c:78:17: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
+
+The assigned value is not used, so fix the warning by just removing it.
+
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Upstream: https://github.com/tianocore/edk2/commit/9af06ef3cbb052b142f9660c2c01e7aeb401300c
+Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
+---
+ BaseTools/Source/C/EfiRom/EfiRom.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/BaseTools/Source/C/EfiRom/EfiRom.c b/BaseTools/Source/C/EfiRom/EfiRom.c
+index fa7bf0e62e..6e903b3504 100644
+--- a/BaseTools/Source/C/EfiRom/EfiRom.c
++++ b/BaseTools/Source/C/EfiRom/EfiRom.c
+@@ -44,7 +44,6 @@ Returns:
+ FILE_LIST *FList;
+ UINT32 TotalSize;
+ UINT32 Size;
+- CHAR8 *Ptr0;
+
+ SetUtilityName(UTILITY_NAME);
+
+@@ -75,7 +74,7 @@ Returns:
+ //
+ if (mOptions.DumpOption == 1) {
+ if (mOptions.FileList != NULL) {
+- if ((Ptr0 = strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION)) != NULL) {
++ if (strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION) != NULL) {
+ DumpImage (mOptions.FileList);
+ goto BailOut;
+ } else {
+--
+2.53.0
+
--
2.53.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] boot/edk2: fix build with gcc 15
2026-03-24 15:02 [Buildroot] [PATCH] boot/edk2: fix build with gcc 15 Vincent Stehlé
@ 2026-03-24 21:02 ` Julien Olivain via buildroot
2026-04-03 10:28 ` Thomas Perale via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Julien Olivain via buildroot @ 2026-03-24 21:02 UTC (permalink / raw)
To: Vincent Stehlé; +Cc: buildroot, Dick Olsson
Hi Vincent,
On 24/03/2026 16:02, Vincent Stehlé wrote:
> The edk2 package fails to build with gcc 15, with the following error:
>
> EfiRom.c:78:17: error: assignment discards 'const' qualifier from
> pointer target type [-Werror=discarded-qualifiers]
>
> Cherry-pick one patch from edk2-stable202602 to fix this.
>
> This can be verified with the tests.boot.test_edk2 python tests.
>
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> Cc: Dick Olsson <hi@senzilla.io>
The test in the CI is using (target) gcc 15 and was working fine:
https://gitlab.com/buildroot.org/buildroot/-/jobs/13598975585
So I investigated a bit more and found the issue was actually
happening with *host* gcc 15 *and glibc 2.43*. So I updated the
commit title to reflect that and applied to master, thanks!
See:
https://gitlab.com/buildroot.org/buildroot/-/commit/d18f7e09162ac3dbe4538fd0e2a3e5ec192e88a4
Best regards,
Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] boot/edk2: fix build with gcc 15
2026-03-24 15:02 [Buildroot] [PATCH] boot/edk2: fix build with gcc 15 Vincent Stehlé
2026-03-24 21:02 ` Julien Olivain via buildroot
@ 2026-04-03 10:28 ` Thomas Perale via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Perale via buildroot @ 2026-04-03 10:28 UTC (permalink / raw)
To: Vincent Stehlé; +Cc: Thomas Perale, buildroot
In reply of:
> The edk2 package fails to build with gcc 15, with the following error:
>
> EfiRom.c:78:17: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>
> Cherry-pick one patch from edk2-stable202602 to fix this.
>
> This can be verified with the tests.boot.test_edk2 python tests.
>
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> Cc: Dick Olsson <hi@senzilla.io>
Applied to 2026.02.x. Thanks
> ---
> ...aseTools-EfiRom-fix-compiler-warning.patch | 46 +++++++++++++++++++
> 1 file changed, 46 insertions(+)
> create mode 100644 boot/edk2/0001-BaseTools-EfiRom-fix-compiler-warning.patch
>
> diff --git a/boot/edk2/0001-BaseTools-EfiRom-fix-compiler-warning.patch b/boot/edk2/0001-BaseTools-EfiRom-fix-compiler-warning.patch
> new file mode 100644
> index 0000000000..c1e688cfe0
> --- /dev/null
> +++ b/boot/edk2/0001-BaseTools-EfiRom-fix-compiler-warning.patch
> @@ -0,0 +1,46 @@
> +From 9af06ef3cbb052b142f9660c2c01e7aeb401300c Mon Sep 17 00:00:00 2001
> +From: Gerd Hoffmann <kraxel@redhat.com>
> +Date: Mon, 8 Dec 2025 10:28:50 +0100
> +Subject: [PATCH] BaseTools/EfiRom: fix compiler warning
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +New warning after updating gcc:
> +
> +EfiRom.c: In function ‘main’:
> +EfiRom.c:78:17: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
> +
> +The assigned value is not used, so fix the warning by just removing it.
> +
> +Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> +Upstream: https://github.com/tianocore/edk2/commit/9af06ef3cbb052b142f9660c2c01e7aeb401300c
> +Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> +---
> + BaseTools/Source/C/EfiRom/EfiRom.c | 3 +--
> + 1 file changed, 1 insertion(+), 2 deletions(-)
> +
> +diff --git a/BaseTools/Source/C/EfiRom/EfiRom.c b/BaseTools/Source/C/EfiRom/EfiRom.c
> +index fa7bf0e62e..6e903b3504 100644
> +--- a/BaseTools/Source/C/EfiRom/EfiRom.c
> ++++ b/BaseTools/Source/C/EfiRom/EfiRom.c
> +@@ -44,7 +44,6 @@ Returns:
> + FILE_LIST *FList;
> + UINT32 TotalSize;
> + UINT32 Size;
> +- CHAR8 *Ptr0;
> +
> + SetUtilityName(UTILITY_NAME);
> +
> +@@ -75,7 +74,7 @@ Returns:
> + //
> + if (mOptions.DumpOption == 1) {
> + if (mOptions.FileList != NULL) {
> +- if ((Ptr0 = strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION)) != NULL) {
> ++ if (strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION) != NULL) {
> + DumpImage (mOptions.FileList);
> + goto BailOut;
> + } else {
> +--
> +2.53.0
> +
> --
> 2.53.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-03 10:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 15:02 [Buildroot] [PATCH] boot/edk2: fix build with gcc 15 Vincent Stehlé
2026-03-24 21:02 ` Julien Olivain via buildroot
2026-04-03 10:28 ` Thomas Perale via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox