Error while compiling module for linux kernel - linux-kernel

I am using Fedora 16.The kernel is 3.3.2.-6.fc16.i686.PAE.I have installed the correct kernel devel.But when I am trying to compile any module against it I am getting an error mentioned below
No rule to make target
/usr/src/kernels/3.3.2-6.fc16.i686.PAE/arch/x86/syscalls/syscall_32.tbl',
needed byarch/x86/syscalls/../include/generated/asm/unistd_32.h'.
Stop.
Any idea what is wrong and what needs to be done?

If you have the kernel sources, just compile it again and try compiling your module.

Related

Can't compile linux kernel 5.10 with BTF type info enabled

I am want to compile linux 5.10.162 with CONFIG_DEBUG_INFO_BTF=y, the end goal being to enable bpf CO-RE. However, the build is failing with:
+ ./tools/bpf/resolve_btfids/resolve_btfids vmlinux
FAILED unresolved symbol udp_sock
I first thought it was something similar to this issue, but after moving to a newer gcc, the issue persists.
Relevant packages:
gcc 11.1.0 (also tested with 10.2)
dwarves 1.24 (also tested with 1.22)
Bear in mind don't have much experience compiling linux. Let me know if the config will be of use.

Compiling issue with Boost asio

My goal is to cross-compile a code file with Yocto SDK on my host machine to make it executable on my target Board. I am using SUMO Yocto version and GCC 7.3 cross compiler.
First of all, to get with YOCTO cross compiling I created a file Hello.c :
#include <stdio.h>
int main(void)
{
printf ("Hello World!\n");
return 0;
}
I compiled the file executing :
make hello
Now I have a compiled file which is ready to be executed on my target board.
But now I have multiple .h files and multiple .cpp files and a main file.
When I execute main file like this :
make main
an error occurs:
main.cpp:10:10: fatal error: boost/asio.hpp: No such file or directory
include ^~~~~~~~~~~~~~~~ compilation terminated.
: recipe for target 'main' failed make: *** [main] Error 1
I think that I have a problem with Boost and asio.hpp.
Is the boost library included in my Yocto Linux image ?
What is the problem with asio.hpp ?
How can I fix this please ?
Thanks
I just noticed that, actually, you're not using the SDK but the toolchain which only includes glibc along with some basic tools and gdb; usually used to build test apps and debug. So that, you need to build the real SDK which contains, in addition to the toolchain, the dev version (libs/headers/other files) of the packages installed in the rootfs of your image. This can be accomplished by:
bitbake -c populate_sdk <your_image>
Once the SDK is built you need to install it through the generated installer script. Also, don't forget to source the environment setup script before you start to work!
For further information refer to https://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html#sdk-building-an-sdk-installer

Some doubts on kernel building

I was trying to build a kernel for my android device. I would have used my Linux system for building a kernel but unfortunately it had its hdd failed. So I am now using Windows 10 WSL for building the kernel. I am really new in building kernel and I have a few doubts:
When I tried to use arm-linux-gnueabihf 4.7 for making clean I got this error:
ccache execv 'my toolchain path' execv format error
I tried it with few other toolchains but same error came. Then I used arm-eabi 4.8 which worked correctly. This solved the problem but I would like to know what the error was and what caused it and is there a fix?
How should I know what toolchain I should use for building kernels like some people tell me to use a toolchain some people tell me to use someother toolchain.
When I tried to build the kernel with arm-eabi 4.8 I got an error
/home/inkiluz/kernel/security/tima_uevent/tima_uevent.c:217:1: fatal error: opening dependency file security/tima_uevent/.tima_uevent.o.d: No such file or directory
module_exit(tima_uevent_exit);
^
compilation terminated.
Is this a toolchain error or did i do something wrong? How can I rectify this?
Here is the the error log: https://del.dog/diwijegetu.
Please do help me out...

kernel compile and menuconfig

I am a newer in linux and using ubuntu(4.4.0-64-generic) in vmware fusion. I am learning how to compile kernel. So, I downloaded the kernel(linux-4.4.52.tar.xz) from the kernel.org. But when I input make menuconfig, there are some errors.
root#ubuntu:/usr/src/linux-4.4.52# make menuconfig
HOSTCC scripts/basic/fixdep
In file included from /usr/include/x86_64-linux-gnu/bits/posix1_lim.h:160:0,
from /usr/include/limits.h:143,
from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:168,
from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:7,
from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:34,
from scripts/basic/fixdep.c:114:
/usr/include/x86_64-linux-gnu/bits/local_lim.h:38:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
scripts/Makefile.host:91: recipe for target 'scripts/basic/fixdep' failed
make[1]: * [scripts/basic/fixdep] Error 1
Makefile:444: recipe for target 'scripts_basic' failed
make: * [scripts_basic] Error 2
I have installed headers files and done everything I can do. Someone can help me solve this problem?
You symbolic link is wrong; /usr/src/linux-4.4.0-64-generic/include/linux is the wrong directory and must not be linked to /usr/include/linux.
The kernel has two sets of headers: kernel-internal headers, and user API headers. The latter are inside the uapi directory, and they are what user-space program should see.
When you are compiling your own kernel, you can install the user-space headers of that kernel with make headers_install.
When you are using your distribution's kernel, you can just (re-)install the appropriate package (in your case, linux-headers-generic), and that will do the right thing as long as you do not muck around with those files afterwards.

Issues in Cross compiling when linking GMP to GCC

Using the How To Build GCC 4.8.2 ARM Cross-Compiler, I have installed and setup everything and it works just fine as mentioned in the post i.e., I was able to cross compile a simple C code. But, when I try to compile a simple GMP code, I get this error.
fatal error: gmp.h: No such file or directory
Compilation terminated
How should I fix this? My goal is to compile a gmp program. If possible, refer me to good tutorials.
Thanks!
If you want GMP compiled for the target system (ARM), you must compile it by itself using the newly built cross-compiler, not as a part of building GCC. GMP (along with MPFR, MPC, ISL, CLooG, etc.) being placed in the GCC toplevel source directory simply means that it gets compiled and linked for the cross-compiler you're building.
Since the cross-compiler will run on the host system, GMP will also be compiled for the host system, else linking the library would fail, and you wouldn't get a cross-compiler. It may sound silly, but there are reasons for doing it this way, such as buggy prebuilt packages provided by the package manager on the host system or merely to avoid installing those libraries on the host system when all you want is the cross-compilation toolchain.

Resources