Commit Graph

228 Commits (9601d94138de66e4fc9f55a08dfb348cdfcc3181)

Author SHA1 Message Date
Jo-Philipp Wich 1416b63dcb rules.mk: fix syntax error
Fix broken assignment operator added in a previous commit.

Fixes db73ec9f51 ("rules.mk: add INSTALL_SUID macro")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich b0261ee5e9 rules.mk: add INSTALL_SUID macro
This is useful for packages that want to stage SUID executables.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Konstantin Demin d3b43f49ac rules.mk: add ESED command
ESED is SED with extended regular expressions turned on.
Command line and usage are the same as for SED.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
6 years ago
Syrone Wong 713cee6463 toolchain/gcc: add config symbol to determine how to apply path remapping
Added boolean symbol for GCC 8 and higher, when we add newer GCC, we don't have
to modify rules.mk to keep things consistant.

Fixes: da9d760 ("rules.mk: replace iremap when using GCC 8")

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
6 years ago
Syrone Wong da9d760ea1 rules.mk: replace iremap when using GCC 8
The original -iremap is replaced by -fmacro-prefix-map in GCC 8

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
6 years ago
Jo-Philipp Wich 681e825f8f build: include package directory in sha256sums when running on buildbot
In order to be able to better compare files to sync in the future, include
all BIN_DIR subdirectories in the checksum calculation.

To not break existing applications, restrict the recursive checksumming to
CONFIG_BUILDBOT for now.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Matthias Schiffer 2fbf669730
imagebuilder: reuse rootfs preparation from rootfs.mk
In addition to removing redundant code, this fixes various issues in
IB-generated images that have been fixed in prepare_rootfs before,
including better handling of CONFIG_CLEAN_IPKG and enabling of initscripts
from FILES.

We also reuse the opkg macro and remove --force-... flags that have been
removed from rootfs.mk as well.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Alexandru Ardelean cfdfa6d04e
rules.mk: drop `include_mk` build rule
The only users of this were the python packages
from the `packages` feed.
The 2 python interpreters would export some mk
files (e.g. python-package.mk) and then other
python packages would include it via this rule.

But there's a few things wrong with this approach,
most of them drawing from the fact that python host
needs to be built first, to export these mk files.

By now all uses of include_mk have been corrected
in the feeds and this can be removed.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
6 years ago
Felix Fietkau bdc412941a build: remove use of STAGING_DIR_HOST/usr (fixes cmake build error on macOS)
This directory is never created, nor is it used anywhere. Using it in
HOST_LDFLAGS causes a linker warning to be emitted on macOS, which
messes with cmake configure tests.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Jo-Philipp Wich 72051f7036 rules.mk: export TMPDIR
Set TMPDIR to the same value as the existing TMP_DIR variable in order to
let gcc and various other utilities use the local temporary directory
instead of the system-wide one.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
John Crispin b957e455eb rukes.mk: this patch broken grub2 builds
Revert "rules.mk: add missing CPP definition"

This reverts commit 569f74ef49.

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
BangLang Huang 569f74ef49 rules.mk: add missing CPP definition
Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
7 years ago
Matthias Schiffer 5ef0854b11
rules.mk: make PKG_CONFIG_DEPENDS properly track string values
The confvar macro is adjusted to not only consider if a variable has a
value or not, but also the value itself. Instead of creating a string of
'y' and 'n' characters, all variable names and values are concatenated
and hashed.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Michal Sojka 202ae4cc6a build: Pass -iremap gcc option as a single argument
Passing -iremap argument separately causes problems with projects that
use scons and its ParseFlags function. Consider this SConscript
example:

    env = Environment()
    d = env.ParseFlags("-iremap one:two")

ParseFlags will interpret one:two as a file name and the returned dict
d will contain only "-iremap". When the -iremap is passed to the
compiler without an argument, compilation obviously fails.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
7 years ago
Felix Fietkau d826af2cbb build: make <subdir>/install opt-in, use it for target/ only
Fixes buildbot errors on running make target/install or
toolchain/install

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau f55c29e4c7 build: remove libc version suffix from build/staging directories
Our supported libcs are ABI compatible across version upgrades

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Florian Fainelli 57657a7237 build: Suffix build directory with _$(LIBC) for external toolchains
For external toolchain, we also know the type of C library used, and the
toolchain triplet may not always be reflective of that, therefore make
$(TARGET_DIR_NAME) suffixed with _$(LIBC).

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Jo-Philipp Wich 7d57db4d9b build: introduce STAGING_DIR_IMAGE
Introduce a new location STAGING_DIR_IMAGE which is intended to be used by
bootloader iamges and similar image-related artifacts.

This directory is guaranteed to be persistent across kernel upgrades which
might involve a removal of KERNEL_BUILD_DIR and is guranteed to be bundled
with the image builder.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Matthias Schiffer 40d3401f3b
rules.mk: export STAGING_DIR_HOSTPKG
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
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 84bd74057f build: use mkhash to replace various quirky md5sum/openssl calls
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
Jo-Philipp Wich d7bec5609c rules.mk: add STAGING_DIR_HOSTPKG variable
Add a STAGING_DIR_HOSTPKG variable which refers to $(STAGING_DIR)/host in order
to prepare support for relocating that directory in the future.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 27854a0a84 build: add checksum target
Add a new "checksum" make target which generates an sha256sums file over the
image files produced in bin/targets/ and automatically call it during make
world after the package index generation.

The advantage of this new target is that it is guaranteed to run after the
images, the SDK and the ImageBuilder archives have been generated to ensure
that they all end up in the checksum file. Fixes FS#51.

Uses sed to postprocess the OpenSSL digest output into an sha256sum command
compatible format.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 54fbe8afdd rules.mk: introduce new variable OUTPUT_DIR
Introduce a new variable OUTPUT_DIR which refers to the parent bin/ directory
without the architecture specific component.

Also construct the BIN_DIR variable based on OUTPUT_DIR now and add both target
and subtarget components to it to prevent different subtargets from
overwriting each others files in bin/.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau c8cbe7aba2 build: disable the use of -iremap for UML (#21851)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48718
8 years ago
Jo-Philipp Wich 064761d1db rules.mk: add TARGET_INIT_PATH toplevel variables
Add a new variable TARGET_INIT_PATH which holds the default $PATH variable
value configured in menuconfig.

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

SVN-Revision: 48676
8 years ago
Felix Fietkau c5d74630c5 build: filter out -fno-plt for the kernel build, fixes #21712
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48515
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 579e9620c6 rules.mk: make the locked template available even if flock has not been built yet (fall back to unlocked shell command)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48414
8 years ago
Felix Fietkau c7308bc9f1 build: use a separate variable checking the subdir path (for host packages)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48410
8 years ago
Felix Fietkau 03bc8d94f0 host-build.mk: change default installation prefix of package/* host builds to staging_dir/target-*/host
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48401
8 years ago
Felix Fietkau 36502c5a6f build: move host build directories of package/* to build_dir/target-*/host/
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48400
8 years ago
Felix Fietkau 0628630664 build: add pure make tolower/toupper funtions that do not require shell calls
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48105
8 years ago
Felix Fietkau f7939f5e74 gcc: remove version 4.6, it is no longer needed
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 47443
9 years ago
Felix Fietkau 940bc81bc2 build: add -Wno-error=unused-result to target cflags
Many glibc functions have __warn_unused_result__ in so many different
core functions, and failing the build for all of those simply does not
make any sense

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

SVN-Revision: 47440
9 years ago
Felix Fietkau 279c8bee8d rules.mk: export STAGING_DIR_HOST to sub-makefiles and shells
Certains host packages (like quilt) need to know the previously used
install location at run-time. They currently use $STAGING_DIR, which
causes issues on cleaned environment, where $STAGING_DIR doesn't exist
yet.

Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>

SVN-Revision: 47409
9 years ago
Felix Fietkau 3bbb927728 build: Allow kernel modules to set build ID debug symbol
This change adds support for specifying a build ID for kernel modules.
This is done by setting PKG_BUILD_ID to a hexadecimal string, which will
then be passed to the kernel linker. In addition, when this flag is set,
the build ID debug symbol (.note.gnu.build-id) will not be stripped from
the kernel module. This symbol is exported in sysfs by the kernel (if
the kernel is compiled with CONFIG_KALLSYMS) and so can be used to
uniquely identify a version of a kernel module in a running kernel. This
is useful for keeping track of different versions of a module when doing
experiments and development.

Modules that specify the build ID will be ~100 bytes larger (depending
on the length of the build ID specified). There is no size difference
for kernel modules that do not set this variable.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>

SVN-Revision: 47290
9 years ago
Felix Fietkau 59bffdaa64 rules.mk: remove GCC 4.4 and GCC 4.5 conditional
gcc 4.4 was removed in r44957 gcc: remove 4.4.7 (only used by avr32)
gcc 4.5 was removed in r36149

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

SVN-Revision: 46722
9 years ago
Steven Barth 55fe8b2988 toolchain: only use fortify-headers for musl
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46138
9 years ago
Steven Barth 2738526a16 toolchain: add fortify-headers, enable FORTIFY_SOURCE by default
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46117
9 years ago
Felix Fietkau a778060392 toolchain: switch to musl by default, except for mips64
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45995
9 years ago
Felix Fietkau beca028bd6 build: add integration for managing opkg package feed keys
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45286
9 years ago
John Crispin 6c434d5f06 rules.mk: add newline definition
To be used for stuff like $(subst $(space),$(newline),$(SOME_VAR))

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>

SVN-Revision: 44796
9 years ago
Jo-Philipp Wich 24f49b170e rules.mk: don't add staging_dir/host/bin/ path again
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 44379
9 years ago
Jo-Philipp Wich 2efe776ab0 scripts: extend rstrip.sh to remove bad rpaths
Remove all rpath entries which do not point to a location below /lib or
/usr/lib and which do not begin with '$ORIGIN'.

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

SVN-Revision: 44377
9 years ago
Jo-Philipp Wich 1162d6b721 rules.mk: use relative paths for BASH, TAR, FIND, PATCH, PYTHON
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 44294
9 years ago