1
0
mirror of https://github.com/openwrt/openwrt.git synced 2025-10-30 07:49:23 +08:00
Commit Graph

2325 Commits

Author SHA1 Message Date
3e6c3bf5a3 tools: b43-tools: Update to latest HEAD
Add the following changes:
```
12524df b43-asm: fix undefined behavior by using unsigned shift
fa9cb86 Merge pull request #9 from PolynomialDivision/unsinged-fix
5d592cb fwcutter: Fix compiler warning
b96318b dasm: Fix compiler warning
2270cee ssb_sprom: Fix _DEFAULT_SOURCE warning
4781cde ssb_sprom: Fix compiler warning
cce45e3 ssb_sprom: Update .gitignore
5ca416f disassembler: Update .gitignore
44673b6 Update .gitignore
0c8f8b6 assembler: Update .gitignore
1f5b63d fwcutter: Update .gitignore
35fe438 Add README.md
```

Link: https://github.com/openwrt/openwrt/pull/20542
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-25 22:35:37 +02:00
f596ae7b85 tools: firmware-utils: update to Git HEAD (2025-10-20)
313f344 dlink-sge-image: add support for D-Link DIR-X1860 B1/DIR-X1550 A1

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-20 00:17:46 +02:00
0b116e9d73 tools/meson: add pending patch to improve binary reproducibility
Add 3 pending patch that improve binary reproducibility. The first
address a problem with RPATH string not getting cleared on removal of
RPATH entry from ELF section. The other 2 skip including external shared
library in RPATH in meson build phase.

This follows the logic that on cross-compiling we can't run the binary
anyway as it does target a different arch hence it doesn't make sense to
include those extra path in RPATH causing reproducibility problems (as
path for those external library will depend on the build system path)

Link: https://github.com/openwrt/openwrt/pull/20389
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-10-14 17:13:04 +02:00
50e4d4f4ba tools/mkimage: update to version 2025.10
Update package to the latest stable version.
All patches need to be updated.

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
Link: https://github.com/openwrt/openwrt/pull/20379
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-10-11 21:50:41 +02:00
8c030a3b13 tools: xxhash: fix PKG_MIRROR_HASH
Current PKG_MIRROR_HASH is wrong, but it went unnoticed, because the
tarball is being fetched from @OPENWRT project mirrors. After
042996b46b revert the correct hash can be reproduced with:

 make tools/xxhash/{download,check} FIXUP=1 DL_DIR=/tmp PKG_MIRROR_HASH=''

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Link: https://github.com/openwrt/openwrt/pull/20322
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-09 13:37:58 +02:00
2dae098d69 tools/ninja: update to 1.13.1
Jobserver support was merged upstream.

Switch to local tarball archives. Smaller and more standard.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20267
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 20:34:38 +02:00
6f32c657db tools/ccache: same behaviour for local and CI builds
If the environment variable `CI` is set, ccache will enable the CMake
option CCACHE_DEV_MODE by default. This leads to differing behaviour
between local and CI builds which takes quite some time to debug. 🤯

Achieve consistent behaviour between local builds and CI builds by
setting CCACHE_DEV_MODE. Set it to OFF, because CCACHE_DEV_MODE amongst
other settings like linker choice, enables -Werror, which will lead to
potential compilation failures when the host compiler is updated. Using
-Werror for host utils is not desirable, because the compiler version
used is not controlled by the OpenWrt build system and host utils should
compile successfully on an as wide range of host OSes as possible.

Reported-by: Roman Azarenko <roman.azarenko@iopsys.eu>
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/20290
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-10-04 00:33:53 +02:00
8f4f7cce76 firmware-utils: revert commit breaking x86 MBR images
0782d24 Revert "ptgen: do not create stub partition to fill a gap if gap caused by alignment"

Fixes: #20254
Fixes: c5ece837a3 ("firmware-utils: update to git HEAD")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-10-01 16:44:43 +01:00
c5ece837a3 firmware-utils: update to git HEAD
7e6f69b npk_pack_kernel: add tool for creating MikroTik NPK kernel packages
 d3f8b6e zynsig: add new tool for creating images for the ZyXEL GS1920 series
 9fa340d ptgen: create separate images for gpt data structure
 78d8084 ptgen: allow image generation for a specified disk size
 3f2d148 ptgen: allow non-default placement of gpt entry table
 f1f98b0 ptgen: do not create stub partition to fill a gap if gap caused by alignment
 6ea8b6d ptgen: fix protective MBR partition size
 febfef7 ptgen: use long long instead of long for sizes
 996dc48 ptgen: fix misprint and simplify calculation a bit
 0725c3d build: require CMake >= 3.5 due to dropped legacy support

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-09-29 17:34:51 +01:00
842623a4f8 expat: Update to 2.7.3
Fixes:
    CVE-2025-59375
    Regression from: CVE-2024-8176

Changelog: https://github.com/libexpat/libexpat/blob/R_2_7_3/expat/Changes

Signed-off-by: Ted Hess <thess@kitschensync.net>
2025-09-27 17:49:44 -04:00
b2277e9bab mold: Update to 2.40.4
Update mold to 2.40.4

Release notes:
https://github.com/rui314/mold/releases/tag/v2.40.4
https://github.com/rui314/mold/releases/tag/v2.40.3
https://github.com/rui314/mold/releases/tag/v2.40.2

Signed-off-by: Carsten Schuette <schuettecarsten@googlemail.com>
Link: https://github.com/openwrt/openwrt/pull/19846
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-25 10:30:14 +02:00
d01165a6ce tools/squashfs4: update to 4.7.2
This minor version update only includes some build fixes and
improvements.

Release Notes:
  https://github.com/plougher/squashfs-tools/releases/tag/4.7.1
  https://github.com/plougher/squashfs-tools/releases/tag/4.7.2

Remove upstream patches:
  001-thread-add-the-missing-pthread.h-header.patch[1]
  002-print_pager-add-missing-includes.patch[2]

[1] b6e9f4b62c
[2] 05a895b3f9

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19820
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-08-20 23:33:22 +02:00
5290e2f523 tools: lzop: add patch bumping minimum CMake version to 3.5
Recent CMake releases require at least version 3.5.

Link: https://github.com/openwrt/openwrt/pull/19813
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-08-20 14:56:47 +02:00
4e9fbc75c7 tools/7z: update to 25.01
This version contains fixes for CVE-2025-55188.
Changelog: https://www.7-zip.org/history.txt

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/19742
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-08-17 11:09:46 +02:00
4c0d64cb96 tools: libtool: always install all auxillary files
Remove the needless restriction
for which auxillary files are installed.
This aligns the behavior of libtoolize
with the existing behavior of automake.

This can prevent the seemingly random error
if autoreconf happens to be ran multiple times:

  configure: error: cannot find required auxiliary files: compile

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/19748
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-11 22:28:41 +02:00
a808086826 tools: gnulib: always use std-gnu23 module
The new "std-gnu23" module has the stated goal of:
"...to update the c99 module to depend on std-gnu23
instead of on std-gnu11, and to make std-gnu11 obsolete."
in upstream commit 8990abb50 ("std-gnu23: new module").

However, for now, it's design is optional, so that
definitions of the latest standard module overrides the former.
At some point, upstream gnulib will replace the dependency
instead of add it alongside the older one.

Because all macros are copied to the aclocal directory,
for complex projects, not including the module
may cause the macros to apply only to some subdirectories
rather than all of them and top-level together.

For projects that import source from local gnulib,
always include the std-gnu23.m4 macros for consistency.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/19748
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-11 22:28:41 +02:00
2876106eb4 tools: bash: fix PKG_HASH
Invalid hash was added during the 5.3 update and CI will fail since none
of the available sources has the tarball with incorrect hash.

Fixes: 423ed9fc5a ("tools: bash: update to 5.3")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-11 12:16:18 +02:00
bf917ea792 tools: lz4: update to 1.10.0
Changelog:
08bfdbe222/NEWS

Switch the lz4 source from codeload to git.

Link: https://github.com/openwrt/openwrt/pull/19560
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-08-05 07:01:07 +02:00
f0746741f8 tools: firmware-utils: update to Git HEAD (2025-08-03)
3346d77 build: add mkqdimg
950f834 iptime-crc32: add support for ipTIME AX7800M-6E

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-03 01:08:50 +02:00
ba76da4fe9 tools: gnulib: do not cache C standard option test results
After eliminating the possibility of automake having a bug
by testing a revert to the recent updates to automake,
the problems regarding autoreconf with some packages
was bisected to the gnulib update instead, through aclocal macros.

With the new module, std-gnu23, some packages are failing build
due to both the host compiler and cross compiler being tested for
availability of C23 standard features with the configure script.
The results of one is being cached and used for the other,
while the two compilers are different versions and may or may not
both support C23 options and would otherwise have conflicting results.

A similar patch may have to be done
for the next release of Autoconf
if upstream GNU does not accept this solution.

Reported-by: Georgi Valkov <gvalkov@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/19627
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-08-03 00:41:05 +02:00
e3637b202d tools: util-linux: allow building with 32-bit time
Similar to several GNU tools, util-linux when built using meson
is configured by default to error when 64-bit time is not supported.

To solve this in the same way as standard configure scripts,
check for 64-bit time support ahead of time,
and allow 32-bit time when not supported.

In the future, the YEAR_2038 variable
can be used as a build prerequisite
instead of being used for configuration.

Ref: 39e8ef33bf ("build: add test for 64-bit time support")
Fixes: e15d5cf752 ("tools/util-linux: build with meson")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/19617
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-08-01 08:49:03 +02:00
e15d5cf752 tools/util-linux: build with meson
Simplifies Makefile by quite a bit.

Added an upstream backport fixing compilation with older OS.

Added a curses patch so -Dauto_features=disabled can work properly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19598
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-31 08:43:44 +02:00
66916096f3 tools: bison: do not install or uninstall macros
There is a clobbering between bison and gnulib for installing
the macro file bison-i18n.m4 where gnulib has a newer version
while bison will replace it with an outdated version if built afterward.

Other builds depend on the changes made to the bison-i18n.m4 file and are
only included using aclocal unless other modifications are made in each case
in order to force imported macros from gnulib to override aclocal macros.

Gnulib is integrated within bison, however it is not with a bootstrap script
and there is already a reverse dependency between the two, where bison
is indirectly required for gnulib to start building. Therefore, do not allow
the building or cleaning of bison to install or uninstall m4 files.

Reported-by: Tianling Shen <cnsztl@immortalwrt.org>
Fixes: d19f8bc199 ("tools/gnulib: update to branch stable-202501")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/19606
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-30 23:06:30 +02:00
c20f4d6637 tools: util-linux: refresh patches
util-linux needs to be refreshed, so do so.

Fixes: 4fd6117129 ("tools/util-linux: fix libuuid linking")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-30 10:58:30 +02:00
4fd6117129 tools/util-linux: fix libuuid linking
The pkgconfig file that autotools uses is wrong for static libraries.
meson does the right thing but for static libraries, .private entries
need to move to non .private.

Fixes compilation with at least mtd-utils.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19597
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-29 22:00:44 +02:00
b0650c50c8 tools/expat: fix compilation with ccache
Even though expat is a C library, the configure script tests both C and
C++ compilers so a fix is needed for the latter.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19594
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-29 21:33:12 +02:00
dddf7b05cd tools: automake: fix MAINTAINERCLEANFILES warnings
It seems that, for whatever reason in this case,
the function "vardef ($var, $cond)" does not work
while "$var->def ($cond)" does work for conditionals.

Also, do not define it conditionally when defined unconditionally.
Even though the reordering patch would make that functionally sound,
it still throws a warning which can cause a build to fail
when warnings are treated as errors.

Instead, just add BUILT_SOURCES to every existing case
rather than only when BUILT_SOURCES is defined.

Fixes: 6d2bfe50d3 ("tools/automake: control all cleaning with clean variables")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/19593
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-29 21:31:11 +02:00
ebd0052f45 tools: pkgconf: update to 2.5.1
Changelog:
4fc570f91d/NEWS

Link: https://github.com/openwrt/openwrt/pull/19557
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-28 00:57:25 +02:00
df3164f205 tools: mtools: update to 4.0.49
Changelog:
- 4.0.45: https://lists.gnu.org/archive/html/info-gnu/2024-09/msg00010.html
- 4.0.46: https://lists.gnu.org/archive/html/info-gnu/2024-11/msg00003.html
- 4.0.47: https://lists.gnu.org/archive/html/info-gnu/2025-01/msg00010.html
- 4.0.48: https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00008.html
- 4.0.49: https://lists.gnu.org/archive/html/info-gnu/2025-06/msg00004.html

Link: https://github.com/openwrt/openwrt/pull/19561
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-28 00:52:47 +02:00
423ed9fc5a tools: bash: update to 5.3
Changelog:
https://www.mail-archive.com/bug-bash@gnu.org/msg34422.html

Link: https://github.com/openwrt/openwrt/pull/19546
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-27 18:10:46 +02:00
fbf991544f tools: fakeroot: update to 1.37.1.2
There are no patches that need to be refreshed.

Changelog:
https://salsa.debian.org/clint/fakeroot/-/blob/debian/1.37.1.2-1/debian/changelog?ref_type=tags

Link: https://github.com/openwrt/openwrt/pull/19545
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-27 18:07:16 +02:00
aeaa61517b tools: automake: update to 1.18.1
automake update to 1.18 broke buildbots as we dont have makeinfo host tool
present, after investigation this was an automake regression that was fixed
in 1.18.1[1].

So, since 1.18.1 contains small number of fixes, update to it instead of
just backporting the single commit.

[1] https://cgit.git.savannah.gnu.org/cgit/automake.git/commit/?id=9b92240af4a8f7a3050c13adec367cf48e9ce063

Fixes: d7d0205940 ("tools/automake: update to 1.18")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 17:09:19 +02:00
d7d0205940 tools/automake: update to 1.18
Update to the latest stable release
with the new API versions for binaries.

The temporary patching of shebangs is no longer necessary
since the whitespace check has been changed to a warning.

Part of a patch was upstreamed and therefore removed.

Manually adjusted patch:
 - 000-relocatable.patch
 - 101-do-not-require-files.patch

All other patches are automatically refreshed.

Link: https://lists.gnu.org/archive/html/autotools-announce/2025-05/msg00001.html
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
1a253a2bb5 tools/gnulib: backport patches for gettext
The latest versions of gettext rely on several changes to gnulib
including both changes to modules and new modules
and some previously gettext specific code being moved to gnulib.

Backport these changes in order to allow updating gettext
while using the local gnulib copy of sources.

Add patch:
 - 640-mem-hash-map.patch
 - 645-next-prime.patch
 - 646-hashcode-string.patch
 - 647-hashkey-string.patch
 - 650-package-version.patch
 - 651-package-version-simplify.patch
 - 652-package-version-simplify-further.patch
 - 653-package-version-warning.patch
 - 660-version-stamp.patch
 - 689-vc-mtime.patch
 - 755-clean-temp-hashkey.patch
 - 795-string-desc-rename-functions.patch
 - 796-vc-mtime-less-read.patch
 - 797-vc-mtime-add-api.patch
 - 798-vc-mtime-add-api.patch
 - 799-vc-mtime-old-git.patch
 - 900-str_startswith-module.patch
 - 901-str_endswith-module.patch

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
d19f8bc199 tools/gnulib: update to branch stable-202501
Move to the June 2025 update of the first 2025 stable branch
in order to better support updating gettext to the latest versions.

More instances of blocking the defining of functions
that use reallocarray() is needed for portability with macOS
as more similar functions have been added.
And one instance is removed as the function was removed.
Refer to a previous commit to explain the need for this.

Manually adjusted patch:
 - 150-portable-tdestroy.patch
 - 160-flag-reallocarray.patch
 - 200-force-disable-after-configure.patch

Removed upstreamed patch:
 - 500-acl-function-name.patch

All other patches are automatically refreshed.

Ref: 5ade7ee60 ("tools/gnulib: add macros to skip reallocarray() functions")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
0b4ebe5dd3 tools/elfutils: enable parallel building
There are multiple subdirectories for elfutils
and more than one is not dependent on another,
so enabling parallel building can save time
if multiple cores are available.

The change in build time for the package
is as much as 20% when cores are not in use by other jobs.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
abf243eae8 tools/elfutils: update to 0.192
Update to the next release.

Removed upstream patch:
 - 000-backport-iquote-include.patch
 - 010-backport-mips-support-reloc.patch
 - 014-backport-mips-support-stack.patch
 - 015-backport-mips-support-regs.patch
 - 095-src-unused-variable.patch
 - 096-lib-config_h.patch
 - 097-libcpu-config_h.patch
 - 098-libdw-maintainer-clean.patch
 - 099-remove-unlocked-stdio.patch

Manually adjusted patch:
 - 012-backport-mips-support-readelf.patch
 - 013-backport-mips-support-elflint.patch
 - 101-shared-conditional.patch

All other patches are automatically refreshed.

Link: https://sourceware.org/pipermail/elfutils-devel/2024q4/007540.html
Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
5bb84fb53b tools/elfutils: update MIPS support patches
The original patch series partially added by commit
f97da2c61 ("tools/elfutils: add missing MIPS reloc support")
now has a v3 which has half of it's commits accepted.

To prepare for updating to the new release,
use the new series that includes backports.

Manually adjusted patch:
 - 010-backport-mips-support-reloc.patch

Add patch:
 - 011-backport-mips-support-strip.patch
 - 012-backport-mips-support-readelf.patch
 - 013-backport-mips-support-elflint.patch
 - 014-backport-mips-support-stack.patch
 - 015-backport-mips-support-regs.patch

Tested-by: Tony Ambardar <itugrok@yahoo.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
c83941d288 tools/elfutils: add maintainer-clean to clean target
Use the clean recipe during build, so that files already
generated by the bootstrapping within the release are removed
before the bootstrap script is run again.

Automake with modified rules must be ran
in order to generate a Makefile that does delete itself or libtool.

In order to enable rules for building what is removed,
maintainer mode is required for configuring.

Building from tracked sources only with maintainer mode
requires a lexical analyzer, so add dependency for bison.

Override an automake variable "am__CONFIG_DISTCLEAN_FILES"
in order to prevent removing config.status and other configure files
so that configure stage does not need to be ran twice.

The function obstack_printf() is not present on macOS,
so use the available gnulib module and their dependencies.

Many more modules from gnulib are now needed,
and some replacements of some functions must be skipped
to prevent build errors at link time.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
c16ed51e06 tools/elfutils: backport version 0.192 portability patches
These patches will be present in version 0.192 release.

Include them before the update
to support changes before updating
and in order to have a more organized git history.

Manually refreshed patch:
 - 110-objects-manifest.patch

Add patch:
 - 095-src-unused-variable.patch
 - 096-lib-config_h.patch
 - 097-libcpu-config_h.patch
 - 098-libdw-maintainer-clean.patch
 - 099-remove-unlocked-stdio.patch

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
8f920d2f94 tools/elfutils: replace dependency hack with upstream include path fix
In order to solve the problem of the possibility that
the "stack" binary is incorrectly included as a header
while the compiler looks for the standard C++ header "stack",
a workaround forcing a dependency between building "stack"
and the C++ program was introduced.

This upstream fix uses the compiler "-iquote" option
in order to avoid looking for standard headers
in the current working directory
and blocks the default inclusion of "-I ."
to the compiler flags.

The upstream fix happens to be incomplete,
so add an extra patch to fix an additional instance
and then remove the workaround.

Also, adjust the way DEFAULT_INCLUDES is overridden
in the build Makefile by using the "-iquote" option
in the same manner in order to remove all instances
of the default inclusion for the current directory.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
30105c77ef tools/automake: do not delete libtool in clean targets
For the building of some packages, it is helpful
to completely clean the packaged release copy of the source,
however this usually deletes libtool if used,
otherwise causing the need to run the bootstrap script twice.

Not deleting libtool allows compilation to continue directly
after cleaning pre-generated files in the package distribution.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
7a8fd73548 tools: require coreutils to build util-linux
The install stage of util-linux uses the install utility
with GNU options which is provided to macOS by coreutils.

Before, Make coincidentally built them in the right order,
this makes the prerequisite explicit.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
405652469f tools: require coreutils to build findutils
The install stage of findutils uses the install utility
with GNU options which is provided to macOS by coreutils.

Before, Make coincidentally built them in the right order,
this makes the prerequisite explicit.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
e776c9fe4e tools: require coreutils to build elfutils
The version of the rmdir utility in macOS is POSIX-only
while elfutils uses the GNU extended options while building.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
f7fd8303be tools: build coreutils for development targets
Include the coreutils utilities required for macOS
and other non-GNU friendly OSs to products like the SDK.

This also allows manually building coreutils on Linux
without having to manually edit this Makefile.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
90262c6f6e tools/coreutils: provide the rmdir utility
Use the rmdir utility provided by GNU coreutils for macOS
in order to be able to use the option "--ignore-fail-on-non-empty".

Some other tools such as elfutils use this while building.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
b8c0ed4692 tools/coreutils: replace symlinks to build prerequisites
Before building, symlinks are made from existing utilities
on the host machine, because they are necessary before
coreutils can be built.

Instead of leaving these utilities as symlinks,
replace them with the copy provided by the coreutils build
in order to increase version control for these utilities
and to have a real copy for targets like the SDK.

The utilities required before building and provided by coreutils are
cp, install, realpath, seq, and stat.

Let all of the utilities be installed with the "g" prefix,
then, existing symlinks named without the "g" prefix are safely replaced
with a new symlink using the coreutils version of `ln` just built
in order to prevent an inconsistent state of the file
since these utilities must always be available.

While at it, sort the list alphabetically.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
5c832d7833 tools/coreutils: disable uninstall target
GNU coreutils is a unique case where we require
some of the utilities on the host machine
before anything is built.

The prerequisite is handled by symlinks to the host binaries
in the staging directory that are installed
by the build system and that are expected to remain
as long as the corresponding stampfile exists.

Because the binaries built by coreutils
will replace the symlinks, the uninstall target
will actually delete the symlinks
long before the build finishes whenever it is ran.

This can cause the utilities to be temporarily missing
from the controlled part of the shell's PATH,
so disable the removal of the coreutils utilities.
The appropriate way to clear all of the programs and links
would be `make dirclean`.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
6a3cfeb4a6 tools/coreutils: add maintainer-clean to clean target
Use the clean recipe during build, so that files already
generated by the bootstrapping within the release are removed
before the bootstrap script is run again.

Automake with modified rules must be ran
in order to generate a Makefile that does not delete itself.

Override an automake variable "am__CONFIG_DISTCLEAN_FILES"
in order to prevent removing config.status and other configure files
so that configure stage does not need to be ran twice.

Redefine MAINTAINERCLEANFILES with Make functions
to avoid deleting the targets of gettext and gperf rules.

In order to prevent an inconsistent state of `install`
since this utility must always be available as a prerequisite,
do not allow it to be removed.

Instead of preventing the removal of the config.h header,
the Makefile supports regenerating it quickly.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00