Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] support/testing: add zip test
@ 2024-05-10 23:55 Brandon Maier via buildroot
  2024-05-10 23:55 ` [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14 Brandon Maier via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Brandon Maier via buildroot @ 2024-05-10 23:55 UTC (permalink / raw)
  To: buildroot; +Cc: Jan Pedersen, Brandon Maier

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
 support/testing/tests/package/test_zip.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 support/testing/tests/package/test_zip.py

diff --git a/support/testing/tests/package/test_zip.py b/support/testing/tests/package/test_zip.py
new file mode 100644
index 0000000000..eb2e016988
--- /dev/null
+++ b/support/testing/tests/package/test_zip.py
@@ -0,0 +1,15 @@
+from tests.package.test_compressor_base import TestCompressorBase
+
+
+class TestZip(TestCompressorBase):
+    __test__ = True
+    config = TestCompressorBase.config + \
+        """
+        BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+        BR2_PACKAGE_ZIP=y
+        BR2_PACKAGE_UNZIP=y
+        """
+    compress_cmd = "/bin/sh -c 'zip $1.zip $1' /bin/sh"
+    decompress_cmd = "unzip"
+    check_integrity_cmd = "unzip -t"
+    compressed_file_ext = ".zip"
-- 
2.45.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14
  2024-05-10 23:55 [Buildroot] [PATCH 1/2] support/testing: add zip test Brandon Maier via buildroot
@ 2024-05-10 23:55 ` Brandon Maier via buildroot
  2024-05-11  6:56   ` Thomas Petazzoni via buildroot
  2024-06-08  7:44   ` Peter Korsgaard
  2024-05-11  6:54 ` [Buildroot] [PATCH 1/2] support/testing: add zip test Thomas Petazzoni via buildroot
  2024-06-08  7:44 ` Peter Korsgaard
  2 siblings, 2 replies; 6+ messages in thread
From: Brandon Maier via buildroot @ 2024-05-10 23:55 UTC (permalink / raw)
  To: buildroot; +Cc: Jan Pedersen, Brandon Maier

Builds with GCC 14 print the following error

> zip.h:726:10: error: conflicting types for 'memset'; have 'char *(char *, int,  unsigned int)'

This is because with GCC 14, Zip incorrectly detects that the memset functions
exist. Which enables the ZMEM flag and declares its own version of memset.

This is because the ./unix/configure script attempts to compile a C file using
'memset' but it does not include the <string.h>. This was allowed in gnu89, but
in GCC 14 -Werror=implicit-function-declaration is enabled by default[1].

We forcefully set '-std=gnu89' so that Zip will compile everything against
gnu89, which suppresses the warning.

[1] https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
 package/zip/zip.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/zip/zip.mk b/package/zip/zip.mk
index 67958a4a66..3aa59e7ba7 100644
--- a/package/zip/zip.mk
+++ b/package/zip/zip.mk
@@ -31,7 +31,7 @@ ZIP_TARGET_CFLAGS = \
 define ZIP_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
 		CFLAGS="$(ZIP_TARGET_CFLAGS) $(ZIP_CFLAGS)" \
-		AS="$(TARGET_CC) -c" \
+		CC="$(TARGET_CC) -std=gnu89" AS="$(TARGET_CC) -c" \
 		-f unix/Makefile generic
 endef
 
@@ -43,7 +43,7 @@ endef
 define HOST_ZIP_BUILD_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) \
 		CFLAGS="$(HOST_CFLAGS) $(ZIP_CFLAGS)" \
-		AS="$(HOSTCC) -c" \
+		CC="$(HOSTCC) -std=gnu89" AS="$(HOSTCC) -c" \
 		-f unix/Makefile generic
 endef
 
-- 
2.45.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/2] support/testing: add zip test
  2024-05-10 23:55 [Buildroot] [PATCH 1/2] support/testing: add zip test Brandon Maier via buildroot
  2024-05-10 23:55 ` [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14 Brandon Maier via buildroot
@ 2024-05-11  6:54 ` Thomas Petazzoni via buildroot
  2024-06-08  7:44 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-11  6:54 UTC (permalink / raw)
  To: Brandon Maier via buildroot; +Cc: Jan Pedersen, Brandon Maier

On Fri, 10 May 2024 23:55:09 +0000
Brandon Maier via buildroot <buildroot@buildroot.org> wrote:

> Signed-off-by: Brandon Maier <brandon.maier@collins.com>
> ---
>  support/testing/tests/package/test_zip.py | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100644 support/testing/tests/package/test_zip.py

Applied to master after adding an entry in the DEVELOPERS file.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14
  2024-05-10 23:55 ` [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14 Brandon Maier via buildroot
@ 2024-05-11  6:56   ` Thomas Petazzoni via buildroot
  2024-06-08  7:44   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-11  6:56 UTC (permalink / raw)
  To: Brandon Maier via buildroot; +Cc: Jan Pedersen, Brandon Maier

On Fri, 10 May 2024 23:55:10 +0000
Brandon Maier via buildroot <buildroot@buildroot.org> wrote:

> Builds with GCC 14 print the following error
> 
> > zip.h:726:10: error: conflicting types for 'memset'; have 'char *(char *, int,  unsigned int)'  
> 
> This is because with GCC 14, Zip incorrectly detects that the memset functions
> exist. Which enables the ZMEM flag and declares its own version of memset.
> 
> This is because the ./unix/configure script attempts to compile a C file using
> 'memset' but it does not include the <string.h>. This was allowed in gnu89, but
> in GCC 14 -Werror=implicit-function-declaration is enabled by default[1].
> 
> We forcefully set '-std=gnu89' so that Zip will compile everything against
> gnu89, which suppresses the warning.
> 
> [1] https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors
> 
> Signed-off-by: Brandon Maier <brandon.maier@collins.com>
> ---
>  package/zip/zip.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

My first thought was that this should be fixed with a patch, that we
send upstream. However, it seems like the zip 3.0 release we're using
dates back from 2008, and despite an announce of zip 3.1 on the
website, this still hasn't happened. As it's not clear how active
upstream is, I've applied your solution that doesn't involve a patch.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/2] support/testing: add zip test
  2024-05-10 23:55 [Buildroot] [PATCH 1/2] support/testing: add zip test Brandon Maier via buildroot
  2024-05-10 23:55 ` [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14 Brandon Maier via buildroot
  2024-05-11  6:54 ` [Buildroot] [PATCH 1/2] support/testing: add zip test Thomas Petazzoni via buildroot
@ 2024-06-08  7:44 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2024-06-08  7:44 UTC (permalink / raw)
  To: Brandon Maier via buildroot; +Cc: Jan Pedersen, Brandon Maier

>>>>> "Brandon" == Brandon Maier via buildroot <buildroot@buildroot.org> writes:

 > Signed-off-by: Brandon Maier <brandon.maier@collins.com>

Committed to 2024.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14
  2024-05-10 23:55 ` [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14 Brandon Maier via buildroot
  2024-05-11  6:56   ` Thomas Petazzoni via buildroot
@ 2024-06-08  7:44   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2024-06-08  7:44 UTC (permalink / raw)
  To: Brandon Maier via buildroot; +Cc: Jan Pedersen, Brandon Maier

>>>>> "Brandon" == Brandon Maier via buildroot <buildroot@buildroot.org> writes:

 > Builds with GCC 14 print the following error
 >> zip.h:726:10: error: conflicting types for 'memset'; have 'char *(char *, int,  unsigned int)'

 > This is because with GCC 14, Zip incorrectly detects that the memset functions
 > exist. Which enables the ZMEM flag and declares its own version of memset.

 > This is because the ./unix/configure script attempts to compile a C file using
 > 'memset' but it does not include the <string.h>. This was allowed in gnu89, but
 > in GCC 14 -Werror=implicit-function-declaration is enabled by default[1].

 > We forcefully set '-std=gnu89' so that Zip will compile everything against
 > gnu89, which suppresses the warning.

 > [1] https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors

 > Signed-off-by: Brandon Maier <brandon.maier@collins.com>

Committed to 2024.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-08  7:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10 23:55 [Buildroot] [PATCH 1/2] support/testing: add zip test Brandon Maier via buildroot
2024-05-10 23:55 ` [Buildroot] [PATCH 2/2] package/zip: fix build with GCC 14 Brandon Maier via buildroot
2024-05-11  6:56   ` Thomas Petazzoni via buildroot
2024-06-08  7:44   ` Peter Korsgaard
2024-05-11  6:54 ` [Buildroot] [PATCH 1/2] support/testing: add zip test Thomas Petazzoni via buildroot
2024-06-08  7:44 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox