80

I have RedHat Enterprise Linux Server 7, and I downloaded the linux kernel version 4.12.10 which I am trying to compile but when I execute the following command:

make modules

I get the following error:

scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory

Does anyone have an idea to fix this please ?

jww
  • 97,681
  • 90
  • 411
  • 885
rainman
  • 2,551
  • 6
  • 29
  • 43
  • 1
    OpenSSL is not used in kernel modules that I am aware. The kernel provides its own crypto, and some of the OpenSSL team contributes to it like Andy Polyakov. Its odd to see OpenSSL in the message above. I guess its some helper program or something to bootstrap things. Its definitely not the kernel proper. – jww Sep 01 '17 at 22:33
  • Possible duplicate of [How to compile .c file with OpenSSL includes?](https://stackoverflow.com/questions/3368683/how-to-compile-c-file-with-openssl-includes), [Openssl how to compile a simple program?](https://stackoverflow.com/q/6304086/608639), [Compiling C program with OpenSSL](https://stackoverflow.com/q/43644785/608639), etc. – jww Sep 01 '17 at 22:34

4 Answers4

163

To fix this problem, you have to install OpenSSL development package, which is available in standard repositories of all modern Linux distributions.

To install OpenSSL development package on Debian, Ubuntu or their derivatives:

$ sudo apt-get install libssl-dev

To install OpenSSL development package on Fedora, CentOS or RHEL:

$ sudo yum install openssl-devel 

Edit : As @isapir has pointed out, for Fedora version>=22 use the DNF package manager :

dnf install openssl-devel
user10089632
  • 5,216
  • 1
  • 26
  • 34
35

For Alpine Linux:

apk add openssl-dev
cstroe
  • 3,740
  • 3
  • 27
  • 16
4

On CYGwin, you can install this as a typical package in the first screen. Look for

libssl-devel

  • After facing up a lot of make errors from the official depository, it seems that cygwin packages works well with cygwin compilers ^^ – Cevik Mar 10 '22 at 08:28
1

for resolving this issue install:

# yum install openssl openssl-devel

and then try again to do make bzImage.

Arash Foroughi
  • 139
  • 2
  • 6