I was trying to compile Linux Kernel from source. I've compiled the kernel previously and never got any error. But this time I am facing an error. The error is
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
HOSTCC scripts/sign-file
/tmp/cczyW3hq.o: In function `main':
sign-file.c:(.text.startup+0x52): undefined reference to `OPENSSL_init_crypto'
sign-file.c:(.text.startup+0x5e): undefined reference to `OPENSSL_init_crypto'
sign-file.c:(.text.startup+0x247): undefined reference to `OPENSSL_init_crypto'
collect2: error: ld returned 1 exit status
scripts/Makefile.host:91: recipe for target 'scripts/sign-file' failed
make[1]: [scripts/sign-file] Error 1
When I checked scripts/sign-file.c, I saw comment saying Sign a module file using the given key.
. So I reran make menuconfig
, and set Module signature verification
off. And tried to compile again. Now, previous error was removed but new error showed up which was same as above but on different file. Here is the error,
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
HOSTCC scripts/extract-cert
/tmp/ccA63AAC.o: In function `main':
extract-cert.c:(.text.startup+0x25): undefined reference to `OPENSSL_init_crypto'
extract-cert.c:(.text.startup+0x31): undefined reference to `OPENSSL_init_crypto'
collect2: error: ld returned 1 exit status
scripts/Makefile.host:91: recipe for target 'scripts/extract-cert' failed
make[1]: *** [scripts/extract-cert] Error 1
Makefile:556: recipe for target 'scripts' failed
make: *** [scripts] Error 2
So I want to know whether this problem is with libssl
or some configuration error? I am using Ubuntu 16.04LTS
with gcc-5.3.1
.
EDIT: I have tried reinstalling libssl-dev and also tried compiling openssl from source code and then installing too. I have copied config file from /boot/config-4.4.0-22-generic
to source directory.
UPDATE:
with make scripts V=1
following is the output:
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.asm-generic \
src=asm obj=arch/x86/include/generated/asm
make -f ./scripts/Makefile.asm-generic \
src=uapi/asm obj=arch/x86/include/generated/uapi/asm
make -f ./scripts/Makefile.build obj=scripts
make -f ./scripts/Makefile.build obj=scripts/gdb
make -f ./scripts/Makefile.build obj=scripts/gdb/linux
make -f ./scripts/Makefile.build obj=scripts/genksyms
make -f ./scripts/Makefile.build obj=scripts/mod
make -f ./scripts/Makefile.build obj=scripts/selinux
make -f ./scripts/Makefile.build obj=scripts/selinux/genheaders
make -f ./scripts/Makefile.build obj=scripts/selinux/mdp
gcc -Wp,-MD,scripts/.sign-file.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -I./tools/include -o scripts/sign-file scripts/sign-file.c -lcrypto
/tmp/cc7o2Y1C.o: In function `main':
sign-file.c:(.text.startup+0x52): undefined reference to `OPENSSL_init_crypto'
sign-file.c:(.text.startup+0x5e): undefined reference to `OPENSSL_init_crypto'
sign-file.c:(.text.startup+0x247): undefined reference to `OPENSSL_init_crypto'
collect2: error: ld returned 1 exit status
scripts/Makefile.host:91: recipe for target 'scripts/sign-file' failed
make[1]: *** [scripts/sign-file] Error 1
Makefile:556: recipe for target 'scripts' failed
make: *** [scripts] Error 2
make scripts V=1
say (from the top-level directory)?libcrypto*
from/usr/local/lib
(or wherever you installed your manually-built version)?