Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: speed up build system by getting rid of redundant work
KERNELRELEASE contains a $(shell) call which is evaluated over and over again. The call to checksyscalls.sh is unnecessary for LEDE and also takes a few seconds to complete. Signed-off-by: Felix Fietkau <nbd@nbd.name>
- Loading branch information
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit broke one of my Makefiles for a kernel driver, i reverted it then it compiled fine.
the Makefile has
include $(INCLUDE_DIR)/kernel-defaults.mk
up top and$(KERNEL_MAKEOPTS)
inside of Build/Compile.the error trying to build the module said "*** No targets. Stop." then failed.
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will rework it to make it compatible again
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try this commit: https://git.lede-project.org/?p=lede/nbd/staging.git;a=commitdiff;h=b29854a633e9bfcc60facdb3132ebceb9b059ce8
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pulled your repo (at that commit), built successfully, added module, built, and failed (same issue
*** No targets. Stop.
) :(built using:
$(MAKE) $(KERNEL_MAKEOPTS)
; also just to be sure: i pulled this git again and made sure this commit was reverted still then successfully built the package.also i reverted this commit inside of your repo and it builds fine on there too (thought i should check that as well).
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you switch to my staging tree entirely, or did you merge this into your clone of the LEDE tree?
In my tests, this commit did make some packages work that were using
$(MAKE) $(KERNEL_MAKEOPTS)
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i switched to your tree entirely. i cloned it and tried to build with it. it built successfully without the module but once i loaded the module and tried to rebuild with it, it failed. until i reverted this commit here in your tree, then it would build fine on yours
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What module is this?
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a realtek driver for a usb card (one that im using through my router right now to send this message):
https://forum.lede-project.org/t/rtl8812au-and-or-rtl8814au-drivers/67/21
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please show me your makefile
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here ya go :) https://gist.github.com/kodewdle/3537b45981392dc4e403cbe005374957
edit: just an update. i pulled your repo at (https://git.lede-project.org/?p=lede/nbd/staging.git;a=commitdiff;h=5dd9423df3b2197e2b56e2dd0de9f696ecd11176) and it's the same for me, unless i revert this commit, it wont build. more specifically, if i remove this line from your
/include/kernel.mk
:KERNELRELEASE=$(LINUX_VERSION) \
inside ofKERNEL_MAKEOPTS := \
. after removing that, it builds fine. even when i removeinclude $(INCLUDE_DIR)/kernel-defaults.mk
and switch$(MAKE) $(KERNEL_MAKEOPTS)
to$(KERNEL_MAKE)
inside of my Makefile.edit two: i don't know if this applies to only this module specifically or something but if that's the case, it would be easier to just change
$(MAKE) $(KERNEL_MAKEOPTS)
to$(MAKE) $(subst KERNELRELEASE=$(LINUX_VERSION) ,,$(KERNEL_MAKEOPTS))
in the Makefile, i suppose? doing this (as im sure you know) just removes that variable and allows it to build, without reverting this commit completely.1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend adding$(filter-out KERNELRELEASE=%,$ (KERNEL_MAKE_FLAGS)) to RUN_STUFF and leaving out KERNEL_MAKEOPTS.
1f12a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! :)