Commit Graph

193 Commits (34bbbbf9c3b39e7b2d81df590aad5cdbd00280d6)

Author SHA1 Message Date
Felix Fietkau 4b8a7c9b48 build: fix QUILT related overrides
They need to be defined before including quilt.mk

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau b044bd5921 build: remove package makefile overlay functionality
Recent attempts to use it have shown that it does not work properly
except for a few undocumented cases. It's better to remove this now to
avoid having more people fall into the same trap

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 89118da865 build: fix STAMP_PREPARED with quilt
quilt.mk needs to be included first, to ensure that STAMP_PREPARED does
not include the hash if quilt is used.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau a9c96ef0ac build: improve performance by avoiding lazy-eval for make shell calls
Avoids lots of redundant calls to mkhash on things like
package/kernel/linux

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 1f22957247 build: clean up redundant touching of the package install info file
Instead of using a separate .clean stamp file, remove the install info
file on compile, then append the install package list afterwards

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 9467ce42da build: get rid of host.mk
Defined required host related variables in toplevel.mk instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau d86802acd8 build: keep recursive dependency check stampfiles up to date
Since the main stamp file depends on the _check stampfile, the _check
stampfile needs to be created on the first run as well.

Fixes spurious rebuilds with CONFIG_AUTOREBUILD=y

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 807461e11c build: make the touch .autoremove call non-fatal
Fixes build issues when there is nothing to do on the compile step (e.g.
with unselected packages).

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 053dc3b77a build: do not auto-clean packages where the autoremove step has not run
This avoids repeatedly unpacking and rebuilding packages that are
failing the build. Re-running the failing step should be much faster.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 0e22d63775 build: fix CONFIG_AUTOREMOVE for packages with multiple variants
Calling the clean target removes all .ipk files and un-stages the
package. Add a new target just for clearing the build dir and call that
one instead of the full clean target

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 5aa03e16a7 build: disable CONFIG_AUTOREMOVE for packages/tools where QUILT is used
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 86a72765b9 build: include CONFIG_AUTOREMOVE in STAMP_PREPARED
Fixes build issues when changing the CONFIG_AUTOREMOVE setting

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 7a523569f7 build: add support for automatically removing build dir contents during build
This is used to save space on buildbot instances.
If any part of a package needs to be rebuild, the whole package is
rebuilt from scratch. Stamp files are preserved to allow dependency
checks to work

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 9228d1c066 build: introduce extra targets that contain only proper dependencies
This can be used to check if targets like prepare or compile are up to date

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 6cf067d084 build: define common subdir targets in rules.mk
Reduce build system clutter and enable further rework

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Matthias Schiffer 3d71786154
build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common directory for all targets
Using a single host package staging dir (and build dir) significantly speeds up
builds when multiple targets are built in succession, especially for large host
packages like NodeJS.

$(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most
places; it is still used as destination for host files in Build/InstallDev.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Felix Fietkau 1e1d735e52 build: remove obsolete parallel build related options
Always use the main make jobserver, which has been the default for ages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau ffb0181a87 build: add defaults for PKG_SOURCE, PKG_SOURCE_SUBDIR, PKG_VERSION
This makes it easier to unify versioning of git based package downloads.
PKG_SOURCE_DATE along with an 8-character abbreviation of the git hash
is used as PKG_VERSION, PKG_RELEASE should be used like normal packages.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 7a315b0b5d build: implement make check and make package/X/check
This is intended to be used for a wide array of package sanity checks.

The first check that is implemented is for the hash of downloaded files.
It checks:
  - Missing hash
  - Use of SHA256 instead of MD5
  - dl/<file> hash not matching hash in makefile
  - deprecated MD5SUM variable

The deprecated MD5SUM variable check is skipped for feeds/ until OpenWrt
is updated as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 6a5cc2d085 include/package.mk: sync default value for hash fallback with mirror hash
Simplifies dealing with PKG_HASH vs PKG_MD5SUM

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 881c5b47ec build: remove duplicate Download/default definition from include/host-build.mk
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 7416d2e046 build: replace MD5SUM variables with HASH
Since we've switched to preferring SHA256 over MD5, the old variable
name is misleading. Packages using the old name remain compatible.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Yousong Zhou 4eb371e363 build: fix cleaning configured stamp file
We have packages with their own parts appended to standard STAMP_CONFIGURED
(mostly with an underscore character).  This will render the current
STAMP_CONFIGURED_WILD setting invalid and the build system may miss a rebuild
on config change

 1. Build with config A
 2. Build with config B, yet .configured_A_xx did not get cleaned
 3. Return to config A, but rebuild will not happen because stamp file
    of config A still exists

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
8 years ago
Matthias Schiffer 6fb212f293
build: don't add -j for parallel builds with Make 4.2+
Make usually passes -j and jobserver arguments as part of MAKEFLAGS. LEDE
removes MAKEFLAGS to have better control of the build, and re-adds the
jobserver arguments with -j to the Make commandline where desired.

Make 4.2+ behave differently with these arguments passed on the commandline
than in MAKEFLAGS: -j will override the jobserver argument and the job
count will be unlimited.

Moving the flags to MAKEFLAGS will need many packages to be changed and
tested; therefore, we opt for a less invasive change for now and just
remove -j for Make 4.2+, as the jobserver argument alone is enough to
enable parallel builds for these Make versions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Felix Fietkau 852aaf6b2c build: add support for specifying extra package dependencies for prepared, configured and built
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich 5170393f8c include: choose package output directory based on repository info
Use the new repository metadata field to choose the output directory of the
final package archives.

Non-sharable packages will be placed in the per-target package directory
while the rest will be placed in a per-repository sub directory within the
$OUTPUT_DIR/packages/$CPU_TYPE/ prefix.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau b737686b2c build: use -iremap feature to replace __FILE__ absolute path names in packages with ones relative to $(BUILD_DIR)
improves reproducible builds

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48489
8 years ago
Felix Fietkau b1986d8fd6 build: use directory name instead of PKG_NAME for staging files and package metadata
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48110
8 years ago
Steven Barth fc5f02410f buildroot: move hardening options into separate file
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46070
9 years ago
Steven Barth ca96d1ab3f package.mk: replicate SSP and relro in both CFLAGS and LDFLAGS
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46035
9 years ago
Jo-Philipp Wich a621b8c284 include: clean package staging dir files before configure
This is required to allow packages to ship libraries with a different API.
Previously the linker would favor the old shared libraries in STAGING_DIR
instead of the just compiled ones in PKG_BUILD_DIR.

Avoid that problem by clearing the package staging files right after
prepare.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 45759
9 years ago
Felix Fietkau d42be88915 build: include variant name in STAMP_INSTALLED
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45253
9 years ago
Luka Perkov 7002f6326e include: remove trailing whitespaces
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 45127
9 years ago
Felix Fietkau 74ca7e9af3 build: clean up sitefiles, make them per-arch
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45090
9 years ago
John Crispin 08ae6296ca build: define STAMP_CONFIGURED recursively
Defining STAMP_CONFIGURED statically caused it not to reflect changes to
PKG_CONFIG_DEPENDS made after including package.mk, like the additional options
added by feeds.mk for all packages.

Furthermore, as STAMP_CONFIGURED_WILDCARD was already defined recursively, the
patsubst in its definition would never match, and in consequence, the stamps
were never removed. This caused packages not to be rebuilt when they should have
been.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 44927
9 years ago
Felix Fietkau e9e6e75c2a build: explicitly unexport CONFIG_SITE
On systems with CONFIG_SITE in the environment (e.g. OpenSUSE) make will export
the CONFIG_SITE set in include/package.mk by default. This will cause host
builds to get the target site configuration, leading to all kinds of weirdness
(wrong pointer size, wrong endianess).

Fix this by explicitly unexporting CONFIG_SITE. The explicit export for the
target builds overrides the unexport, so the target builds will still correctly
get the site config.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 44019
9 years ago
John Crispin 491f3fc048 Support for building an hardened OpenWRT
Introduce configuration options to build an "hardened" OpenWRT.

Options to enable Stack-Smashing Protection, FORTIFY_SOURCE and RELRO
have been introduced.

uClibc makefile now automatically detects if SSP support is necessary.

hostapd makefile has been fixed to use "^" as sed separator since
using a comma was problematic when using "-Wl,-z,now" and the like in
TARGET_CFLAGS.

Currently enabling SSP on user space depends on enabling SSP kernel
side, this is due to the fact that TARGET_CFLAGS are used to build
kernel modules (at least). Suggestions on how to avoid this are welcome.
Using "select" instead of "depends on" doesn't seem to work with choice
entries.

Tested with a lantiq (WBMR) router, GCC 4.8, uClibc and a subset of
the available packages.
Needs to be tested with GCC 4.9 and the remaining packages.
PIE not currently included.

Signed-off-by: Alessandro Di Federico <ale+owrt@clearmind.me>

SVN-Revision: 44005
9 years ago
Felix Fietkau d081edf7eb build: clean up and optimize ipkg control generator code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43017
10 years ago
John Crispin 7a1f4c50fa PKG_CHECK_FORMAT_SECURITY: add a menuconfig option, disable by default
The idea is still to enable it by default at some point
I've tested all ar71xx packages (except oldpackages) using CONFIG_ALL=y
Failing packages have been marked with PKG_CHECK_FORMAT_SECURITY:=0 for now
I can test more targets but i have no idea which are the most used

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>

SVN-Revision: 42282
10 years ago
Felix Fietkau 5249fc8491 build: temporarily disable PKG_CHECK_FORMAT_SECURITY until after the release
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 41504
10 years ago
Felix Fietkau ff9595dbcf build: Introduce PKG_CHECK_FORMAT_SECURITY
The idea is to get rid of
http://en.wikipedia.org/wiki/Uncontrolled_format_string
by using "-Wformat -Werror=format-security" by default

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>

SVN-Revision: 41412
10 years ago
Felix Fietkau 79f1326d73 build: reimplement package build directory override
Remove leftover pieces from package-version-override.mk support
Add a new variable USE_SOURCE_DIR to use a custom build directory.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40527
10 years ago
Felix Fietkau c2a3791000 build: add alternative PKG_CONFIG_PATH
This is a cryptographically signed message in MIME format.

udev Makefile.am has two different .pc files and put them
into two locations. Don't know if changing the udev Makefile
or changing the pkgconfig paths is the right way - someone
has to decide :)

udev and vala use an additional pkg-config dir
add it to the path

discovered because openobex did not find udev.pc

Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de>

SVN-Revision: 39792
10 years ago
Felix Fietkau 623825103e build: allow packages to declare ABI versions to detect necessary package rebuilds
If a package directly depends on another package that recently changed
its ABI version, it will be cleaned up and rebuilt (assuming quilt is
not used).

This helps with packages that have no stable ABI, e.g. libubox, ubus,
etc.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 39720
10 years ago
Felix Fietkau a5ce3f2cbf build: fix typo in mips16 changes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37776
11 years ago
Felix Fietkau a1a5f59ea3 build: decouple the mips16 support flag from the toolchain
Add the flags from package.mk instead, and leave libc and gcc
unaffected.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37770
11 years ago
Felix Fietkau 6f4cb088a0 build: clean up stale files from a previous build when installing a package build to the staging dir
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 36755
11 years ago
Felix Fietkau de707ac97e build: reduce the size of package metadata a bit to keep package list files smaller
SVN-Revision: 34871
12 years ago
Jo-Philipp Wich d3e90ba7a7 buildroot: isolate the .install stamp files for build variants (#12279)
This fixes missing embedded packages if multiple build variants are selected in
the build config, e.g. missing ppp if CONFIG_PACKAGE_ppp=y and
CONFIG_PACKAGE_ppp-multilink=m .

SVN-Revision: 34106
12 years ago
Felix Fietkau 6f752c725a build: create pkginfo dir earlier to avoid build breakage
SVN-Revision: 33633
12 years ago