On 2/10/22 15:05, Jiaxun Yang wrote:
在2022年2月10日二月 上午8:17,Johannes Berg写道:
On Thu, 2022-02-10 at 00:44 +0100, Hauke Mehrtens wrote:
What build problem do you get when you include "#include <linux/bug.h>"
here on kernel 4.9.299?
I haven't tried, but per the explanation, you get issues if you tried to
include bug.h in the first place, since then you get
bug.h
-> includes build_bug.h (since the patch)
-> uses build_bug.h from backports
-> includes bug.h (does nothing, double include)
Yep that's the problem.
What I'm trying is something like:
Though it won't work in kernel intergration mode. My makefile foo does not
allow me to come up a idea.
diff --git a/backport/Makefile.real b/backport/Makefile.real
index 65508028..26482e52 100644
--- a/backport/Makefile.real
+++ b/backport/Makefile.real
@@ -83,8 +83,19 @@ backport-include/backport/autoconf.h: .config Kconfig.versions Kconfig.kernel
) > backport-include/backport/autoconf.h
@echo " done."
+.PHONY: backport-include/backport/version.h
+backport-include/backport/version.h:
+ @echo -n "Building backport-include/backport/version.h ..."
+ @echo "#ifndef COMPAT_VERSION_INCLUDED" > $@
+ @echo "#define COMPAT_VERSION_INCLUDED" >> $@
+ @echo '#define COMPAT_LINUX_VERSION $(VERSION)' >> $@
+ @echo '#define COMPAT_LINUX_PATCHLEVEL $(PATCHLEVEL)' >> $@
+ @echo '#define COMPAT_LINUX_SUBLEVEL $(SUBLEVEL)' >> $@
+ @echo "#endif" >> $@
+ @echo " done."
+
.PHONY: modules
-modules: backport-include/backport/autoconf.h
+modules: backport-include/backport/autoconf.h backport-include/backport/version.h
@$(MAKE) -f Makefile.build modules
This does not work for me.
We have to do this inside the kernel make call, when the kernel build
system calls backports again, we should have the needed information in
that call only.
The build works like this:
1. The normal make call to backports, KERNELRELEASE is not set and
Makefile forwards the call to Makefile.real.
2. This calls "Makefile.build modules" in the next step.
3. This calls the kernel build system with
"@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) modules"
4. This calls again Makefile, but now with KERNELRELEASE set.
5. This calls Makefile.kernel and uses the kernel build system to build
the backports code.
I tried adding a new rule to Makefile.kernel and then call it in
Makefile.build using the kernel build system, but it looks like it only
supports make targets supported by the kernel build system.
How do we make the kernel build system call our make target first?
Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in