<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/hauke/include/kernel.mk, branch v23.05.1</title>
<subtitle>Hauke Mehrtens staging tree</subtitle>
<id>https://git.openwrt.org/openwrt/staging/hauke/atom?h=v23.05.1</id>
<link rel='self' href='https://git.openwrt.org/openwrt/staging/hauke/atom?h=v23.05.1'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/'/>
<updated>2023-07-08T13:43:59Z</updated>
<entry>
<title>kernel: fix KernelPackage when all KCONFIG are versioned</title>
<updated>2023-07-08T13:43:59Z</updated>
<author>
<name>John Thomson</name>
</author>
<published>2023-07-01T00:23:35Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=27f68a39fdd17e0182e16547f8e3443e839ce8bf'/>
<id>urn:sha1:27f68a39fdd17e0182e16547f8e3443e839ce8bf</id>
<content type='text'>
If a kernel package was defined where all KCONFIG symbols were dynamic,
and versioned, no FILES would be installed, as the foreach evaluation was
providing the value of the variable defined by the KCONFIG symbol name
including the version test

Fix this by calling the version_filter function on the list of KCONFIG
variable names run through by foreach

Example, kernel 6.1:
KCONFIG:=CONFIG_OLD@lt6.1 CONFIG_NEW@ge6.1
filter-out any KCONFIG settings forced by package:
CONFIG_OLD@lt6.1 CONFIG_NEW@ge6.1
there are dynamic settings, so for each of them,
get the value of the make variable defined by symbol name:
    CONFIG_OLD@lt6.1 is not set
    CONFIG_NEW@ge6.1 is not set
  versus
    CONFIG_OLD is not set
    CONFIG_NEW=m
test if any of these are m, or y
if yes, install files, otherwise, nothing to install

Signed-off-by: John Thomson &lt;git@johnthomson.fastmail.com.au&gt;
(cherry picked from commit b3448b3fdb59d25dce05991dc8f322c1020b090b)
</content>
</entry>
<entry>
<title>generic: groundwork for RISC-V</title>
<updated>2023-06-14T07:22:08Z</updated>
<author>
<name>Zoltan HERPAI</name>
</author>
<published>2018-12-16T09:45:53Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=341e312ada4dda207a9f2c8402e73cc13b195983'/>
<id>urn:sha1:341e312ada4dda207a9f2c8402e73cc13b195983</id>
<content type='text'>
Add build infrastructure for RISC-V.

Signed-off-by: Zoltan HERPAI &lt;wigyori@uid0.hu&gt;
(cherry picked from commit 50c05f6cd721130701cbbc77a75d2e090259c4e5)
</content>
</entry>
<entry>
<title>kernel: Make KERNEL_MAKEOPTS recursively expanded</title>
<updated>2022-12-17T19:12:31Z</updated>
<author>
<name>Hauke Mehrtens</name>
</author>
<published>2022-12-14T15:29:16Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=06ad3adeecc27859313e60c173c435d45ac2b345'/>
<id>urn:sha1:06ad3adeecc27859313e60c173c435d45ac2b345</id>
<content type='text'>
KERNEL_MAKEOPTS will get expanded when it is used and not when it is
defined in the kernel.mk file now. This fixes problems finding dependent
kernel modules when it is used by a kernel module package.

Without this change the build of packages which depend on other out of
tree modules failed when they used KERNEL_MAKE because some symbols could
not be found. This happened because KERNEL_MAKE_FLAGS which contains a
"if $(__package_mk)" was  evaluated where KERNEL_MAKEOPTS was defined
and not when the KERNEL_MAKE was used. For packages which included
kernel.mk before package.mk we saw this problem. One workaround
was to use the correct include order and the other one was to not
use KERNEL_MAKE_FLAGS, but copy its content.

Signed-off-by: Hauke Mehrtens &lt;hmehrtens@maxlinear.com&gt;
</content>
</entry>
<entry>
<title>kernel: disable stack validation for external module builds as needed</title>
<updated>2022-10-20T07:53:23Z</updated>
<author>
<name>Mark Mentovai</name>
</author>
<published>2022-09-11T17:48:17Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=802bfe080678b3a8a94868b717bd127afcabc5b7'/>
<id>urn:sha1:802bfe080678b3a8a94868b717bd127afcabc5b7</id>
<content type='text'>
c3e31b6a9b04 and 5f8e5872406d disable stack validation when the build
host is not running Linux, as the objtool kernel build tool required for
stack validation is not portable to other build host environments. This
was achieved by setting CONFIG_STACK_VALIDATION= in KERNEL_MAKEOPTS, and
by setting SKIP_STACK_VALIDATION=1 in the environment. KERNEL_MAKEOPTS
only has effect for the kernel build, not for external module builds,
but through kernel 5.14, SKIP_STACK_VALIDATION worked to disable this
feature too, so stack validation was disabled for external module builds
as well. Since kernel 0d989ac2c90b, the kernel build no longer considers
SKIP_STACK_VALIDATION, so the feature will be disabled for the kernel
build, but not for external module builds.

When building OpenWrt on a non-Linux build host targeting x86 (the only
target architecture for which OpenWrt enables the kernel
CONFIG_STACK_VALIDATION) and using kernel 5.15 (such as via
CONFIG_TESTING_KERNEL), this caused a build failure during any external
module build, such as kmod-button-hotplug. This manifested as build
errors such as:

  make[4]: *** No rule to make target
  '.../build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/button-hotplug.o',
  needed by
  '.../build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/button-hotplug.mod'.
  Stop.

Although button-hotplug.c was present, the implicit rule to make
$(obj)/%.o from $(src)/%.c in the kernel's scripts/Makefile.build could
not be satisfied in this case, as it also depends on $(objtool_dep),
non-empty as a result of the failure to propagate disabling of stack
validation to external module builds, in a configuration where it is not
possible to build objtool.

KERNEL_MAKEOPTS is used for just the kernel build itself, while
KERNEL_MAKE_FLAGS is used for both the kernel build and for external
module builds. This restores the ability to build OpenWrt in such
configurations by moving the CONFIG_STACK_VALIDATION= make argument from
KERNEL_MAKEOPTS to KERNEL_MAKE_FLAGS where it is able to affect external
module builds properly.

Note that the kernel's objtool and related configuration have seen a
major overhaul since kernel 5.15, and may need more attention again
after 22922deae13f, in kernel 5.19.

Signed-off-by: Mark Mentovai &lt;mark@mentovai.com&gt;
</content>
</entry>
<entry>
<title>kernel: filter -no-plt from KCFLAGS</title>
<updated>2022-06-21T15:41:17Z</updated>
<author>
<name>Kevin Darbyshire-Bryant</name>
</author>
<published>2022-06-21T13:15:40Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=24e27bec9a6df1511a504cf04cd9578a23e74657'/>
<id>urn:sha1:24e27bec9a6df1511a504cf04cd9578a23e74657</id>
<content type='text'>
Compiler option -no-plt will break kernel builds on some architectures
eg. (x86)  Filter this option from the recently introduced handling of
KCFLAGS vs EXTRA_OPTIMISATION

Fixes: 1d42af720c6b ("kernel: use KCFLAGS for passing EXTRA_OPTIMIZATION flags")

Suggested-by: Felix Fietkau &lt;nbd@nbd.name&gt;

Signed-off-by: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
</content>
</entry>
<entry>
<title>kernel: support setting extra CFLAGS for kernel compilation</title>
<updated>2022-06-20T20:17:38Z</updated>
<author>
<name>Rafał Miłecki</name>
</author>
<published>2022-06-15T10:36:36Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=907d7d747243044f86588f0d82993e8c106cb02c'/>
<id>urn:sha1:907d7d747243044f86588f0d82993e8c106cb02c</id>
<content type='text'>
They may be used e.g. to optimize kernel size or performance.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
</content>
</entry>
<entry>
<title>kernel: use KCFLAGS for passing EXTRA_OPTIMIZATION flags</title>
<updated>2022-06-19T21:23:18Z</updated>
<author>
<name>Rafał Miłecki</name>
</author>
<published>2022-06-15T08:41:37Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=1d42af720c6b6dcfcdd0b89bce386fca1607dcb3'/>
<id>urn:sha1:1d42af720c6b6dcfcdd0b89bce386fca1607dcb3</id>
<content type='text'>
This uses kernel's generic variable and doesn't require patching it with
a custom Makefile change. It's expected *not* to change any behaviour.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
</content>
</entry>
<entry>
<title>build: use KBUILD_HOSTLDFLAGS</title>
<updated>2022-05-18T10:32:06Z</updated>
<author>
<name>Stijn Tintel</name>
</author>
<published>2022-03-29T13:32:25Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=6300313deed3688c86cf5633ada439f09e8bcbfd'/>
<id>urn:sha1:6300313deed3688c86cf5633ada439f09e8bcbfd</id>
<content type='text'>
According to the GNU make manual, specifying library paths should be
done in LDFLAGS rather than LDLIBS. Replace KBUILD_HOSTLDLIBS with
KBUILD_HOSTLDFLAGS to pass the host lib directory.

Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
</content>
</entry>
<entry>
<title>build: drop HOST_LOADLIBES</title>
<updated>2022-05-18T10:32:06Z</updated>
<author>
<name>Stijn Tintel</name>
</author>
<published>2022-03-29T13:28:21Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=b998287b9193bf74631dbb2cbfff72babd3bcd0c'/>
<id>urn:sha1:b998287b9193bf74631dbb2cbfff72babd3bcd0c</id>
<content type='text'>
HOST_LOADLIBES was renamed to KBUILD_HOSTLDLIBS in kernel 4.19. As the
oldest kernel version we support is 5.10, cleanup HOST_LOADLIBES use.

Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
</content>
</entry>
<entry>
<title>build: use -nostdinc and -isystem in NOSTDINC_FLAGS for out-of-tree kernel modules</title>
<updated>2021-03-18T09:53:26Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2021-03-18T06:22:11Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/hauke/commit/?id=9ac47ee46918c45b91f4e4d1fa76b1e26b9d57fe'/>
<id>urn:sha1:9ac47ee46918c45b91f4e4d1fa76b1e26b9d57fe</id>
<content type='text'>
This resolves issues uncovered by musl updates

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
</feed>
