All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/zstd: fix build without st_mtime
@ 2020-07-15 19:29 Fabrice Fontaine
  2020-07-15 21:36 ` Thomas Petazzoni
  2020-07-22  9:02 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2020-07-15 19:29 UTC (permalink / raw)
  To: buildroot

Fixes:
 - http://autobuild.buildroot.org/results/be902c5d110f37bce622a2215191f155b7d3e7e0

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ms-util.c-fix-build-without-st_mtime.patch | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 package/zstd/0001-programs-util.c-fix-build-without-st_mtime.patch

diff --git a/package/zstd/0001-programs-util.c-fix-build-without-st_mtime.patch b/package/zstd/0001-programs-util.c-fix-build-without-st_mtime.patch
new file mode 100644
index 0000000000..0f735b8843
--- /dev/null
+++ b/package/zstd/0001-programs-util.c-fix-build-without-st_mtime.patch
@@ -0,0 +1,40 @@
+From 26d01bdb26f1c7487ad4ba0151221dfe28cd878d Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 15 Jul 2020 21:19:14 +0200
+Subject: [PATCH] programs/util.c: fix build without st_mtime
+
+Since version 1.4.5 and commit
+5af8cb7aea8d890b4801e50e5274371510f2cf33, if st_mtime is not defined,
+programs/util.c uses utime without including utime.h which will raise
+the following build failure on some of the buildroot autobuilders:
+
+util.c: In function 'UTIL_setFileStat':
+util.c:161:24: error: storage size of 'timebuf' isn't known
+         struct utimbuf timebuf;
+                        ^~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/be902c5d110f37bce622a2215191f155b7d3e7e0
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/facebook/zstd/pull/2246]
+---
+ programs/util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/programs/util.c b/programs/util.c
+index a0d45745..2493a4ad 100644
+--- a/programs/util.c
++++ b/programs/util.c
+@@ -28,7 +28,7 @@ extern "C" {
+ #  include <io.h>         /* _chmod */
+ #else
+ #  include <unistd.h>     /* chown, stat */
+-#  if PLATFORM_POSIX_VERSION < 200809L
++#  if PLATFORM_POSIX_VERSION < 200809L || !defined(st_mtime)
+ #    include <utime.h>    /* utime */
+ #  else
+ #    include <fcntl.h>    /* AT_FDCWD */
+-- 
+2.27.0
+
-- 
2.27.0

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

* [Buildroot] [PATCH 1/1] package/zstd: fix build without st_mtime
  2020-07-15 19:29 [Buildroot] [PATCH 1/1] package/zstd: fix build without st_mtime Fabrice Fontaine
@ 2020-07-15 21:36 ` Thomas Petazzoni
  2020-07-22  9:02 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2020-07-15 21:36 UTC (permalink / raw)
  To: buildroot

On Wed, 15 Jul 2020 21:29:05 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fixes:
>  - http://autobuild.buildroot.org/results/be902c5d110f37bce622a2215191f155b7d3e7e0
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

I've applied because the patch was merged upstream. However, I have one
suggestion below.

> diff --git a/package/zstd/0001-programs-util.c-fix-build-without-st_mtime.patch b/package/zstd/0001-programs-util.c-fix-build-without-st_mtime.patch
> new file mode 100644
> index 0000000000..0f735b8843
> --- /dev/null
> +++ b/package/zstd/0001-programs-util.c-fix-build-without-st_mtime.patch
> @@ -0,0 +1,40 @@
> +From 26d01bdb26f1c7487ad4ba0151221dfe28cd878d Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Wed, 15 Jul 2020 21:19:14 +0200
> +Subject: [PATCH] programs/util.c: fix build without st_mtime
> +
> +Since version 1.4.5 and commit
> +5af8cb7aea8d890b4801e50e5274371510f2cf33, if st_mtime is not defined,
> +programs/util.c uses utime without including utime.h which will raise
> +the following build failure on some of the buildroot autobuilders:

I don't think "on some of the buildroot autobuilders" is a very good
justification/explanation. Instead, the explanation should be "fails
with the musl C library", "fails on architecture XYZ because it defines
ABC differently".

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/1] package/zstd: fix build without st_mtime
  2020-07-15 19:29 [Buildroot] [PATCH 1/1] package/zstd: fix build without st_mtime Fabrice Fontaine
  2020-07-15 21:36 ` Thomas Petazzoni
@ 2020-07-22  9:02 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-07-22  9:02 UTC (permalink / raw)
  To: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fixes:
 >  - http://autobuild.buildroot.org/results/be902c5d110f37bce622a2215191f155b7d3e7e0

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2020.02.x and 2020.05.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2020-07-22  9:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 19:29 [Buildroot] [PATCH 1/1] package/zstd: fix build without st_mtime Fabrice Fontaine
2020-07-15 21:36 ` Thomas Petazzoni
2020-07-22  9:02 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.