The DEFAULT_INCLUDES override adds -I. to the src directory. There,
upstream deliberately clears DEFAULT_INCLUDES: with libc++, <format>
includes <stack>, which then resolves to the stack binary in src.
Leave out -I. for the src directory.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
UBIFS root file systems differ between builds, e.g. the one of the
Microchip SAMA7G5-EK: the superblock gets a random UUID, the inodes get
the ctime of the build host, which can't be reset with touch, and the
entries of each directory are added in readdir() order, which depends on
the host file system and decides inode numbers and layout.
Add a patch that, when SOURCE_DATE_EPOCH is set, uses a time-based
(version 1) UUID with that time and clamps all inode times to it. The
node ID of the UUID is taken from the new --uuid-node option, which the
image build sets from IMG_PART_DISKGUID, itself derived from
SOURCE_DATE_EPOCH and the kernel vermagic.
Directory entries are added sorted by name. Two trees with the same
contents but different ctimes and readdir() order now give identical
images; without SOURCE_DATE_EPOCH the UUID stays random.
Link: https://github.com/openwrt/openwrt/pull/25430
Signed-off-by: Paul Spooren <mail@aparcar.org>
Update b43-tools to latest git commit 36284a5 (release b43-fwcutter-021).
Includes upstream commit 61105cc ("Makefiles: Declare source
prerequisites for object rules"), which fixes build failures on macOS
and systems where $< resolved to generated dependency prerequisites
rather than the source file.
Changes:
36284a5 fwcutter: Update release script
8690498 ci: Reduce flags
e23a1bb Align all CFLAGS
8440ca7 Add build CI
672a056 Use true instead of hardcoding /bin/true
7fd711a fwcutter: Bump version
61105cc Makefiles: Declare source prerequisites for object rules
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25500
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
OpenWrt's custom uImage magic patch makes legacy image verification use
params.magic instead of IH_MAGIC.
mkimage initializes this field, while dumpimage leaves it zeroed. This
causes dumpimage to reject valid legacy uImages using the standard
IH_MAGIC with FDT_ERR_BADMAGIC.
Initialize dumpimage's magic to IH_MAGIC so the normal verification path
works by default. Also add -M handling matching mkimage, allowing
dumpimage to verify and extract uImages built with a custom magic.
Tested with the patched U-Boot 2026.07 host tools. Standard-magic images
list and extract correctly, custom-magic images are accepted with the
matching -M value, and are rejected without it or with an incorrect
magic. Extracted payloads were verified byte-for-byte.
Fixes: #25287
Signed-off-by: Massimo Mazzariol <mazzariol.massimo@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25288
Signed-off-by: Robert Marko <robimarko@gmail.com>
Host/Configure/Default supplies the bootstrap "--" separator before
CMAKE_HOST_OPTIONS. Keep BUILD_TESTING with the CMake cache options so
it is passed after that separator, without introducing a second one.
Fixes: ddb23f3a02 ("tools/cmake: pass -DBUILD_TESTING=OFF to bootstrap")
Signed-off-by: Robert Marko <robimarko@gmail.com>
Instead of carrying 100-no-testing.patch, pass -DBUILD_TESTING=OFF
directly to CMake's bootstrap script. This avoids refreshing the patch
on every CMake update.
The patch also changed the default in the installed CTest.cmake module.
Preserve that behavior by passing -DBUILD_TESTING=OFF by default in
cmake.mk for target and host builds. Packages can override it via
CMAKE_OPTIONS or CMAKE_HOST_OPTIONS.
OpenWrt never runs CMake tests, so building them only wastes build time.
This replaces the patch introduced in 8af80e79bd ("tools/cmake:
update to 3.17.0").
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24403
Signed-off-by: Robert Marko <robimarko@gmail.com>
Instead of carrying a patch (150-zstd-libarchive.patch) that modifies
Utilities/cmlibarchive/CMakeLists.txt to enable pkg-config search for
zstd, pass explicit staging library and include paths (-DZSTD_INCLUDE_DIR
and -DZSTD_LIBRARY) directly to CMake's bootstrap script.
ZSTD_INCLUDE_DIR and ZSTD_LIBRARY are the cache variables CMake itself
sets when --system-zstd is not used, so pre-seeding them guarantees that
CMake always links against OpenWrt's staging libzstd without requiring
a patch.
Fixes: 0e3d51ccae ("tools/cmake: fix compilation with host libzstd-dev")
Suggested-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24407
Signed-off-by: Robert Marko <robimarko@gmail.com>
Configure stage without a cache against a warm cache:
mtools 3.34 s -> 0.28 s
gengetopt 4.39 s -> 2.13 s
fakeroot 10.97 s -> 8.73 s
xz 4.32 s -> 2.17 s
libressl 3.07 s -> 1.46 s
flex 12.32 s -> 10.98 s
expat 2.74 s -> 1.52 s
bc 1.34 s -> 0.38 s
dosfstools 3.13 s -> 2.54 s
libtool 2.86 s -> 2.29 s
mtd-utils 4.06 s -> 3.56 s
flex, fakeroot, dosfstools and mtd-utils run autoreconf in the same
stage, and the cache does not reach that part.
Each of the eleven configures the same way with a warm cache as it does
without one: the check configures three times, without a cache, with a
cold cache and with a warm cache, and every generated file of the first
and the last run is identical. A static scan of each configure script
found no cache check that changes CFLAGS, CPPFLAGS, LDFLAGS or LIBS
without restoring it.
patchelf, mklibs and automake pass the same check but gain less than
half a second, so they stay out.
make world after make tools/clean now takes 121 s against 177 s with
cold caches.
Signed-off-by: John Crispin <john@phrozen.org>
sparse set PKG_BUILD_PARALLEL, which a host build does not read, so it
built with one job. Use HOST_BUILD_PARALLEL: 6.6 s -> 1.3 s.
It builds five times out of five with the job server, and each build
installs files that are identical to those of a serial build.
Signed-off-by: John Crispin <john@phrozen.org>
libtool 22.5 s -> 20.0 s
dosfstools 6.0 s -> 4.8 s
make-ext4fs 2.1 s -> 1.2 s
automake 3.9 s -> 3.4 s
autoconf 3.1 s -> 2.6 s
Each one builds five times out of five with the job server, and each
build installs files that are identical to those of a serial build.
Signed-off-by: John Crispin <john@phrozen.org>
host-build.mk clears MAKEFLAGS, so a custom Host/Compile that runs a bare
$(MAKE) builds with one job, whatever HOST_BUILD_PARALLEL says. mtools
sets the flag, but its compile step never used it.
Each of the three now passes $(HOST_JOBS), and mkimage and lzma set
HOST_BUILD_PARALLEL:
mkimage 11.7 s -> 7.2 s
mtools 8.3 s -> 4.8 s
lzma 4.0 s -> 1.8 s
Each one builds five times out of five with the job server, and each
build installs files that are identical to those of a serial build.
Signed-off-by: John Crispin <john@phrozen.org>
yaffsfs_CurrentTime() returns the wall clock, and Yaffs writes that value
to the access, modification and change time of every object header. The
RouterBOARD images of ipq40xx/mikrotik therefore differ on every build,
and so does the sysupgrade metadata checksum that follows them.
Add a patch that reads SOURCE_DATE_EPOCH, which the build already exports.
Tested with two images written one second apart. They are identical with
SOURCE_DATE_EPOCH set and differ without it.
Signed-off-by: John Crispin <john@phrozen.org>
These ten hold up the wall clock on their own. Their configure stages
run while nothing else does, because the tools build in dependency
order. Measured over a full build, cold cache against warm:
sed 21.68 s -> 1.22 s
m4 21.48 s -> 1.22 s
findutils 19.47 s -> 1.56 s
tar 17.75 s -> 1.47 s
cpio 14.28 s -> 1.26 s
bison 12.81 s -> 1.29 s
patch 12.16 s -> 1.31 s
elfutils 26.58 s -> 15.47 s
Each of the ten configures the same way with a warm cache as it does
without one. The check runs configure three times, without a cache, with
a cold cache and with a warm cache, and compares every file that
configure generates between the first and the last. ncurses fails that
check; these do not.
The only difference left is ac_ct_AR and ac_ct_RANLIB, which a cold run
fills through the fallback path of AC_CHECK_TOOL and a warm run leaves
empty. AR and RANLIB are correct in both, and no generated Makefile
reads the ac_ct_ form.
tools/cmake keeps its 33 s, the longest configure stage in the build. It
bootstraps with its own script rather than autoconf, so this does not
reach it.
Signed-off-by: John Crispin <john@phrozen.org>
A tool builds with -j1 unless it sets HOST_BUILD_PARALLEL, and 45 of the
73 tools do not set it. These three gain the most from the job server on
a cold build of this tree:
erofs-utils 23.11 s -> 15.73 s
mtd-utils 11.70 s -> 6.42 s
cpio 8.46 s -> 3.56 s
Each one builds three times out of three with the job server, and each
build writes a tree that is identical to the one a serial build writes.
Signed-off-by: John Crispin <john@phrozen.org>
Commit c820f097e0 ("tools: gnulib: install .m4 file with gl_ prefix")
installed gnulib autoconf macros under gl_-prefixed file names. The
scheme was later reverted in commit cda598a595, but the previously
installed files were never removed from share/aclocal.
As aclocal reads the whole directory, stale gl_*.m4 files can override
the current unprefixed macros. This breaks elfutils builds on macOS
after the gnulib stable-202507 update, resulting in empty #if
expressions in the generated ctype.h.
Remove the stale files in Host/Uninstall. Host/Install calls it first,
so affected build trees are cleaned up automatically on the next
gnulib reinstall.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24759
Signed-off-by: Robert Marko <robimarko@gmail.com>
Remove upstreamed patch.
Remove HOST_CONFIGURE_VARS. These are not needed any more.
ac_cv_search_setfilecon was removed completely and the others are guarded
by if test "$with_selinux" != no; then now.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24572
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Fixes arm64 build failures by replacing <linux/uio.h> with POSIX <sys/uio.h>
to avoid header redefinition conflicts.
gnulib's fcntl.h ends up including glibc's fcntl.h and fcntl-linux.h
which includes glibc's types/struct_iovec.h,
thats where the redefinition happens.
the lines that use <linux/uio.h> are antiquated and were never necessary.
it can be traced back to the original 2014 change that added the file with aarch64 support
in upstream commit 66637fa21044ac0058b25522f473669e73de328b
it was never necessary to use the linux header over the glibc headers,
as elfutils only needs the iovec struct and that struct was present since glibc 2.0 in the 1990s
Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24539
Signed-off-by: Robert Marko <robimarko@gmail.com>
Backport a patch that covers a build problem with latest glibc
being used as the host standard C library during tools build.
The C23 standard changes some functions that used to drop qualifiers
like "const" or "volatile" and are now forced to preserve them
in the return type based on the input type at all times.
Developers of glibc have responded by making these functions
into macros after they are declared with prototypes.
This is not compatible with the way gnulib is written,
so when the functions are redeclared in gnulib,
the preprocessor expands the _function name_ itself
as if it is a macro name, but not fully,
which results in unusual looking build errors,
e.g. the failed processing of keywords that were never written
and have no business being in a prototype, or,
as a keyword that is expected to be there and nearly guarenteed
to work but mysteriously is not working, displayed as:
"error: expected identifier or '(' before _____".
The backport patch introduces and implements a new macro
in order to prevent function names from being interpreted as macros,
by wrapping it in parentheses for C, or simply placing it back for C++
in the first stage of macro expansion which satisfies the goal
of no further expansion taking place during preprocessing.
Add an additional patch for the functions declared
in the fts header, as this bug also applies to them,
however, this was overlooked by upstream gnulib,
likely because the bug is not presenting as an error.
Yet another patch corrects the order between
specifiers and attributes in GCC syntax for header
lib/fts.in.h which can be blamed on an upstream commit.
Specifically, the throw() or noexcept() keywords
must be before attributes at the end of a declaration.
There are two headers, lib/cdefs.h and lib/getopt-ext.h
that already demonstrate the correct order which is very
strictly necessary in the latest version of GCC
when compiling C++ code, and acceptable for C code,
as the "__THROW" macro is simply another attribute in that case.
Added backport patch:
- 400-c23-qualifier-generic.patch
Added pending patch:
- 410-unmacro-fts-functions.patch
- 450-attribute-specifier-order.patch
Ref: 80e5de158316 ("fts: Improve GCC 11 allocation-deallocation checking.") # gnulib.git
Reported-by: Aditya Nugraha <vortexilation@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24247
Signed-off-by: Robert Marko <robimarko@gmail.com>
Move to the July 2026 update of the last 2025 stable branch.
This branch includes many new modules and changes to modules
that were previously patched, so many patches are dropped.
Newer gnulib now also has a proper fts header
in the form of a template file for variable definitions
that are set during configuration,
however, it still ends up named with an underscore,
so the patch 120-unmangle-darwin-fts-h.patch
in order to resolve differences between macOS and standard
fts headers is rewritten to patch the new header include guard
and the fts module file in order to name it without an underscore.
Manually Adjusted Patch:
- 120-unmangle-darwin-fts-h.patch
All other patches are automatically refreshed.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24247
Signed-off-by: Robert Marko <robimarko@gmail.com>
Now that cond.m4 is not being overwritten and is actively used,
make it less aggressive on encountering an undefined conditional
not set by a macro which is itself conditionally called,
where the condition is set to intentionally not trigger the macro.
This prevents the need to further patch a configure.ac file
to edit the improper usage of or remove a disabled macro
which triggers the error "conditional ___ is not defined..."
in the cases where autoreconf is still necessary for another reason,
or, if this is the only build issue,
autoreconf can now be used to avoid this.
Instead of erroring, align the behavior of AM_CONDITIONAL
closer to the gnulib variant gl_CONDITIONAL
which ignores and disables the conditional in this case.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24362
Signed-off-by: Robert Marko <robimarko@gmail.com>
It was reported that cond.m4 in gnulib is a name clash with
cond.m4 provided by Automake, where they are for completely
different purposes instead of different versions of the same macros.
A quick survey of all the macro files in the build directory reveals that
this is the only case where the gnulib copy is signficantly smaller
than the rest of the copies of the same macro name
distributed in the rest of the build system,
and the only one that name clashes with Automake.
A previous fix added a prefix to all macros from gnulib,
but the name must match how it is described in the respective modules files
as a functional requirement to build certain tools for certain (older) hosts,
so patch the problematic module instead of renaming all macros from gnulib.
Ref: c820f097e0 ("tools: gnulib: install .m4 file with gl_ prefix")
Ref: 78a8cfb577 ("tools: gnulib: fix broken install of .m4 files")
Reported-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24136
Signed-off-by: Robert Marko <robimarko@gmail.com>
Changelog included in source tar.
Removed patches:
- 000-getopt-prototype.patch
- 001-getopt-declaration.patch
Both patch changes are included upstream in this version.
Link: https://github.com/openwrt/openwrt/pull/23911
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>