Commit Graph
62 Commits
Author SHA1 Message Date
John Crispin 18a2ea702c build: start the configure cache cold when its answers may be stale
Three cases kept a cached answer that no longer held:

A new configure script. A package with an autoreconf fixup regenerates
configure with the staged autoconf, automake and libtool, and a new
version of one of them can change what a cache variable means. The site
script now keeps a checksum of configure beside the cache and drops the
cache when the checksum changes. A new patch to configure is covered too.

A changed precious variable. configure aborts when LIBS, CPP or another
precious variable differs from the value in the cache, and because
nothing removes the cache, it aborts on every later run as well:

  configure: error: 'LIBS' was not set in the previous run
  configure: error: changes in the environment can compromise the build

The site script now makes the same comparison before configure does and
drops the cache on a difference.

Paths under other names. The libtool answers lt_cv_path_*, acl_cv_path_*
and lt_cv_sys_global_symbol_*, and gmp_cv_prog_m4, hold the path of a
system tool or of the staged sed and m4, and survived a wipe of
staging_dir. The site script now drops them with the ac_cv_path_ answers.

m4 and gmp still configure the same way with a warm cache as they do
without one, and still read it: the m4 configure stage takes 1.5 s warm
against 23 s cold.

Signed-off-by: John Crispin <john@phrozen.org>
2026-09-22 20:29:59 +02:00
John Crispin a0b036985a build: cache the autoconf results of a package that opts in
A configure run spends its time on the compiler invocations behind its
checks, not on the shell. tools/m4 runs the compiler 633 times and takes
24 seconds. ccache does not help, because it refuses to cache an
autoconf conftest compile at all; it counts these separately as
"Autoconf compile/link" under its uncacheable calls.

A package that sets PKG_CONFIGURE_CACHE or HOST_CONFIGURE_CACHE keeps a
config.cache under tmp/, so a package that is cleaned and built again
reads the answers instead of running the checks. The configure stage of
tools/m4 drops from 24.5 s to 1.5 s. dirclean removes tmp/, so a full
reset of the tree starts from cold answers.

A package has to opt in, because a cache is only correct for a configure
script that keeps its side effects outside the AC_CACHE_VAL body.
ncurses appends -D_XOPEN_SOURCE and -D_DEFAULT_SOURCE to CPPFLAGS inside
that body, so a cached run restores the value, skips the append, and
then fails to compile wcwidth. ncurses_cfg.h is identical in both cases;
the difference is in the generated Makefile.

The path covers everything else that changes an answer. A target package
is keyed on the toolchain directory, which carries the gcc version. A
host package is keyed on the version string of the host compiler,
because autoconf cannot detect a new compiler behind an unchanged name;
gcc 14 turned an implicit function declaration into an error and changed
many answers that way. Both are keyed on a hash of the configure
arguments and the build flags, and autoconf refuses a cache written with
different flags on top of that.

A cached program path outlives a wipe of staging_dir, so ac_cv_path_ and
ac_cv_prog_ answers are dropped when the cache loads and configure
searches PATH again. Without that, a cache written before staging_dir
held sed pins /usr/bin/sed for good. A search runs no compiler, so this
costs nothing that matters.

The cache arrives through a site script rather than --cache-file, so a
hand written configure script never sees a new argument. The site script
removes the file of the previous arguments, so a different configuration
gets a cold cache instead of an autoconf error. It also unsets the
variable, and make exports it for the configure stage alone, so a nested
configure run keeps its own cache.

Set CONFIGURE_CACHE_DIR to keep the cache elsewhere, or to the empty
string to run every check again.

Host builds now read a site script on Linux as well. Before this change
only Darwin had one.

CONFIG_SITE holds one path name: autoconf before 2.70 reads the whole
value as that one name, so a second path would silence both scripts. It
names the cache script alone, and the cache script loads the site script
of the architecture from CONFIG_SITE_BASE.

Signed-off-by: John Crispin <john@phrozen.org>
2026-09-22 18:18:58 +02:00
Aleksey Vasilenko 3fa5ee0b28 build: remove ac_cv_header_netinet_sctp_h=no from pre-cached variables
We have <netinet/sctp.h> header in lksctp-tools package,
but having this var set to 'no' prevents package's configure
to detect it.

Signed-off-by: Aleksey Vasilenko <aleksey.vasilenko@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16441
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-22 16:04:09 +02:00
Philip Prindeville b8b9c79d27 build: autoconf: Activate options for standard types
These are POSIX standard types

And therefore should be present in any POSIX compliant runtime.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Link: https://github.com/openwrt/openwrt/pull/15952
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 19:39:34 +02:00
Philip Prindeville 0bd129a5d3 build: autoconf: set ac_cv_func_setresuid=true
MUSL and eglibc provide these symbols.

Bind needs setresuid() to build properly in recent versions.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Link: https://github.com/openwrt/openwrt/pull/15952
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 19:39:34 +02:00
Weijie Gao 7fcb82665e loongarch64: new target
Add target for Loongson LoongArch64-based boards.

LoongArch is a new RISC ISA developed by Loongson. It's a bit like
MIPS or RISC-V. LoongArch includes both 32-bit and 64-bit versions
(LoongArch32/LoongArch64).

Loongson 3A5000 and 3A6000 are the two existing CPUs of LoongArch64
and is used for PC products. It's BIOS supports ACPI and UEFI-only
boot. These CPUs supports SMP and SMT.

At present only LoongArch64 is supported by linux kernel.

Toolchain requirement:
binutils >= 2.40
gcc >= 13.1

For details, please check the following links:
https://lwn.net/Articles/861951/
https://loongson.github.io/LoongArch-Documentation/README-EN.html

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
2024-05-04 14:14:16 +08:00
Zoltan HERPAI 50c05f6cd7 generic: groundwork for RISC-V
Add build infrastructure for RISC-V.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2023-05-28 13:19:10 +02:00
Daniel Golle 1b6209203d Revert "build: use config.site generated by autoconf-lean, drop hardcoded sitefiles"
This reverts commit f439e29130.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-03-02 11:35:45 +00:00
Felix Fietkau f439e29130 build: use config.site generated by autoconf-lean, drop hardcoded sitefiles
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-28 00:09:09 +00:00
Felix Fietkau 7ec092e641 Revert faulty tree push
Revert "mac80211: add new minstrel_ht patches to improve probing on mt76x2" (9861050b85)
Revert "kernel: use bulk free in kfree_skb_list to improve performance" (98b654de2e)
Revert "ramips: add preliminary support for WIO ONE" (085141dc5b)
Revert "ramips: add preliminary support for SGE AP-MTKH7-0006 developer board" (b1db6d0539)
Revert "build: use config.site generated by autoconf-lean, drop hardcoded sitefiles" (363ce4329d)
Revert "toolchain: add autoconf-lean" (fdb30eed03)
Revert "build: allow overriding the filename on the remote server when downloading" (6fa0e07758)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-08-12 12:27:06 +02:00
Felix Fietkau 363ce4329d build: use config.site generated by autoconf-lean, drop hardcoded sitefiles
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-08-12 11:43:39 +02:00
Florian Larysch 555985ac90 include/site: add powerpc64 config
Signed-off-by: Florian Larysch <fl@n621.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-10-24 13:24:04 +02:00
Felix Fietkau 603900ef82 build: add a darwin sitefile to deal with macOS 10.12 + Xcode 9 build errors
Certain functions are available in system headers, but only work on
macOS 10.13

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-10-05 21:14:43 +02:00
Felix Fietkau 8b5d644bb3 toolchain: add support of ARC architecture
This includes binutils, gcc, gdb and uClibc-ng.

Latest release of ARC gcc (as of today it is "arc-2015.06")
is based on upstream gcc 4.8.4.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/gcc

Latest release of ARC binutils (as of today it is "arc-2015.06")
is based on upstream binutils 2.23.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06

Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
is based on upstream gdb 7.9.1.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb

Note that for binutils and gdb that come from unified git repository
(which is the case for upstream binutils/gdb today) we need to disable
building of gdb in binutils and binutils in gdb hence in binutils:
------>8------
--disable-sim
--disable-gdb
------>8------

and in gdb:
------>8------
--disable-binutils
--disable-ld
--disable-gas
------>8------

Also in gdb we disable sim because if the following breakage while
building with it:
------------>8------------
/usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
        -mono -fast -pbb -switch sem5-switch.c \
        -cpu a5f -infile ./mloop5.in \
        -outfile-suffix 5
unknown option: bash
Makefile:699: recipe for target 'stamp-5mloop' failed
make[7]: *** [stamp-5mloop] Error 1
------------>8------------

Cc: Felix Fietkau <nbd@openwrt.org>
Cc: John Crispin <blogic@openwrt.org>
Cc: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

SVN-Revision: 47438
2015-11-10 12:03:59 +00:00
Felix Fietkau 437e423c44 build: add missing sitefile for i386
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45097
2015-03-28 18:26:28 +00:00
Felix Fietkau 74ca7e9af3 build: clean up sitefiles, make them per-arch
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45090
2015-03-28 13:38:34 +00:00
Felix Fietkau 5d9eeab64a build: remove obsolete references to cris and avr32
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44965
2015-03-24 10:07:40 +00:00
Florian Fainelli dd8d7188ee aarch64: add initial support
Add initial support for the AArch64 architecture

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 43353
2014-11-24 06:33:13 +00:00
Florian Fainelli 6b63716262 add preliminary support for musl
Musl is an alternative C-library, see http://www.musl-libc.org for more infos.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 34314
2012-11-23 20:02:29 +00:00
Florian Fainelli 6bc394d90f add sparc specific site files
SVN-Revision: 33405
2012-09-14 15:36:41 +00:00
Jo-Philipp Wich a79356d5ec site: add configure cache scripts for mips-linux-gnu and mipsel-linux-gnu, used by CodeSourcery toolchain
SVN-Revision: 29794
2012-01-19 03:10:27 +00:00
Felix Fietkau 97cf4d41fa include/site: add powerpc-openwrt-linux-*spe sitefiles for mpc85xx
SVN-Revision: 27969
2011-08-12 19:34:20 +00:00
Felix Fietkau fcc570d999 site: set ac_cv_sizeof_off_t=8 to fix autoconf applications using it for detecting largefile support (#8376, #5681)
SVN-Revision: 26471
2011-04-04 12:11:43 +00:00
Felix Fietkau f67f66bb89 Revert "[include] provide mipsel-openwrt-linux-uclibcgnueabi site script, fixes the majority of configure problems"
SVN-Revision: 25970
2011-03-09 11:37:55 +00:00
Jo-Philipp Wich fb53b99f8c provide mipsel-openwrt-linux-uclibcgnueabi site script, fixes the majority of configure problems
SVN-Revision: 25968
2011-03-09 10:13:56 +00:00
Jo-Philipp Wich ff1f0be710 site: cache ac_cv_func_malloc_0_nonnull and ac_cv_func_realloc_0_nonnull
SVN-Revision: 25946
2011-03-08 06:00:56 +00:00
Felix Fietkau 9b9162fa1a add sitefile entries for ac_cv_func_creal,cimag - the functions are there, but configure tests in imagemagick fail to detect them
SVN-Revision: 25292
2011-02-01 21:16:10 +00:00
Daniel Dickinson 236cbb536f Added autoconf flags for gettimeofday and psignal - uClibc has them
SVN-Revision: 24508
2010-12-12 01:43:30 +00:00
Nicolas Thill fda45977ec use a common site/linux config, since site/linux-gnu & site/linux-uclibc configs are identical
SVN-Revision: 18811
2009-12-18 10:38:16 +00:00
Nicolas Thill 25d21566aa adjust pointer size from 4 to 8 bytes in x86_64 site config
SVN-Revision: 17845
2009-10-04 00:44:32 +00:00
Felix Fietkau fd51984e64 add sitefile definitions for ac_cv_func_setgrent_void
SVN-Revision: 16962
2009-07-23 15:50:51 +00:00
Imre Kaloz 2004d4165a add preliminary coldfire v4e support
SVN-Revision: 16538
2009-06-21 18:34:07 +00:00
Felix Fietkau 56164a5815 add a modified version of the mips64 patch from #4603
SVN-Revision: 15249
2009-04-18 17:03:55 +00:00
Nicolas Thill cc3e46f28e adjust site config files for uClibc ARM EABI
SVN-Revision: 14137
2009-01-21 16:48:45 +00:00
Nicolas Thill da4a1c6b44 add missing 'ac_cv_sizeof_unsigned_long_long' variable
SVN-Revision: 13970
2009-01-11 01:23:38 +00:00
Nicolas Thill a3edea1b91 add support for alternative C libraries (currently only glibc/eglibc) other (related) changes: - kernel headers are now installed using "make headers_install" on 2.6 - target names now contain an openwrt "vendor" tag (e.g. mips-openwrt-linux-gnu) - build directory names now contain gcc/libc name/version - default cpu for x86 is now i486 (required to build glibc/eglibc)
SVN-Revision: 13931
2009-01-08 01:49:11 +00:00
Florian Fainelli ea81df0c2d Add sizeof of unsigned long long
SVN-Revision: 13627
2008-12-14 17:10:15 +00:00
Felix Fietkau cb73e4ad91 fix inotify detection for linux 2.4 (fixes glib2 and packages that depend on it on brcm-2.4)
SVN-Revision: 12896
2008-10-08 12:07:14 +00:00
Felix Fietkau 8ce76ceccb cris is little endian, not big endian (patch from #4048)
SVN-Revision: 12773
2008-09-28 19:52:15 +00:00
Nicolas Thill e848e7654b move arch-specific definitions to arch site files
SVN-Revision: 12229
2008-08-06 23:05:19 +00:00
Felix Fietkau fb344e3dff add ac_cv_file__dev_zero to sitefiles
SVN-Revision: 12227
2008-08-06 22:23:24 +00:00
Felix Fietkau 348d5ba521 add ssize_t definition to site files, fix up size for x86_64
SVN-Revision: 12226
2008-08-06 22:23:21 +00:00
Felix Fietkau 352173f782 add missing configure variable to sitefile (required by gstreamer)
SVN-Revision: 12152
2008-08-05 19:22:06 +00:00
Florian Fainelli 4d5535e29e Define the size_t size for cris (#3722)
SVN-Revision: 11701
2008-07-06 12:31:12 +00:00
Nicolas Thill 648a6a6546 add 'getgrgid' to uClibc site config, needed after glib2 update in [11088]
SVN-Revision: 11093
2008-05-09 06:59:08 +00:00
Nicolas Thill 6275f4a608 uClibc should actually support va_copy
SVN-Revision: 10906
2008-04-21 22:04:27 +00:00
Felix Fietkau 56d0ebea38 fix ntpd compile
SVN-Revision: 10057
2007-12-30 16:41:08 +00:00
Florian Fainelli d1cb21fb01 We also need bzero and bcmp to be put in there
SVN-Revision: 10050
2007-12-30 04:03:42 +00:00
Felix Fietkau a1a07442e6 fix net-snmp compile
SVN-Revision: 10047
2007-12-30 03:55:53 +00:00
Nicolas Thill 75123bd131 prevent ldconfig use in autoconf based packages
SVN-Revision: 8496
2007-08-26 18:34:24 +00:00