Fixes for some native poky recipes for (host) glibc 2.28

This commit is contained in:
Bruce Leidl 2018-12-13 06:31:14 -05:00
parent 1a45f31790
commit 3917089c71
12 changed files with 507 additions and 0 deletions

View File

@ -0,0 +1,26 @@
Subject: local.mk: fix cross compiling problem
We meet the following error when cross compiling.
| Makefile:3418: *** Recursive variable 'INSTALL' references itself (eventually). Stop.
This patch fixes this problem.
Upstream-Status: Pending
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/local.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/local.mk b/src/local.mk
index 36dfa4e..c5898cc 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -649,4 +649,4 @@ cu_install_program = @INSTALL_PROGRAM@
else
cu_install_program = src/ginstall
endif
-INSTALL = $(cu_install_program) -c
+INSTALL_PROGRAM = $(cu_install_program)
--
2.1.0

View File

@ -0,0 +1,64 @@
Upstream-Status: Denied
Subject: uname: report processor and hardware correctly
This patch is rejected by coreutils upstream, but distros like debian and fedora
uses this patch to make `uname -i' and `uname -p' to not report 'unknown'.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
src/uname.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/uname.c b/src/uname.c
index 39bd28c..c84582d 100644
--- a/src/uname.c
+++ b/src/uname.c
@@ -299,13 +299,19 @@ main (int argc, char **argv)
if (toprint & PRINT_PROCESSOR)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_ARCHITECTURE
{
static char processor[257];
if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
element = processor;
}
+#else
+ {
+ static struct utsname u;
+ uname(&u);
+ element = u.machine;
+ }
#endif
#ifdef UNAME_PROCESSOR
if (element == unknown)
@@ -343,7 +349,7 @@ main (int argc, char **argv)
if (toprint & PRINT_HARDWARE_PLATFORM)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_PLATFORM
{
static char hardware_platform[257];
@@ -361,6 +367,14 @@ main (int argc, char **argv)
if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
element = hardware_platform;
}
+#else
+ {
+ static struct utsname u;
+ uname(&u);
+ element = u.machine;
+ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
+ element[1]='3';
+ }
#endif
if (! (toprint == UINT_MAX && element == unknown))
print_element (element);
--
1.9.1

View File

@ -0,0 +1,49 @@
Subject: revert inconsistent ls quoting
This is a revert of upstream commit 109b9220cead6e979d22d16327c4d9f8350431cc.
Bug-Debian: https://bugs.debian.org/813164
Upstream-Status: Submitted
Originally-by: Adam Borowski <kilobyte@angband.pl>
[PG: patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813164#78 ]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
--- coreutils-8.25.orig/NEWS
+++ coreutils-8.25/NEWS
@@ -71,9 +71,6 @@ GNU coreutils NEWS
df now prefers sources towards the root of a device when
eliding duplicate bind mounted entries.
- ls now quotes file names unambiguously and appropriate for use in a shell,
- when outputting to a terminal.
-
join, sort, uniq with --zero-terminated, now treat '\n' as a field delimiter.
** Improvements
--- coreutils-8.25.orig/doc/coreutils.texi
+++ coreutils-8.25/doc/coreutils.texi
@@ -7750,8 +7750,8 @@ this"} in the default C locale. This lo
You can specify the default value of the @option{--quoting-style} option
with the environment variable @env{QUOTING_STYLE}@. If that environment
-variable is not set, the default value is @samp{shell-escape} when the
-output is a terminal, and @samp{literal} otherwise.
+variable is not set, the default value is @samp{literal}, but this
+default may change to @samp{shell} in a future version of this package.
@item --show-control-chars
@opindex --show-control-chars
--- coreutils-8.25.orig/src/ls.c
+++ coreutils-8.25/src/ls.c
@@ -1581,7 +1581,6 @@ decode_switches (int argc, char **argv)
if (isatty (STDOUT_FILENO))
{
format = many_per_line;
- set_quoting_style (NULL, shell_escape_quoting_style);
/* See description of qmark_funny_chars, above. */
qmark_funny_chars = true;
}

View File

@ -0,0 +1,39 @@
From a1d360509fa3a4aff57eedcd528cc0347a87531d Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Tue, 16 Sep 2014 01:59:08 -0700
Subject: [PATCH] gnulib-comp.m4: selinux/flask.h should respect to
with_selinux
Fixed when build with meta-selinux even when --without-selinux:
runcon.c:49:28: fatal error: selinux/flask.h: No such file or directory
# include <selinux/flask.h>
^
compilation terminated.
Upstream-Status: Pending
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
m4/gnulib-comp.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 472d3a0..5f09734 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1730,11 +1730,11 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([select])
fi
gl_SYS_SELECT_MODULE_INDICATOR([select])
- AC_CHECK_HEADERS([selinux/flask.h])
AC_LIBOBJ([selinux-at])
gl_HEADERS_SELINUX_SELINUX_H
gl_HEADERS_SELINUX_CONTEXT_H
if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
+ AC_CHECK_HEADERS([selinux/flask.h])
AC_LIBOBJ([getfilecon])
fi
gl_SERVENT
--
1.7.9.5

View File

@ -0,0 +1,31 @@
We have problem using hardcoded directories like /usr/local here
which will be checked for cross builds. This is a special case which
is valid for AIX only. We do not have AIX as one of our supported
build host or target. Therefore we get rid of the hardcoded paths
and make life easier for cross compilation process.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
Index: coreutils-8.14/m4/getloadavg.m4
===================================================================
--- coreutils-8.14.orig/m4/getloadavg.m4 2011-09-19 08:09:24.000000000 -0700
+++ coreutils-8.14/m4/getloadavg.m4 2011-10-19 21:42:00.385533357 -0700
@@ -41,16 +41,6 @@
[LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
fi
- if test $gl_func_getloadavg_done = no; then
- # There is a commonly available library for RS/6000 AIX.
- # Since it is not a standard part of AIX, it might be installed locally.
- gl_getloadavg_LIBS=$LIBS
- LIBS="-L/usr/local/lib $LIBS"
- AC_CHECK_LIB([getloadavg], [getloadavg],
- [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
- [LIBS=$gl_getloadavg_LIBS])
- fi
-
# Set up the replacement function if necessary.
if test $gl_func_getloadavg_done = no; then
HAVE_GETLOADAVG=0

View File

@ -0,0 +1,139 @@
SUMMARY = "The basic file, shell and text manipulation utilities"
DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
manipulation utilities. These are the core utilities which are expected to exist on \
every system."
HOMEPAGE = "http://www.gnu.org/software/coreutils/"
BUGTRACKER = "http://debbugs.gnu.org/coreutils"
LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
file://src/ls.c;beginline=1;endline=15;md5=dbe356a88b09c29232b083d1ff8ac82a"
DEPENDS = "gmp libcap"
DEPENDS_class-native = ""
inherit autotools gettext texinfo
SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
file://remove-usr-local-lib-from-m4.patch \
file://fix-selinux-flask.patch \
file://0001-uname-report-processor-and-hardware-correctly.patch \
file://disable-ls-output-quoting.patch \
file://0001-local.mk-fix-cross-compiling-problem.patch \
"
SRC_URI[md5sum] = "ab06d68949758971fe744db66b572816"
SRC_URI[sha256sum] = "e831b3a86091496cdba720411f9748de81507798f6130adeaef872d206e1b057"
EXTRA_OECONF_class-native = "--without-gmp"
EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}"
EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname"
# acl and xattr are not default features
#
PACKAGECONFIG_class-target ??= "\
${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
"
# The lib/oe/path.py requires xattr
PACKAGECONFIG_class-native ??= "xattr"
# with, without, depends, rdepends
#
PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,,"
# [ df mktemp nice printenv base64 gets a special treatment and is not included in this
bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
env expand expr factor fmt fold groups head hostid id install \
join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout \
tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
# hostname gets a special treatment and is not included in this
base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
sbindir_progs= "chroot"
# Let aclocal use the relative path for the m4 file rather than the
# absolute since coreutils has a lot of m4 files, otherwise there might
# be an "Argument list too long" error when it is built in a long/deep
# directory.
acpaths = "-I ./m4"
# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
do_compile_prepend () {
mkdir -p ${B}/src
}
do_install_class-native() {
autotools_do_install
# remove groups to fix conflict with shadow-native
rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
# The return is a must since native doesn't need the
# do_install_append() in the below.
return
}
do_install_append() {
for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
install -d ${D}${base_bindir}
[ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
install -d ${D}${sbindir}
[ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
# [ requires special handling because [.coreutils will cause the sed stuff
# in update-alternatives to fail, therefore use lbracket - the name used
# for the actual source file.
mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
}
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
# Make hostname's priority higher than busybox but lower than net-tools
ALTERNATIVE_PRIORITY[hostname] = "90"
ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df"
ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1"
ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice"
ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}"
ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1"
ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv"
ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}"
ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
python __anonymous() {
for prog in d.getVar('base_bindir_progs').split():
d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
for prog in d.getVar('sbindir_progs').split():
d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
}
BBCLASSEXTEND = "native nativesdk"

View File

@ -0,0 +1 @@
SRCREV_localedef = "c328777219ccc480be3112cf807217ca6b570b64"

View File

@ -0,0 +1,3 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://gnulib.patch"

View File

@ -0,0 +1,21 @@
Fix gnulib issues found with glibc 2.28 libio.h removal
see
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: bison-3.0.4/lib/fseterr.c
===================================================================
--- bison-3.0.4.orig/lib/fseterr.c
+++ bison-3.0.4/lib/fseterr.c
@@ -29,7 +29,7 @@ fseterr (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags |= _IO_ERR_SEEN;
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
fp_->_flags |= __SERR;

View File

@ -0,0 +1,130 @@
update for glibc libio.h removal in 2.28+
see
https://src.fedoraproject.org/rpms/m4/c/814d592134fad36df757f9a61422d164ea2c6c9b?branch=master
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: m4-1.4.18/lib/fflush.c
===================================================================
--- m4-1.4.18.orig/lib/fflush.c
+++ m4-1.4.18/lib/fflush.c
@@ -33,7 +33,7 @@
#undef fflush
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
static void
@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
#endif
-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
# if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
if (stream == NULL || ! freading (stream))
return fflush (stream);
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
clear_ungetc_buffer_preserving_position (stream);
Index: m4-1.4.18/lib/fpending.c
===================================================================
--- m4-1.4.18.orig/lib/fpending.c
+++ m4-1.4.18/lib/fpending.c
@@ -32,7 +32,7 @@ __fpending (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return fp->_IO_write_ptr - fp->_IO_write_base;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
Index: m4-1.4.18/lib/fpurge.c
===================================================================
--- m4-1.4.18.orig/lib/fpurge.c
+++ m4-1.4.18/lib/fpurge.c
@@ -62,7 +62,7 @@ fpurge (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_IO_read_end = fp->_IO_read_ptr;
fp->_IO_write_ptr = fp->_IO_write_base;
/* Avoid memory leak when there is an active ungetc buffer. */
Index: m4-1.4.18/lib/freadahead.c
===================================================================
--- m4-1.4.18.orig/lib/freadahead.c
+++ m4-1.4.18/lib/freadahead.c
@@ -25,7 +25,7 @@
size_t
freadahead (FILE *fp)
{
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_write_ptr > fp->_IO_write_base)
return 0;
return (fp->_IO_read_end - fp->_IO_read_ptr)
Index: m4-1.4.18/lib/freading.c
===================================================================
--- m4-1.4.18.orig/lib/freading.c
+++ m4-1.4.18/lib/freading.c
@@ -31,7 +31,7 @@ freading (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return ((fp->_flags & _IO_NO_WRITES) != 0
|| ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
&& fp->_IO_read_base != NULL));
Index: m4-1.4.18/lib/fseeko.c
===================================================================
--- m4-1.4.18.orig/lib/fseeko.c
+++ m4-1.4.18/lib/fseeko.c
@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
#endif
/* These tests are based on fpurge.c. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_read_end == fp->_IO_read_ptr
&& fp->_IO_write_ptr == fp->_IO_write_base
&& fp->_IO_save_base == NULL)
@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
return -1;
}
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags &= ~_IO_EOF_SEEN;
fp->_offset = pos;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
Index: m4-1.4.18/lib/stdio-impl.h
===================================================================
--- m4-1.4.18.orig/lib/stdio-impl.h
+++ m4-1.4.18/lib/stdio-impl.h
@@ -18,6 +18,12 @@
the same implementation of stdio extension API, except that some fields
have different naming conventions, or their access requires some casts. */
+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
+ problem by defining it ourselves. FIXME: Do not rely on glibc
+ internals. */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif
/* BSD stdio derived implementations. */

View File

@ -0,0 +1,2 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://m4-1.4.18-glibc-change-work-around.patch"

View File

@ -0,0 +1,2 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://m4-1.4.18-glibc-change-work-around.patch"