Can't compile kernel 4.19.122 from git source

Hi…
I’m trying to compile kernel but i always got errors with openssl. I installed libssl-dev but gives errors for openssl. i tryed to copy openssl directory to src tools directory but again it gives opensslconf.h not found error.
I have been compiled kernel before and there wasnt get any problem but this time these errors made me crazy.


HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/extract-cert
HOSTLD scripts/dtc/dtc
In file included from ./tools/include/openssl/bio.h:13:0,
from scripts/extract-cert.c:21:
./tools/include/openssl/e_os2.h:13:34: fatal error: openssl/opensslconf.h: No such file or directory

include <openssl/opensslconf.h>

                              ^

compilation terminated.
scripts/Makefile.host:90: recipe for target ‘scripts/extract-cert’ failed
make[1]: *** [scripts/extract-cert] Error 1

please help…

I already doing it like that and it gives this error. i did it before for older kernel because of adding can_bittiming driver need to be inside kernel for modules working. but th,s time gives errors. i dont know why…

Hi,

Are compiling on the PI or is it a cross compile?

Thanks Tom.

I tryed both on virtual debian 64x pc it gives so much error i coudnt fix all of them then tryed on rbp3 and gave this error

What does your sources.list look like?

i dont make any change on rpi
here its:

deb http://ftp.debian.org/debian stretch main contrib non-free

deb Index of /debian stretch-updates main contrib non-free

deb http://security.debian.org/ stretch/updates main contrib non-free

deb http://apt.osmc.tv stretch main

How are you trying to build the kernel?

You should just run make rbp2 under kernel-osmc

here its step by step on root user

apt-get update
apt-get install build-essential git libncurses5-dev bc bison flex chrpath gawk texinfo libsdl1.2-dev whiptail diffstat cpio libssl-dev liblz4-tool
git clone https://github.com/osmc/osmc.git

Im changing rbp2-000-add-kernel-config.patch for additional drivers
then

cd osmc/packages/kernel-osmc
make rbp2

but first time it gives openssl\bio.h missing
then i copied openssl folder to src/kernel-4.19.122/tools/include
but this time it gives configuration.h missing error

thas all…

Try purge the toolchain - it could be corrupted.

I will try now but i dont know how to purge can u explain it

or just need to do re-compile and install it?

btw i tried to compile it on virtoalbox debian x64 system and it gave

    CC journal.c
    CC revoke.o

./…/misc/create_inode.c: In function ‘set_inode_xattr’:
./…/misc/create_inode.c:140:9: warning: implicit declaration of function ‘llistxattr’; did you mean ‘lstat64’? [-Wimplicit-function-declaration]
size = llistxattr(filename, NULL, 0);
^~~~~~~~~~
lstat64
./…/misc/create_inode.c:176:16: warning: implicit declaration of function ‘lgetxattr’; did you mean ‘getdate_r’? [-Wimplicit-function-declaration]
value_size = lgetxattr(filename, name, NULL, 0);
^~~~~~~~~
getdate_r
./…/misc/create_inode.c: At top level:
./…/misc/create_inode.c:399:18: error: conflicting types for ‘copy_file_range’
static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
^~~~~~~~~~~~~~~
In file included from ./…/misc/create_inode.c:19:
/usr/include/unistd.h:1107:9: note: previous declaration of ‘copy_file_range’ was here
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
^~~~~~~~~~~~~~~
make[3]: *** [Makefile:423: create_inode.o] Error 1
make[3]: *** Waiting for unfinished jobs…
make[3]: Leaving directory ‘/mnt/package/kernel-osmc/initramfs-src/e2fsprogs/e2fsprogs-1.43.7/debugfs’
make[2]: *** [Makefile:404: all-progs-recursive] Error 1
make[2]: Leaving directory ‘/mnt/package/kernel-osmc/initramfs-src/e2fsprogs/e2fsprogs-1.43.7’
make[1]: *** [Makefile:340: all] Error 2
make[1]: Leaving directory ‘/mnt/package/kernel-osmc/initramfs-src/e2fsprogs/e2fsprogs-1.43.7’
Error occured during build
make: *** [Makefile:5: kernel] Error 1
Building initramfs failed
make: *** [Makefile:8: rbp2] Error 1
make: Leaving directory ‘/mnt/package/kernel-osmc’
make: *** [Makefile:8: rbp2] Error 2
:frowning:

Try build using the Buster branch and update sources to include the Buster line.

Then purge the toolchain packages and it should work.

installing buster now i wil try

You don’t need to install Buster. Just add the Buster repo for toolchains.

i know but if it need buster repos i think its better to use it

i tried to compile armv7-toolchain and got this error

I: Base system installed successfully.
Filesystem configured successfully
Enabling networking
cp: cannot stat ‘/etc/network/interfaces’: No such file or directory
Can’t copy networking file
Exiting build with return code 1
Makefile:2: recipe for target ‘all’ failed
make: *** [all] Error 1

You don’t need to compile it. It is available as a prebuilt.

no way i can find. i tryed debian jessie also buster and bullseye on vbox and 3 osmc build on rbp3 all of them giving same errors.

i think its about dependicies or about package needs

sam_nazarko which platform is you are using? i also trying in ubuntu 18 now. again it gives cert extract error :slightly_frowning_face:

i have rbp2-image-4.14.34-5-osmc that conpiled before. if i use it can i have any problem?