Compiling Linux Kernel fails looking at OpenSSL header files
Description
While compiling the Linux kernel, some error described below are met with the scripts/sign-file or scripts/extract-cert host compilation steps.
Additional information
Here are the build logs that are displayed when error occurs:
HOSTCC scripts/extract-cert
In file included from /usr/include/openssl/e_os2.h:13,
from /usr/include/openssl/bio.h:13,
from ../scripts/extract-cert.c:21:
/usr/include/x86_64-linux-gnu/openssl/opensslconf.h:13:10: fatal error: openssl/opensslv.h: Aucun fichier ou dossier de ce type
13 | #include <openssl/opensslv.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:107 : scripts/extract-cert] Erreur 1
make[1]: *** [/data/linux-at91/Makefile:1120 : scripts] Erreur 2
make: *** [../Makefile:179 : sub-make] Erreur 2
or
../scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: Aucun fichier ou dossier de ce type
21 | #include <openssl/bio.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:107 : scripts/extract-cert] Erreur 1
make[1]: *** [/data/linux-at91/Makefile:1120 : scripts] Erreur 2
make: *** [../Makefile:179 : sub-make] Erreur 2
This is due to missing OpenSSL development package which needs to be installed in on your host machine. These requirements are mentioned in a dedicated Kernel documentation page: Minimal requirements to compile the Kernel.
Solution
Depending on your host machine distribution, you should install libssl-dev or equivalent package with following commands:
- For Ubuntu up to version 18.04:
- For Ubuntu version 20.04 onward:
- For CentOS or old Fedora:
- For modern Fedora:
Related Topics
Boards
Sama5d2icp
[Sam9x60EK
Sama5d27WLSom1EK
Sama5d27Som1EK
Sama5d2PtcEK
Sama5d2Xplained
Sama5d3xek
Sama5d3Xplained
Sama5d4Xplained
Sama5d4ek
AT91sam9x5-ek,
other AT91SAM9 boards
Components
Summary
Kernel Compilation Error related to OpenSSL