1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-18 05:18:14 +02:00
Commit Graph

2155 Commits

Author SHA1 Message Date
Michael Pratt
f9a1996367 tools/elfutils: remove header symlink between subdirectories
Replace the symlink in the build recipe for gnulib
with an extra include path flag in CPPFLAGS to the lib subdirectory
so that it is the last in the order of include paths,
and use a quote escape to make the flag a literal string
in order to use Make variables within it.

The original reason this is necessary is because the config.h header
provided by the project at the top-level build directory
calls another header eu-config.h
which is stored in the lib subdirectory instead of the top-level,
and building the gnulib library requires the config.h header.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15853
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-07-08 08:49:42 +02:00
Shiji Yang
7d2ca4e410 tools: mkimage: update to U-Boot release v2024.07
Update to latest version.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-07-04 21:15:26 +02:00
Robert Marko
fd085a737b tools/e2fsprogs: fixup STAGING_DIR_HOST path evaluation in shell scripts
We have to use curly braces on the exported STAGING_DIR_HOST env variable,
instead of evaluating it directly as we are not in Make but a separate
shell script.

Otherwise it would fail with:
staging_dir/host/bin/compile_et: line 6: STAGING_DIR_HOST: command not found
staging_dir/host/bin/mk_cmds: line 5: STAGING_DIR_HOST: command not found

And so when krb5 tries to build it will fail as compile_et and mk_cmds will
return an error.

Fixes: 55bda9863dd0 ("tools/e2fsprogs: fix shell scripts under SDK")
Link: https://github.com/openwrt/openwrt/pull/15854
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-07-02 14:04:49 +02:00
Rosen Penev
a787ebf716 tools/util-linux: build libuuid as PIC
Needed to fix users of libuuid.a as autoconf applies PIC to only shared
libraries by default.

Found when trying to build python3/host.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15852
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-07-02 11:59:06 +02:00
Rosen Penev
55bda9863d tools/e2fsprogs: fix shell scripts under SDK
7c32295b0036be425ba0cd527eb06316a87d0ec0 exposed a problem where the SDK
builds these shell scripts with a nonsensical absolute path for the DIR
variable. Use sed to patch in $STAGING_DIR_HOST.

Also remove PKG_RELEASE as that is nonsensical for tools.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15841
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-30 19:05:21 +02:00
Robert Marko
b43c0a915f tools: util-linux: mark hexdump patch as backport
The hexdump fix for --disable-all-programs has been merged upstream, so
mark it so.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-27 12:22:53 +02:00
Michael Pratt
4710134f12 tools/coreutils: remove 64-bit time disable flag
This was added to support building coreutils on host systems
that still only have 32-bit time support.

Because other tools now also require the flag for building
with 32-bit time when support for 64-bit time is not present,
this flag is now added to all host builds
on a variable basis using the same test before building,
so it can now be removed from specific tools.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15799
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-27 09:31:53 +02:00
Robert Marko
843b51b26d tools: mtd-utils: use libuuid provided by util-linux
Now that util-linux is building libuuid we can simply use that instead
of manually pointing to e2fsprogs libuuid so we can disable building
libuuid in e2fsprogs.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-26 11:21:04 +02:00
Robert Marko
215d5bbe4e tools: e2fsprogs: use standard make uninstall
There is no need to manually only remove 2 binaries during cleanup and
leave rest of the e2fsprogs installed stuff untouched, so instead use
make uninstall to do the cleanup.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-26 11:21:04 +02:00
Robert Marko
bd48ca1245 tools: e2fsprogs: use libuuid provided by util-linux
We are now using util-linux to provide libuuid so disable building it
in e2fsprogs and simply use the util-linux provided one.

Disabling libuuid removes the need for custom install recipe.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-26 11:21:04 +02:00
Robert Marko
8b0f892b31 tools: util-linux: build libuuid
util-linux usually provides libuuid, and is preffered by mtd-utils so lets
enable building libuuid so we can disable it later in e2fsprogs.

Only the static version of library is intentionally built.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-26 11:21:04 +02:00
Robert Marko
fb99a8d2e6 tools: util-linux: use standard make install/uninstall
Instead of manually installing the binaries and removing them, we can now
simply rely on standard make install/uninstall as we are only building
tools we want to use.

This will be especially important when we start building libraries in
util-linux.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-26 11:21:03 +02:00
Robert Marko
54115ec22d tools: util-linux: use --disable-all-programs
util-linux supports passing --disable-all-programs configure flag to
disable building anything that isnt then manually enabled.

So, lets switch to using that instead of manually having to disable all
tools we dont need.

However, current drawback is that there is no upstream support for enabling
building hexdump so I included a patch that is pending upstream[0].

[0] https://github.com/util-linux/util-linux/pull/3101

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-26 11:21:03 +02:00
Robert Marko
1029340353 tools: mtd-utils: fix disabling tests
Passing --disable-tests does not do anything since upstream commit [0]
("Fix test binary installation") as that commit removed it since there is
already and existing --without-tests compile option to not compile
the tests at all as --disable-tests was just disabling their installation.

So, lets just pass --without-tests instead to disable test compilation.

[0] https://git.infraroot.at/mtd-utils.git/commit/?id=7170a28d46d5db1e7a9da24a5555a194a233ef0b

Fixes: 67efb6a66146 ("tools: mtd-utils: Update to version 2.1.4")
Link: https://github.com/openwrt/openwrt/pull/15791
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-25 17:57:07 +02:00
Robert Marko
e07cc3237e tools: mtd-utils: update to 2.2.0
Release notes:
https://lists.infradead.org/pipermail/linux-mtd/2024-March/104058.html

Manually refresh the portability and JFFS2 LZMA patches.

Since mtd-utils have converted most of the JFFS2 compressors to be compile
time configurable and manual refreshing of JFFS2 LZMA was needed I also
converted it to a compile time option and enabled the new --with-lzma
option.

Link: https://github.com/openwrt/openwrt/pull/15791
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-25 17:57:07 +02:00
Konstantin Demin
6988fe3d98 tools/llvm: update to 18.1.7
- release notes:
  - https://discourse.llvm.org/t/llvm-16-0-0-release/69326
  - https://discourse.llvm.org/t/llvm-17-0-1-released/73549
  - https://discourse.llvm.org/t/llvm-18-1-0-released/77448
  - https://discourse.llvm.org/t/llvm-18-1-1-released/77540
  - https://discourse.llvm.org/t/18-1-2-released/77821
  - https://discourse.llvm.org/t/18-1-3-released/78136
  - https://discourse.llvm.org/t/18-1-4-released/78430
  - https://discourse.llvm.org/t/18-1-5-released/78740
  - https://discourse.llvm.org/t/18-1-6-released/79068
  - https://discourse.llvm.org/t/18-1-7-released/79433
- remove PKG_RELEASE (irrelevant to tools)
- set default target/triplet to "bpf"
- rearrange configuration options
- better control feature support and improve build reproducibility:
  disable auxiliary features that are enabled implicitly - their
  support is detected at build-time

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15704
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-24 13:56:14 +02:00
Michael Pratt
f864b83b1d tools/fakeroot: fix check for whether to wrap time64 functions
Fakeroot uses an egrep configure check to look for the string "time64"
within a preprocessed include of the sys/stat.h header
in order to decide whether or not to create declarations
and internal functions used for wrapping the native functions
stat64_time64 fstat64_time64 lstat64_time64 and fstatat64_time64.

On specific older versions of glibc these functions are not included,
but there are some references to "time64" unrelated to functions,
like aliasing the time64_t typedef to the standard time_t typedef
when the size of a word is 64 bits or defining it if not.

In this case, a grep for "stat64"
of the preprocessed sys/stat.h header matches nothing,
however, the grep for "time64" in the configure check
of the preprocessed sys/stat.h header matches a line
that has nothing to do with the functions
that will be wrapped as a result of successful matching.

  __extension__ typedef __int64_t __time64_t;

This causes the attempt to wrap the functions to occur,
which fails due to some of the corresponding macros being empty
since the native declarations they are based on do not exist,
causing a common error claiming that a part of the syntax is missing.

  error: expected '=', ',', ';', 'asm' or '__attribute__' before ...

Fix this by making the testing regular expression more complex
in order to match actual function names ending in "_time64"
with or without a set of preceding underscores, but none after.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15773
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-22 20:42:45 +02:00
Christian Marangi
66edb2f9ad
tools: firmware-utils: update to Git HEAD (2024-06-20)
224d497dd94f srec2bin: drop unused "dum" variable
6777b2d51961 uimage_sgehdr: use "char" type for header struct strings
81db3025aac5 uimage_sgehdr: drop unused "ltmp" variable
bd7fcc74b43e pc1crypt: make decrypt/encrypt functions take void * as argument
6ac44974185a linksys: add magic header generation tool for e8350 v1

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-21 13:34:32 +02:00
Thomas Weißschuh
17099f2760 tools: util-linux: update to v2.40.1
Release Notes:
	https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40-ReleaseNotes
	https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.1-ReleaseNotes

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2024-06-20 14:06:41 +02:00
Michael Pratt
c24c3da00b tools/coreutils: ignore gnulib changes to fcntl.h
As a side-effect to adding a gnulib module for posix_fallocate(),
there are changes to the input file for fcntl.h which
are not handled here since autoreconf is not ran.

Skip updating the fcntl.h header from gnulib
and use the version shipped with the release.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
f560588b05 tools/elfutils: add more pkg-config library info
In order for linking the static libraries from elfutils to work,
other libraries need to be included to handle the references
to functions made in the library's objects that are not included
as they would already be if the library was a shared object instead.

A shared object library stores this list of libraries when it was made,
so that the dynamic linker can refer to that list at runtime,
but a static library has no such functionality so the list of libraries
for missing functions must be included at link time.

This information was already added to the pc file for libelf
using the definitions in src/Makefile.am,
so extend this to the rest of the pc files in the project.

For situations where the libraries may be used
without pkg-config setting the flags and library list,
this patch and the pc files can serve as a quick reference.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
e4fb7c9544 tools/elfutils: use weak alias over no alias for macOS
Clang has support for weak aliases
despite no support for strong aliases,
but it only works with the #pragma directive.

Implementing weak aliases instead of none
is likely a more upstream-friendly solution
for supporting building on other platforms.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
52a5344501 tools/elfutils: split upstreamable parts of portability patch
The addition of LT_INIT as well as the adjustment of
the BUILD_STATIC and addition of the BUILD_SHARED conditionals
and their usage to block building of shared objects
and adjust the variables for building static libraries
is potentially upstream-friendly.

The use of a manifest file to keep a list
of the objects in each library instead of calling ar
is also potentially upstream-friendly.

Separate these changes from the macOS-specific hacks.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
9670a38d08 tools/elfutils: use conditional to block build of shared objects
Add a potentially upstream-friendly conditional
using the libtool configure variable "enable_shared"
in order to block building and installing of shared objects
and adjust the build of static libraries
instead of directly patching lines in or out.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
954179e412 tools/elfutils: do not use ar to list library objects
The use of ar to list the archive members in a library
in order to include them in another library is not portable.

On BSD and macOS, ar will also list
the special archive member "__.SYMDEF"
which is not a compiled object, rather it is
part of the metadata prepended to the library by ranlib.

Fix this by writing the list of unique objects used
to create the library into a separate "manifest" file
when the library is created, which will be read later
when the Makefiles of other subdirectories are ran.

Extend this to all other libraries whether or not they are linked
to another library for a shared object that is installed
so that it is possible for any of the libraries
to be statically built with more objects.

The use of the wildcard function to ignore the
special archive members which are only metadata
is no longer needed to prevent build errors.

Not using the wildcard function is preferred,
since errors should be caught during the build
instead of when linking something else or at runtime.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
8ce3873a28 tools/elfutils: do not use libtool for all subdirectories
Importing gnulib in order to have a local portable library
to link against for missing functions currently requires
using libtool to produce the libgnu.la library.

Ideally, linking would be simple if the rest of the libraries
built by elfutils were also built using libtool, as linking
them together would not require any manipulations of library paths.

However, upstream elfutils does not support building the libraries
statically with libtool, so using libtool comes at the cost
of creating a huge patch to introduce that functionality.

For building on macOS, it turns out that libgnu.la is only needed
for building the binaries, and that just one or two objects from libgnu
are needed to build the libraries, so in this case, it would be simple
to add the specific non-libtool-wrapped library and objects
to the link paths as needed, rather than use libtool to link
the libtool wrappers, which greatly reduces the need to patch.

Not using libtool also makes the original Makefile definitions for LIBADD
once again be the right ones to use. However, to be portable,
for libdw the wildcard function needs to be used in order to exclude
special archive members like "__.SYMDEF" which are not compiled objects
because some BSD-like versions of ar include that metadata in the list,
or because the library included may have objects from another subdirectory.
Also, the rest of the subdirectories have custom "LDLIBS" variables
meant for building shared objects only, so define the LIBADD variables
with objects from those existing definitions so that when building only
the static versions of the libraries, those objects can still be included.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
c07a234164 tools/elfutils: use gnulib module for posix_fallocate()
The version of posix_fallocate() patched into elfutils
for macOS using code from Mozilla is now patched into gnulib.

Import the fallocate-posix module and always link
the corresponding object to libraries whenever it is built.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
f07621e10b tools/gnulib: add fallocate-posix module
Add a module to gnulib to support posix_fallocate()
for macOS and other systems that are missing it.

Apple-specific code is sourced from Mozilla,
and the rest from glibc, both licensed under LGPL.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
447093ffde tools/elfutils: simplify portability patch
Several changes to the elfutils source files
made during the process of figuring out how to
successfully build elfutils on macOS
turn out to not be necessary to do so,
and were most likely leftover bits during testing.

Remove the line changes that are not needed
and add some line changes to adapt to sources as is:

 - Remove now unnecessary bump to autoconf version prereq
 - AC_CONFIG_MACRO_DIRS is not necessary to define
   as ACLOCAL_AMFLAGS is already defined in Makefiles
 - let libtool "enable_static" variable also decide the value
   of the local conditional BUILD_STATIC
 - override configure variables instead of removing
   checks for libraries or additions to LDFLAGS
 - only exclude "hidden" attribute for macOS instead of deleting
 - preserve original list of sources to build for libelf
 - use openwrt Makefile to add gnulib headers
 - use openwrt Makefile to add LIBADD variables
 - remove deletion of variables and rules for shared objects
 - prefer recursively expanded variables over muliple renames
   each time that a word is added to its value
 - remove changes to subdirectories that are not built
   and remove changes to target files of those subdirectories
 - prefer basic text rename over variables in cases where
   there would be no line number difference
 - give LT_INIT forced default values that match upstream
 - move gl_EARLY and gl_INIT down relative to compiler checks
 - reorganize some line changes to save some lines

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
e6d106284e tools/gnulib: ignore AC_PREREQ error if actual version passes
The gnulib-tool script is written to have a fatal error
whenever the minimum required version of autoconf
for the project that gnulib is being imported into
as defined in configure.ac was less than
the minimum required version required by gnulib.

However, none of this matters if the version of autoconf
that we use is newer than both requirements.

Instead, use functions from the bootstrap script
to check for the version of autoconf being used
and print a warning whenever this case occurs.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Michael Pratt
efdd65cb87 tools/gnulib: allow forced exclusion of functions after configure
Overriding variables used in both the macros and the headers
like setting REPLACE_FCNTL to 0 while invoking Make causes the
function aliases like rpl_fcntl() to not be defined,
however the object may still be built with the fnctl() function.

Usually this is enough for building while avoiding
the need to link the resulting libgnu library
to every single other build target for a project
in order to include the gnulib copy of the function,
because in these cases we don't care which version
of the function is used.

However for functions like fcntl() this doesn't work
as it is designed to use either the alias or standard declaration
from gnulib headers in order to be
a wrapper for the native host copy of fcntl()
by containing recursive calls to fcntl() within itself
after undefining the gnulib function declaration.

Overriding the variables used by the header when invoking Make
causes the header's declarations to be blocked,
and this results in the gnulib version of fcntl()
to call itself recursively and indefinitely
leading to segmentation faults.

Fix this by using macros defined with those variables
in order to exclude the function during preprocessing.

While at it, do the same for reallocarray()
so that the configure option --avoid=reallocarray
and Make variable REPLACE_REALLOCARRAY set to 0
would have a similar effect.

In the future this patch can be expanded to include
more functions and some version of this may be upstreamable.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 11:22:13 +02:00
Christian Marangi
368441254e
tools/fakeroot: update to 1.33
fakeroot (1.33-1) unstable; urgency=medium

  * New upstream version.
    - Patch from Samuel Thibault to add renameat2 support.
      closes: #1061257.

 -- Clint Adams <clint@debian.org>  Sun, 21 Jan 2024 11:56:06 -0500

fakeroot (1.32.2-1) unstable; urgency=medium

  * New upstream version.
    - Romanian man page translation from Remus-Gabriel Chelu.
      closes: #1055386.
    - patch from Rudi Heitbaum to add missing wrapped.h dependency.
      closes: #1041674.

 -- Clint Adams <clint@debian.org>  Mon, 06 Nov 2023 07:15:47 -0500

fakeroot (1.32.1-1) unstable; urgency=medium

  * New upstream version.
  * Updated German translation from Chris Leick.  closes: #1032206.
  * Patch from John Paul Adrian Glaubitz to add build profile to
    allow bootstrapping.  closes: #1040828.

 -- Clint Adams <clint@debian.org>  Wed, 12 Jul 2023 09:59:17 -0400

fakeroot (1.32-1) unstable; urgency=medium

  * New upstream version.

 -- Clint Adams <clint@debian.org>  Mon, 10 Jul 2023 09:14:43 -0400

fakeroot (1.31-1) unstable; urgency=medium

  * New upstream version.
    - patch from Johannes Schauer Marin Rodrigues to not use
      temporary file in chown test.  closes: #1026132.

 -- Clint Adams <clint@debian.org>  Mon, 06 Feb 2023 10:12:11 -0500

fakeroot (1.30.1-1) unstable; urgency=medium

  * New upstream version.
    - fixes and extends time64 support to fstatat64.
      closes: #1023286.

 -- Clint Adams <clint@debian.org>  Thu, 03 Nov 2022 15:04:55 -0400

fakeroot (1.30-1) unstable; urgency=medium

  * New upstream version.
    - tries to cope with time64 on 32-bit architectures.
      closes: #1023286.
  * Drop kludge for glibc 2.33.

 -- Clint Adams <clint@debian.org>  Wed, 02 Nov 2022 20:17:56 -0400

Link: https://github.com/openwrt/openwrt/pull/15746
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-18 23:02:17 +02:00
Robert Marko
fcdc7da31c
tools: tar: update to 1.35
Instead of backporting select 1.35 fixes to make tar work for us, lets
update to 1.35 now that we have identified the upstream fix for macOS.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15743
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-18 19:49:54 +02:00
Rosen Penev
253d777c96 tools/sparse: fix compilation with GCC14
Upstream backport.

Get rid of PKG_RELEASE as it's irrelevant to tools.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-06-16 22:40:42 +02:00
Nick Hainke
7a9b1f7f25 tools/pkgconf: update to 2.2.0
Changelog:
06120a8769/NEWS

Signed-off-by: Nick Hainke <vincent@systemli.org>
2024-06-14 15:27:39 +02:00
Tony Ambardar
546559587f
tools/dwarves: update to v1.27
Update to the latest upstream version and add a patch that enables pahole
reproducible builds if SOURCE_DATE_EPOCH is defined in the environment.

This patch helps avoid BTF-related module loading problems with packages
built separately from the kernel such as mac80211 or kselftests-bpf, e.g.:

    [   16.858856] BPF:      type_id=1185 bits_offset=0
    [   16.859099] BPF:
    [   16.859199] BPF: Invalid name
    [   16.859352] BPF:
    [   16.859612] failed to validate module [cfg80211] BTF: -22
    [   17.015178] PPP generic driver version 2.4.2
    [   17.052703] NET: Registered PF_PPPOX protocol family
    [   17.348722] BPF:      type_id=1185 bits_offset=0
    [   17.348912] BPF:
    [   17.348996] BPF: Invalid name
    [   17.349106] BPF:
    [   17.349220] failed to validate module [cfg80211] BTF: -22
    [   17.472070] kmodloader: 3 modules could not be probed
    [   17.473133] kmodloader: - cfg80211 - 0
    [   17.473762] kmodloader: dependency not loaded cfg80211
    [   17.474421] kmodloader: - mac80211 - 1
    [   17.474988] kmodloader: dependency not loaded mac80211
    [   17.475632] kmodloader: dependency not loaded cfg80211
    [   17.476263] kmodloader: - mac80211_hwsim - 2

    root@OpenWrt:/usr/libexec/kselftests-bpf# insmod bpf_testmod.ko
    [ 4735.776792] missing module BTF, cannot register kfuncs
    [ 4735.777371] missing module BTF, cannot register kfuncs
    [ 4735.777955] missing module BTF, cannot register kfuncs
    [ 4735.778452] missing module BTF, cannot register kfuncs

Release Notes: https://lore.kernel.org/bpf/ZmjBHWw-Q5hKBiwA@x1/

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/15697
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-13 14:16:33 +02:00
Tony Ambardar
f97da2c61a
tools/elfutils: add missing MIPS reloc support
Backport an upstream patch series that adds backend elfutils support for
DWARF relocations in MIPS debug info. This support is needed by pahole to
generate BTF for modules in BTF-enabled kernel builds.

The problem first manifests as pahole warnings during build:

    BTF [M] lib/libcrc32c.ko
    die__process_unit: DW_TAG_compile_unit (0x11) @ <0x932d> not handled!
    die__process_unit: tag not supported 0x11 (compile_unit)!
    die__process: got compile_unit unexpected tag after DW_TAG_compile_unit!
    die__process_unit: DW_TAG_compile_unit (0x11) @ <0x99a3> not handled!
    die__process_unit: tag not supported 0x11 (compile_unit)!
    die__process: got compile_unit unexpected tag after DW_TAG_compile_unit!

During system boot the problem then causes module loading failures, which
may result in many other runtime issues:

    [   13.169785] kmodloader: loading kernel modules from /etc/modules.d/*
    [ ... ]
    [   17.422840] mac80211_hwsim: initializing netlink
    [   17.526518] PPP generic driver version 2.4.2
    [   17.550346] NET: Registered PF_PPPOX protocol family
    [   17.795353] kmodloader: 26 modules could not be probed
    [   17.796084] kmodloader: dependency not loaded nf_conntrack
    [   17.796737] kmodloader: - act_connmark - 1
    [   17.797402] kmodloader: dependency not loaded nf_conntrack
    [   17.798056] kmodloader: - act_ctinfo - 1
    [ ... ]

Link: https://lore.kernel.org/bpf/ZlkoM6%2FPSxVcGM6X@kodidev-ubuntu/
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/15697
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-13 14:16:33 +02:00
Christian Marangi
95597dc2e3
tools: tar: backport patch for paxlib shipped in tar
Tar 1.34 ship an old version of paxlib with rtapelib.c that produce some
compilation warning. This library got updated in 1.35 but we still can't
use the new Tar version.

GCC 14 then made these compilarion warning errors.

Manually backport the fixes to rtapelib.c and patch the version shipped
in 1.34 to fix these compilation warning.

Fixes: #15692
Fixes: 2951e0a80e9f ("tools: tar: backport patches fixing broken --delete")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-12 15:16:58 +02:00
Christian Marangi
2951e0a80e
tools: tar: backport patches fixing broken --delete
In experimenting with --delete for APK handling, it was discovered that
--delete is broken and corrupts the TAR in some case.

This is fixed in version 1.35 but 1.35 introduce some problem with MacOS
making it difficult to bump. Backport the 2 required patches to fix this
problem so --delete is usable again.

Link: https://github.com/openwrt/openwrt/pull/15543
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-11 23:58:14 +02:00
Nick Hainke
ac2722cb02 tools/ccache: update to 4.10.0
Release Notes:
https://ccache.dev/releasenotes.html#_ccache_4_10

Refresh patch:
- 100-honour-copts.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
2024-06-10 16:08:19 +02:00
Nick Hainke
712c10ec48 tools/findutils: update to 4.10.0
Release Notes:
https://savannah.gnu.org/news/?id=10638

Remove upstreamed patch:
- 010-endpwent.patch [0]

[0] - fa7e628e19

Signed-off-by: Nick Hainke <vincent@systemli.org>
2024-06-10 13:02:06 +02:00
Nick Hainke
3fd593b848 tools/cmake: update to 3.29.5
Changelog:
- https://www.kitware.com/cmake-3-29-1-available-for-download/
- https://www.kitware.com/cmake-3-29-2-available-for-download/
- https://www.kitware.com/cmake-3-29-3-available-for-download/
- https://www.kitware.com/cmake-3-29-4-available-for-download/
- https://www.kitware.com/cmake-3-29-5-available-for-download/

Signed-off-by: Nick Hainke <vincent@systemli.org>
2024-06-10 01:27:02 +02:00
Nick Hainke
10a1e9b44a tools/quilt: update to 0.68
Release Notes:
https://savannah.nongnu.org/news/?id=10611

Signed-off-by: Nick Hainke <vincent@systemli.org>
2024-06-09 21:23:28 +02:00
Michał Kępień
77106faa37 tools: remove kernel2minor
Since the Yafut tool is now used for both updating the kernel on
MikroTik devices with NAND flash and preparing firmware images for
MikroTik devices with NOR flash, remove the kernel2minor utility from
the tree as it is no longer used for anything.

Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
Link: https://github.com/openwrt/openwrt/pull/13453
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-05 17:03:24 +02:00
Michał Kępień
a60721f2ed mikrotik: switch to Yafut for building MikroTik NOR images
The Yafut tool now has limited capabilities for working on filesystem
images stored in regular files.  This enables preparing Yaffs2 images
for devices with NOR flash using upstream Yaffs2 filesystem code instead
of the custom kernel2minor tool.

Since minimizing the size of the resulting filesystem image size is
important and upstream Yaffs2 code requires two allocator reserve blocks
to be available when writing a file to the filesystem, a trick is
employed while preparing an OpenWRT image: the blank filesystem image
that Yafut operates on initially contains two extra erase blocks that
are chopped off after the kernel file is written.  This is safe to do
because Yaffs2 has a true log structure and therefore only ever writes
sequentially (and the size of the kernel file is known beforehand).
While the two extra erase blocks are necessary for writes, Yaffs2 code
seems to be perfectly capable of reading back files from a "truncated"
filesystem that does not contain these extra erase blocks.

In terms of image size, this new approach is only marginally worse than
the current kernel2minor-based one: specifically, upstream Yaffs2 code
needs to write three object headers (each of which takes up an entire
data chunk) when the kernel file is written to the filesystem:

  - an object header for the kernel file when it is created,

  - an object header for the root directory when the kernel file is
    created,

  - an updated object header for the kernel file when the latter is
    fully written (so that its new size can be recorded).

kernel2minor only writes two of these headers, which is the absolute
minimum required for reading the file back.  This means that the
Yafut-based approach causes firmware images to be at most one erase
block (64 kB) larger than those created using kernel2minor, but only in
the very unfortunate scenario where the size of the kernel file is
really close to a multiple of the erase block size.

The rest of the calculations performed when the empty filesystem image
is first prepared stems from the Yaffs2 layout used by MikroTik NOR
devices: each 65,536-byte erase block contains 63 chunks, each of which
consists of 1024 bytes of data followed by 16-byte Yaffs tags without
ECC data; each such group of 63 chunks is then followed by 16 bytes of
padding, which translates to "-C 1040 -B 64k -E" in the Yafut
invocation.  Yaffs2 checkpoints and summaries are disabled (using
Yafut's -P and -S switches, respectively) as they are merely performance
optimizations that require extra storage space.  The -L and -M switches
are used to force little-endian or big-endian byte order (respectively)
in the resulting filesystem image, no matter what byte order the build
host uses.  The tr invocation is used to ensure that the filesystem
image is initialized with 0xFF bytes (which are an indicator of unused
space for Yaffs2 code).

Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
Link: https://github.com/openwrt/openwrt/pull/13453
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-05 17:03:24 +02:00
Michał Kępień
7e2a3af8c4 tools: add Yafut to enable creating Yaffs filesystem images
The Yafut tool has so far been used to update the kernel on devices with
NAND flash via MTD character devices.  Recent upstream updates extended
the tool with limited support for working with filesystem images stored
in regular files.  This enables Yafut to be used for preparing a Yaffs
filesystem image for a device with NOR flash on a build host and
subsequently flashing it to the target device without using Yafut
itself.

Add Yafut to tools/ so that it can be compiled and run on the host
building OpenWRT.

Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
Link: https://github.com/openwrt/openwrt/pull/13453
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-05 17:03:24 +02:00
Robert Marko
4454361e54 tools/elfutils: pass -O2 in HOST_CXXFLAGS
Trying to compile elfutils on Fedora 40 with GCC 14.1.1 will fail with:
/home/robimarko/Building/AX3600/qualcommax/staging_dir/host/bin/g++ -std=c++11 -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/home/robimarko/Building/AX3600/qualcommax/staging_dir/host/share/locale"'  -DDEBUGPRED=0 -DSRCDIR=\"/home/robimarko/Building/AX3600/qualcommax/build_dir/host/elfutils-0.191/src\" -DOBJDIR=\"/home/robimarko/Building/AX3600/qualcommax/build_dir/host/elfutils-0.191/src\" -I. -I..  -I../libgnu -I../libgnu -I. -I. -I../lib -I.. -I./../libelf -I./../libebl -I./../libdw -I./../libdwelf -I./../libdwfl -I./../libasm -I../debuginfod -I/home/robimarko/Building/AX3600/qualcommax/staging_dir/host/include  -std=c++11 -Wall -Wshadow -Wtrampolines -Wlogical-op -Wduplicated-cond -Wnull-dereference -Wimplicit-fallthrough=5 -Werror -Wunused -Wextra -Wstack-usage=262144   -D_FORTIFY_SOURCE=3  -c -o srcfiles.o srcfiles.cxx
In file included from /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h:39,
                 from /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h:2521,
                 from /usr/include/c++/14/cstdlib:41,
                 from ../libgnu/gettext.h:56,
                 from ../libgnu/eu-config.h:62,
                 from ../config.h:2378,
                 from srcfiles.cxx:31:
/usr/include/features.h:414:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
  414 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
cc1plus: all warnings being treated as errors

So, lets do as the error says and pass -O2 in HOST_CXXFLAGS like we already
do by default in HOST_CFLAGS.

Link: https://github.com/openwrt/openwrt/pull/15368
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-31 16:01:43 +02:00
Michael Pratt
5f47ccc0ea tools/elfutils: do not directly link gnulib to libelf
The compiled library resulting from importing gnulib has been
linked to libelf in order to easily cover other link dependencies.
However, this is not appropriate for linking libelf to other programs
as it bloats the resulting libelf library, and may result in
multiple defintions of symbols based on whether or not
certain modules from gnulib are included while elfutils
already has it's own definition of a function.

This is not a problem while building elfutils, because gnulib has
it's own way of creating function aliases and special declarations
that allow the linker to ignore the original function definitions,
however, when libelf is used to link to something else,
this results in an error at link time.

The gnulib manual recommended linking the libraries directly,
but those who have written it may not have considered how this
can affect the ability to link that library in other builds,
they likely assume the build targets would not be a dependency.

Fix this by removing the linking between gnulib and libelf
and instead overriding Make variables in order to add linking
between gnulib and each of the binaries provided by elfutils,
using Make functions to avoid applying it to other subdirectories.

The function tdestroy() would still be missing on macOS,
but the existence of the gnulib tsearch object having been built
is an indicator of whether or not it is needed
because it is only built conditionally by gnulib,
so include linking that object only when it exists.

Block the unnecessary replacement of some functions by gnulib
so that future linking with libelf doesn't require
the associated gnulib "rpl" prefixed functions.
These replacements are very strict in order to correct
minor bugs that don't have a real impact in almost all cases
or new standards requirements that are not yet in effect or used.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15368
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-31 16:01:43 +02:00
Michael Pratt
7822908bf3 tools/elfutils: install a subset of the elfutils binaries
Install binaries that are not common with binutils
instead of none at all. This adds a negligible time to the build.

Building shared libraries is disabled, so the AM_LDFLAGS can be reset
without the rpath-link option which is unrecognized by clang.

Some of the binaries depend on functions that are defined
using a "strong alias" instead of a normal definition,
but this is disabled by our patches in order to work on macOS,
so use the identical function directly instead.

Add fnmatch from gnulib with GNU extensions
which is needed for usage of the FNM_EXTMATCH flag.

Handle a "Wunused-const-variable" error with the same
preprocessor conditional used to include the function
that the variable is used in.

Ref: f64bd4b6c ("tools/elfutils: only build required components")
Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15368
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-31 16:01:43 +02:00
Michael Pratt
37f20d8c34 tools/gnulib: unmangle fts header on macOS
The gnulib fts header is meant to not be overwritten
in any way by the host system's copy of fts.h
and was therefore given a unique name instead.

This is fine if the built libgnu library is directly linked
with the target library, but if we want to keep them isolated
we end up having the definitions being mangled anyway
when the next object to link against included the fts.h header.

On some macOS platforms, the use of __DARWIN_INODE64
is messing with the link name for fts functions, resulting in:

Undefined symbols for architecture x86_64:
  "_rpl_fts_close$INODE64", referenced from:
...

Create a local fts header for gnulib
that completely blocks the macOS host fts header.

An alternative and more upstream friendly fix would be
to rename fts_.h to fts.h and add the macOS-only
include guard to that file within it's own include guard,
but that would be a massive patch, so do this for now.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15368
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-31 16:01:43 +02:00