Skip to contentSkip to conversation

Dist Archive and Clang Build Fixes

PATCH In review Andrew Hamilton 2 participants 6 messages Oct 25, 2025 – Oct 27, 2025

lore
Share & tools
lore
#0 lore raw

cover Dist Archive and Clang Build Fixes

Add several additional files to the dist archive:
MAINTAINERS
SECURITY
zstd test support files
tpm2key.asn file
These now show up in the dist archive such as created with "make dist-gzip".

Correct build error with Clang targetting EFI. This was caused by Clang flagging a missing initializer for "vendor_defined_data" which is a zero length array. Add a conditional compile pragma to allow Clang to build this. To reproduce the issue:
./configure BUILD_CC=clang HOST_CC=clang TARGET_CC=clang CC=clang make
<observe error>

Andrew Hamilton (4):
build: Include MAINTAINERS and SECURITY files in dist archive
build: Include new zstd test support files in dist archive
build: Add tpm2asn file for reference to dist archive loader/efi/linux: Fix Compile Error With Clang

 conf/Makefile.extra-dist     | 5 +++++
 grub-core/loader/efi/linux.c | 8 ++++++++
 2 files changed, 13 insertions(+)
Signature · 7 lines
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#1 lore raw

PATCH 1/4 build: Include MAINTAINERS and SECURITY files in dist archive

Include the MAINTAINERS and SECURITY files in the dist archive for reference in distributed archives by end users.

---
 conf/Makefile.extra-dist | 2 ++
 1 file changed, 2 insertions(+)
conf/Makefile.extra-dist +2 -0
index dcb0bed07..936d3bef6 100644
@@ -83,6 +83,8 @@ EXTRA_DIST += grub-core/lib/LzmaDec.c
 EXTRA_DIST += grub-core/fs/cpio_common.c
 
 EXTRA_DIST += BUGS
+EXTRA_DIST += MAINTAINERS
+EXTRA_DIST += SECURITY
 EXTRA_DIST += util/i386/efi/grub-dumpdevtree
 EXTRA_DIST += util/spkmodem-recv.c
 EXTRA_DIST += util/import_gcrypth.sed
Signature · 7 lines
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#2 lore raw

PATCH 2/4 build: Include new zstd test support files in dist archive

In reply to Andrew Hamilton

Include the two new zstd test support files in the dist archive so end users can successfully run this test.

---
 conf/Makefile.extra-dist | 2 ++
 1 file changed, 2 insertions(+)
conf/Makefile.extra-dist +2 -0
index 936d3bef6..6b276b187 100644
@@ -183,6 +183,8 @@ EXTRA_DIST += tests/file_filter/file.lzop
 EXTRA_DIST += tests/file_filter/file.lzop.sig
 EXTRA_DIST += tests/file_filter/file.xz
 EXTRA_DIST += tests/file_filter/file.xz.sig
+EXTRA_DIST += tests/file_filter/file.zstd
+EXTRA_DIST += tests/file_filter/file.zstd.sig
 EXTRA_DIST += tests/file_filter/keys
 EXTRA_DIST += tests/file_filter/keys.pub
 EXTRA_DIST += tests/file_filter/test.cfg
Signature · 7 lines
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#3 lore raw

PATCH 3/4 build: Add tpm2asn file for reference to dist archive

In reply to Andrew Hamilton

Add the tpm2asn file to the dist archive for reference by end users.

---
 conf/Makefile.extra-dist | 1 +
 1 file changed, 1 insertion(+)
conf/Makefile.extra-dist +1 -0
index 6b276b187..288ba1f87 100644
@@ -75,6 +75,7 @@ EXTRA_DIST += grub-core/efiemu/runtime/config.h
 EXTRA_DIST += grub-core/tests/asn1/asn1_test.h
 EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/tests/asn1/tests -name '*.h')
 EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/commands/tpm2_key_protector -name '*.h')
+EXTRA_DIST += grub-core/commands/tpm2_key_protector/tpm2key.asn
 
 EXTRA_DIST += grub-core/commands/appendedsig/appendedsig.h
 
Signature · 7 lines
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#4 lore raw

PATCH 4/4 loader/efi/linux: Fix Compile Error With Clang

In reply to Andrew Hamilton

Clang will produce a warning (which is treated as an error) that "vendor_defined_data" is uninitialized. This is a "zero length" array member of this struct. Add conditional compile pragma to allow this to compile with Clang.

---
 grub-core/loader/efi/linux.c | 8 ++++++++
 1 file changed, 8 insertions(+)
grub-core/loader/efi/linux.c +8 -0
index 4f5589862..ded507cd5 100644
@@ -55,6 +55,14 @@ static bool initrd_use_loadfile2 = false;
 static grub_guid_t load_file2_guid = GRUB_EFI_LOAD_FILE2_PROTOCOL_GUID;
 static grub_guid_t device_path_guid = GRUB_EFI_DEVICE_PATH_GUID;
 
+/*
+ * Clang will produce a warning for missing initializer for the
+ * zero-length array "vendor_defined_data" inside this structure.
+ * Suppress this warning which is treated as an error.
+ */
+#ifdef __clang__
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
 static initrd_media_device_path_t initrd_lf2_device_path = {
   {
     {
Signature · 7 lines
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#5 lore raw
In reply to Andrew Hamilton
Quoted 17 lines · Andrew Hamilton

Add several additional files to the dist archive:
MAINTAINERS
SECURITY
zstd test support files
tpm2key.asn file
These now show up in the dist archive such as created with "make dist-gzip".

Correct build error with Clang targetting EFI. This was caused by Clang flagging a missing initializer for "vendor_defined_data" which is a zero length array. Add a conditional compile pragma to allow Clang to build this. To reproduce the issue:
./configure BUILD_CC=clang HOST_CC=clang TARGET_CC=clang CC=clang make
<observe error>

Quoted 5 lines

Andrew Hamilton (4):
build: Include MAINTAINERS and SECURITY files in dist archive
build: Include new zstd test support files in dist archive
build: Add tpm2asn file for reference to dist archive loader/efi/linux: Fix Compile Error With Clang

For all patches Reviewed-by: Daniel Kiper <[email protected]>...

Thank you for fixing these issues!

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel