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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>