When compiling coreutils with uClibc-ng, build is failing with error:
In file included from lib/mcel.c:3:
lib/mcel.h: In function 'mcel_scan':
lib/mcel.h:226:21: error: 'mbstate_t' has no member named '__count'
226 | mbstate_t mbs; mbs.__count = 0;
| ^
The problem was reported by Waldemar Brodkorb in:
https://lists.gnu.org/r/bug-gnulib/2024-08/msg00130.html
This commit adds a package patch that modifies mcel_scan to avoid
treating uClibc-ng as if it were glibc, resolving compatibility
issues.
Specifically, uClibc-ng was incorrectly treated like glibc in the code,
which led to incorrect assumptions about the mbstate_t initialization.
Fixes:
- https://autobuild.buildroot.org/results/34f4e23e325a03ab37fd5a0a564780b9e0d631cd/
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
[Julien:
- slightly reworded the commit log
- fixed package patch encoding
- add the Upstream: tag in package patch
- add the Fixes: link in commit log
]
Signed-off-by: Julien Olivain <ju.o@free.fr>
ac_cv_func_strerror_r_char_p is hardcoded to no since commit
74b9bf9945 back in 2005 however strerror_r
only returns an int with musl. With glibc or uclibc, strerror_r returns
a char* or an int depending on _GNU_SOURCE value resulting in the
following build failure with gcc >= 14:
strerror_r.c: In function 'rpl_strerror_r':
strerror_r.c:207:9: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
207 | ret = strerror_r (errnum, buf, buflen);
| ^
To fix this build failure, don't hardcode ac_cv_func_strerror_r_char_p
to let coreutils pick the correct value
Fixes:
- http://autobuild.buildroot.org/results/8bc649ca5490b0c29c90383edfa2e693f154ebc4
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
libgmp is included in coreutils (through bootstrap.conf) since bump to
version 9.0 in commit 2ee43bad85 and
https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=13046444888a7e96f48d28fdd5a6ffe03d4ab036:
configure: WARNING: unrecognized options: --disable-gtk-doc, --disable-gtk-doc-html, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop, --enable-ipv6, --enable-static, --enable-shared, --without-gmp
Fixes: 2ee43bad85
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
- add 'gl_cv_macro_MB_CUR_MAX_good=yes' to COREUTILS_CONF_ENV to fix
cross-compile failure since bump to 9.3
Fixes:
checking whether MB_CUR_MAX is correct... configure: error: in '.../build/coreutils-9.3':
configure: error: cannot run test program while cross compiling
See 'config.log' for more details
Reported-by: Christian Stewart <christian@aperture.us>
Link: https://lore.kernel.org/buildroot/CA+h8R2qSe6OepJMJr+KOUOAOqCRD9EX690Y+Yq4kx-M6x4uQBw@mail.gmail.com/
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Enable SELinux support if libselinux is selected. This allows utilities such as
ls to read and display extended attributes with ls -lZ
Signed-off-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Configuring coreutils with gl_cv_func_fstatat_zero_flag=no results in
non-functional lchmod library function which causes 'mkfifo -m' to
always complete with the message 'cannot set permissions of ...: Invalid
argument' and an error exit code. gl_cv_func_fstatat_zero_flag=no is not
needed when building coreutils-9.0 for linux and its setting should be
correctly determined by the configure script.
Drop gl_cv_func_fstatat_zero_flag=no from the coreutils configure
environment.
For more details see
https://lists.buildroot.org/pipermail/buildroot/2021-December/631388.html
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Build of coreutils with uclibc < 1.0.35 is broken since bump to version
9.0 in commit 2ee43bad85:
In file included from ./lib/sys/random.h:40,
from lib/getrandom.c:22:
/home/giuliobenetti/autobuild/run/instance-3/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t'
27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
| ^~~~~~
/home/giuliobenetti/autobuild/run/instance-3/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
7 | #include <features.h>
+++ |+#include <stddef.h>
8 |
Fixes:
- http://autobuild.buildroot.org/results/c69f5c8b8e53ed3de753f0c6d2cdd99497504b49
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
When BR2_REPRODUCIBLE is set and host-coreutils needs to be built, the
fakedate script installed to 'host/bin/date' will be overwritten by
host-coreutils.
Besides, we do not need our host-coreutils for 'date' at all; we really
rely on the host system to provide it.
Unconditionally disable installing the 'date' binary in host-coreutils.
Note that we explicitly request only ln and realpath to be installed,
but the coreutils buildsystem does not strictly obey to that, as was
already noticed in 885e6fdb8a (package/coreutils: introduce a host
variant), which added that comment above HOST_COREUTILS_CONF_OPTS:
# Explicitly install ln and realpath, which we *are* insterested in.
# A lot of other programs still get installed, however, but disabling
# them does not gain much at build time, and is a loooong list that is
# difficult to maintain...
So, we also update that comment to explain why we still anyway disable
installation of 'date'.
Signed-off-by: Conrad Ratschan <conrad.ratschan@collins.com>
[yann.morin.1998@free.fr:
- unconditionally disable installing date
- extend comment and commit log to explain why we need
--enable-no-install-program=date despite the existing
--enable-install-program=ln,realpath
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Build of coreutils without threads is broken since bump to version 8.32
in commit b4a0f9fb0e
Fixes:
- http://autobuild.buildroot.org/results/8d00bdabef73daa2a1d1f4c6e183dda447a82134
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[yann.morin.1998@free.fr:
- do an actual backport of patch 0002
- add upstream status for patch 0003
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This patch adds CPE ID information for a significant number of
packages.
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
The update to version 8.32 removes the need for an extra patch [1]
(which was added in upstream) but requires another one [2] to fix a new
build issue related to the file 'src/ls.c'.
[1]: 0001-strtod_fix_clash_with_strtold.patch
[2]: 0001-ls-restore-8.31-behavior-on-removed-directories.patch
The changes in the 'COPYING' license file are purely cosmetic: the
https protocol is replacing http in all the links pointing to the
fsf.org and the gnu.org websites (plus a page being renamed). The
following diff shows one of these changes, they are all similar anyway:
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Until version 8.23, we needed to patch coreutils to ensure that options
be passed before non-options when calling help2man (during the build).
Our patch would just swap around two consecutive lines, and required
autoreconfguring and gettextising.
However, in coreutils 8.24, upstream applied a semantically equivalent
fix, but we did not notice, and we blindly fixed the patch by swapping
the previously faulty lines, even though the issue was no longer present
to begin with (if one would need an example of cargo cult, this is it).
Drop our patch, as it has not been needed for the past 4.5 years.
This means that we can also stop autoreconfiguring and gettextising.
Woot!
Rename the remaining patch.
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
More and more packages are now depending on ln --relative, some require
realpath, both of which only got introduced in "recent" versions of
coreutils; older distros had a separate realpath, though, but that is
not in the list of our required dependencies, and was not installed by
default.
So, we introduce a minimal host variant of coreutils to provide those
programs.
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Wheter we are mutli-call or multi-binaries, test is either a symlink to
coreutils or a standalone binary.
Consequently, test always exists, and so we can simplify the [ symlink.
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Markus Mayer <mmayer@broadcom.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
We add configuration option BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES
so that coreutils can be built and installed as individual binaries.
It can be used if the target file system doesn't support symlinks or
symlinks are undesirable.
The approach is modelled after Busybox's similarly named configuration
option.
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
[Thomas: adjust to previous preparation commits.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
The COREUTILS_CLEANUP macro naming is a bit weird. In addition, it
does two unrelated things, and the introduction of support for
building coreutils as individual binaries will require splitting it
up.
So let's do this split as a preparation commit, and use better names
for both resulting macros.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
COREUTILS_CLEANUP_BIN doesn't mean much, what it really does is fixing
the location of binaries, so let's rename to a more sensible name.
This is done in preparation to the introduction of support for
building coreutils as individual binaries.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Among other things this is required to build aginst Glibc 2.28+,
see:
4af4a4a718
Otherwise it fails on build like that:
----------------------->8------------------------
CC lib/fts.o
lib/freadptr.c: In function 'freadptr':
lib/freadptr.c:119:3: error: #error "Please port gnulib freadptr.c to your platform! Look at the definition of fflush, fread, getc, getc_unlocked on your system, then report this to bug-gnulib."
#error "Please port gnulib freadptr.c to your platform! Look at the definition of fflush, fread, getc, getc_unlocked on your system, then report this to bug-gnulib."
^~~~~
----------------------->8------------------------
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Link '[' directly to the coreutils binary instead of going through
'test'.
Suggested-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Since commit 256bb383fb (coreutils: use single binary in symlink
method) the chroot move command creates a dangling symlink, because the
symlink target is 'coreutils' which is not in the /usr/sbin/ directory.
Instead of moving, remove the coreutils installed symlink, and create a
new one in $(TARGET_DIR)/usr/sbin with the correct target.
Should also fix (busybox):
http://autobuild.buildroot.net/results/6b3/6b39648b466738162516aa50ab328d839ec85448/
Cc: Carlos Santos <casantos@datacom.ind.br>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
The symlink method is faster, since there is no shell fork/exec, and
provides extra space savings.
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
[Thomas: use the symlinks method not only for the merged /usr case,
but also in the non-merged case to be consistent, and therefore adjust
the logic that was moving the shell wrappers to a logic that recreates
the symlinks.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This brings up error checking at each iteration of the loop for free,
which removes the need for "|| exit 1".
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
BusyBox installs kill, link, mktemp, nice and printenv on /bin, so
ensure that coreutils replaces them.
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit uses TARGET_NLS_DEPENDENCIES instead of existing logic to
add the dependency on gettext. To keep the existing behavior, we keep
the --with-libintl-prefix option, but only when a libintl library is
effectively provided by gettext.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
We want to use SPDX identifier for license string as much as possible.
SPDX short identifier for GPLv3/GPLv3+ is GPL-3.0/GPL-3.0+.
This change is done using following command.
find . -name "*.mk" | xargs sed -ri '/LICENSE( )?[\+:]?=/s/\<GPLv3\>/GPL-3.0/g'
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This comment was added in 2007 (e4c6340a: cleanup and fixes), back when
removing a package was (seemingly) supported.
This ability was lost when coreutils was converted to autotarget in 2010
(386183f: coreutils: convert to autotarget), but the comment stuck.
Get rid of it: it nowadays does not make sense and is a bit confusing.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Pass on INSTALL_PROGRAM to configure since starting with version 8.26
when building natively it tries to use the self-built install to
install, and when cross-compiling it expects INSTALL_PROGRAM to point to
a real install, or otherwise fails when recursively trying to expand it.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Having the BR2_PACKAGE_BUSYBOX_SHOW_OTHERS dependencies in
package/Config.in is not very practical: it makes this file not very
readable, and puts the dependency away from the package itself, which
can sometimes be confusing. Therefore, this commit moves the dependency
in each package Config.in file.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
For targets prepared with a usr-move, coreutils should not be attempting
to move binaries from `usr/bin` to `bin`.
Signed-off-by: James Knight <james.knight@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Autogenerated from rename-patch.py (http://patchwork.ozlabs.org/patch/403345)
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
The mode bits of coreutils installed binaries are 555. As a result, on
rebuild mv prompts the user to confirm overwrite of non writable binaries.
Force overwrite to skip this prompt.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>