Linux compilation throwing error header file error - c

I am compiling this code (minimul linux kernel) from https://github.com/liva/minimal-linux
I am getting > make[1]: *** [Kbuild:42: include/generated/timeconst.h] Error 127
basically its make error. may be error in timeconst.h or may be its missing file.
So my question is how to find the file in the minimul-linux-master (download from above link) folder and how to debug for more info when compiling the code.
as u can see what make displays is completely useless. And I have no clue why the error is caused. there are not any other errors so I assumed all the errors or single error is in timeconst.h.
this is terminal output.
....
HOSTCC scripts/mod/sumversion.o
HOSTLD arch/x86/tools/relocs
HOSTCC scripts/mod/file2alias.o
UPD include/config/kernel.release
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC kernel/bounds.s
CHK include/generated/timeconst.h
/bin/sh: 1: bc: not found
make[1]: *** [Kbuild:42: include/generated/timeconst.h] Error 127
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1054: prepare0] Error 2
make: *** Waiting for unfinished jobs....
HOSTLD scripts/mod/modpost
I am on host: 5.10.0-kali3-amd64
machine is x86-64

I fixed the same by comparing mine KBuild with the one defined in in the given link.
https://android.googlesource.com/kernel/msm/+/db248780101f2ca2bc3c02598917e88dfdce3207/Kbuild

Related

Errors in building INET in omnet++ 5.5.1

I have installed OMNeT++ 5.5.1 in ubuntu 18.04 successfully and it is working.
However, I am getting the following errors while building the latest version of INET. I followed the instructions ( using the IDE) given in the document. Can anyone please help me to get ride of it? Thank you.
/tmp/cc4FhpSO.s: Assembler messages:
/tmp/cc4FhpSO.s: Fatal error: can't close ../out/gcc-debug/src/inet/visualizer/base/MediumVisualizerBase.o: No space left on device
Makefile:1754: recipe for target '../out/gcc-debug/src/inet/visualizer/base/MediumVisualizerBase.o' failed
make[1]: *** [../out/gcc-debug/src/inet/visualizer/base/MediumVisualizerBase.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/tech/Downloads/inet4/src'
make: *** [all] Error 2
Makefile:7: recipe for target 'all' failed
"make MODE=debug -j2 all" terminated with exit code 2. Build might be incomplete.
20:48:19 Build Failed. 5 errors, 0 warnings. (took 11m:39s.915ms)
It seems that you don't have free space in the disk:
/tmp/cc4FhpSO.s: Fatal error: can't close ../out/gcc-debug/src/inet/visualizer/base/MediumVisualizerBase.o: No space left on device

How can I make C compiler find the folder?

I have an error message while building my C program:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../bin/hannimpeha] Error 1
make[2]: *** [CMakeFiles/hannimpeha.dir/all] Error 2
make[1]: *** [CMakeFiles/hannimpeha.dir/rule] Error 2
make: *** [hannimpeha] Error 2
My cmake file goes like
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/cmake-build-debug)
add_executable(hannimpeha ${PROJECT_SOURCE_DIR}/bin/OLED_main.c)
How can I make C compiler find the right path?

How to fix 'ld: library not found for -lglib-2.0'

I have to do a compiler with flex and bison for a school project.
They give to me example of new language but I can't compile them..
The code is working fine for other people so the problem come from my Mac. The problem appears when I try to compile with make command, he say "ld: library not found for -lglib-2.0".
I installed "Glib" already but this don't solve the problem.
make
[ 20%] Linking C executable facile
ld: library not found for -lglib-2.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [facile] Error 1
make[1]: *** [CMakeFiles/facile.dir/all] Error 2
make: *** [all] Error 2
I need to compile the code to work after on the project.
Thanks you

Error while cross compiling poppler package

I am getting the following error while cross compiling Poppler package on Ubuntu
After configuring I gave command make
then while making the following error has come
GlobalParams.cc:81:35: fatal error: fontconfig/fontconfig.h: No such file or directory
compilation terminated.
make[3]: * [libpoppler_la-GlobalParams.lo] Error 1
make[3]: Leaving directory /media/COMMON/WorkSpace/Packages/poppler-0.41.0/poppler'
make[2]: *** [all] Error 2
make[2]: Leaving directory/media/COMMON/WorkSpace/Packages/poppler-0.41.0/poppler'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/media/COMMON/WorkSpace/Packages/poppler-0.41.0'
make: *** [all] Error 2
I even check the includes which I had given while configuring it has the fontconfig/fontconfig.h but den still the error is coming.
It looks like you should cross-compile the fontconfig library,then include the headers and libs into Popper.
Download the latest fontconfig and excute the conmmand below:
PKG_CONFIG_PATH=/opt/poppLib/lib/pkgconfig ./configureCC=arm-linux-gcc --host=arm-linux --build=i386-linux --prefix=/opt/poppLib--with-arch=arm --enable-libxml2 --disable-docs
make && make install
then add the include and lib in your Popper ,try compile it again.

glibc not properly compiling

While compiling glibc 2.11, I get the following error. Any idea how to solve this.
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:
../misc/syslog.c: In function ‘__vsyslog_chk’:
../misc/syslog.c:123: sorry, unimplemented: inlining failed in call to ‘syslog’: function body not available
../misc/syslog.c:155: sorry, unimplemented: called from here
make[2]: *** [/home/alice/Desktop/glib-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/home/alice/Desktop/glibc-2.11/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/home/alice/Desktop/glibc-2.11'
make: *** [all] Error 2
Apparently, this is a known problem with building glibc on Ubuntu. In essence:
glibc does not build with _FORTIFY_SOURCE enabled, and Ubuntu compiles stuff with -D_FORTIFY_SOURCE=2.
You need to disable this by undefining _FORTIFY_SOURCE. i.e. append -U_FORTIFY_SOURCE to your CFLAGS.

Resources