mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Andreas Pretzsch <apr@cn-eng.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] squashfs-tools: include sysmacros.h for recent systems (glibc 2.28)
Date: Fri, 12 Oct 2018 20:42:38 +0200	[thread overview]
Message-ID: <1539369758-28346-1-git-send-email-apr@cn-eng.de> (raw)

Since glibc 2.28 (and deprecated since 2.25), sys/sysmacros.h
is no longer included from sys/types.h. Explicitly include it,
to have minor(), major() and makedev() defined.
Strictly speaking, it might make sense to replace these calls
also with gnu_dev_minor() et al., as the above #define's are
historical shortcuts, too...

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
---
Hit me when building an old BSP (ptxdist 2016.01 based) on a recent
machine (Ubuntu 18.10) with glibc 2.28. But as squashfs-tools in
current ptxdist is the same, pretty sure it will bite there, too.

Guess there should be no side-effects (with previous glibc versions)
and on other build hosts (like BSD, MacOS, etc.), but didn't check.
@ PTX: Probably better check before applying to mainline.
@ PTX: Feel free to adapt patch in any way.

 ...cros-h-for-recent-systems-glibc-2-28.patch | 39 +++++++++++++++++++
 patches/squashfs4.3/series                    |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 patches/squashfs4.3/include-sysmacros-h-for-recent-systems-glibc-2-28.patch
 create mode 100644 patches/squashfs4.3/series

diff --git a/patches/squashfs4.3/include-sysmacros-h-for-recent-systems-glibc-2-28.patch b/patches/squashfs4.3/include-sysmacros-h-for-recent-systems-glibc-2-28.patch
new file mode 100644
index 000000000..f635af637
--- /dev/null
+++ b/patches/squashfs4.3/include-sysmacros-h-for-recent-systems-glibc-2-28.patch
@@ -0,0 +1,39 @@
+include sysmacros.h for recent systems (glibc 2.28)
+
+Since glibc 2.28 (and deprecated since 2.25), sys/sysmacros.h
+is no longer included from sys/types.h. Explicitly include it,
+to have minor(), major() and makedev() defined.
+Strictly speaking, it might make sense to replace these calls
+also with gnu_dev_minor() et al., as the above #define's are
+historical shortcuts, too...
+
+Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
+---
+ squashfs-tools/mksquashfs.c |    1 +
+ squashfs-tools/unsquashfs.c |    1 +
+ 2 files changed, 2 insertions(+)
+
+Index: b/squashfs-tools/mksquashfs.c
+===================================================================
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -34,6 +34,7 @@
+ #include <stdio.h>
+ #include <stddef.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>
+Index: b/squashfs-tools/unsquashfs.c
+===================================================================
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -33,6 +33,7 @@
+ 
+ #include <sys/sysinfo.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #include <limits.h>
diff --git a/patches/squashfs4.3/series b/patches/squashfs4.3/series
new file mode 100644
index 000000000..63fad652c
--- /dev/null
+++ b/patches/squashfs4.3/series
@@ -0,0 +1 @@
+include-sysmacros-h-for-recent-systems-glibc-2-28.patch
-- 
2.17.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

             reply	other threads:[~2018-10-12 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 18:42 Andreas Pretzsch [this message]
2018-10-16  8:44 ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1539369758-28346-1-git-send-email-apr@cn-eng.de \
    --to=apr@cn-eng.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox