/srv/irclogs.ubuntu.com/2018/07/16/#ubuntu-kernel.txt

apwfragile, that i believe implies you are trying to clean that source on a newer series, ie the kernel source is not 18.04 kernel source06:55
apwfragile, if you look at the later kernel sources they supply KW_DEFCONFIG_DIR=$(DEBIAN)/d-i06:56
SystemParadoxI'm having issues building a 3rd party module on 18.04. I believe there may be an issue with the linux-kernel-headers package or whatever is responsible for installing the build scripts in /lib/modules/[version]/build/16:25
SystemParadoxThe module includes linux/module.h, which includes linux/list.h which includes linux/kernel.h which includes linux/linkage.h which tries to include asm/linkage.h but fails with "No such file or directory"16:27
SystemParadoxI can't find any clear information on how the asm directory is supposed to work. Is there supposed to be a symlink somewhere? Or should the build scripts in /lib/modules be adding it to the include path?16:32
SystemParadoxHmm. gcc appears to be adding -I./arch/x86/include, and arch/x86/include/asm/linkage.h exists. So why does gcc say 'no such file or directory'?16:46
apwSystemParadox, well those are used routinly for that to build the dkms packages we ship, so i would expect it to work16:47
apwSystemParadox, are you sure you have installed the entire headers package for your kernel, there are two for a specific version/flavour16:48
SystemParadoxapw, I have linux-headers-4.15.0-23-generic and linux-headers-4.15.0-23, although I thought the latter was just a metapackage16:50
SystemParadoxoh now I'm really confused. I ran the failing gcc call with -v and it says: ignoring nonexistent directory "-I./arch/x86/include"16:53
SystemParadoxbut it does exist!16:53
apwyou might try installing a dkms package at random, and if that builds you know the headers are complete16:58
SystemParadoxcare to suggest one?16:59
SystemParadoxthe file it's complaining about is there. I really don't understand why gcc is ignoring that folder17:02
apwbrcmwl is quite benign17:05
SystemParadoxthat seemed to work fine17:07
apwso that would imply that the manner in which you are envoking your local build is wrong in some way17:09
SystemParadoxI ran it with KBUILD_VERBOSE=1 to find out what commands it was actually running17:11
SystemParadoxit changes directory to /usr/src/linux-headers-4.15.0-23-generic and runs a gcc which includes -I./arch/x86/include17:12
SystemParadoxif I change to that directory and run the exact same gcc command, I get the same result17:12
SystemParadoxif I add '-v', it tells me it ignores './arch/x86/include' because it doesn't exist... except that it does!17:13
SystemParadoxapw, ok with some help from the gcc guys we realised there's a problem with the arguments17:45
SystemParadoxit's running "gcc -isystem   -I./arch/x86/include"17:46
SystemParadoxapparently -isystem takes an argument, which looks like it should be /usr/lib/gcc/x86_64-linux-gnu/7/include17:47
SystemParadoxat the moment it's trying to use "-I./arch/x86/include" as the argument (including the -I part!)17:47
SystemParadoxbut I'm totally lost in the kernel build files. I can't find where those arguments are generated or where gcc is run17:48
SystemParadoxok the issue arises at /usr/src/linux-headers-4.15.0-23/Makefile, which does NOSTDINC_FLAGS += -nostdinc -isystem $(call shell-cached,$(CC) -print-file-name=include)18:04
SystemParadoxCC appears to just be 'gcc'18:04
SystemParadoxgcc -print-file-name=include gives /usr/lib/gcc/x86_64-linux-gnu/7/include18:05
SystemParadoxbut I guess it's not when this is running the first time? I don't know where to go with this now18:06
apwSystemParadox, well there is clearly two spaces in the command line, so it is subbing in '' as that path which is not working18:53
SystemParadoxindeed18:53
apwSystemParadox, from what i can it should be something like this:18:53
apwMakefile:NOSTDINC_FLAGS += -nostdinc -isystem $(call shell-cached,$(CC) -print-file-name=include)18:53
SystemParadoxthat's what I've got18:59
SystemParadoxshell-cached is some voodoo19:00
SystemParadoxI'm currently trying to work out if somehow the arguments passed from the module's own makefile are messing it up, although everything in the kernel build scripts seems to suggest it tries to reset everything to prevent this19:01
SystemParadoxoo this is odd - if I use make -C /lib/modules/4.15.0-23-generic/build it fails, but this is just a symlink to /usr/src/linux-headers-4.15.0-23-generic. If I use that directly, it works19:12
SystemParadoxaha! deleting .cache.mk has fixed it!19:37
SystemParadoxwish I'd taken a copy of it now to see what was wrong with it19:37
=== ben_r_ is now known as ben_r

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!