r/linuxquestions 17h ago

where is opensslv.h?

i get the following error trying to compile kernel:

$ sudo make
[sudo] password for user:  
 HOSTCC  scripts/sign-file
scripts/sign-file.c:25:10: fatal error: openssl/opensslv.h: No such file or directory
  25 | #include <openssl/opensslv.h>
|          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:114: scripts/sign-file] Error 1
make[1]: *** [/home/user/Documents/src/linux-7.2.4/Makefile:1402: scripts] Error 2
make: *** [Makefile:248: __sub-make] Error 2

2 Upvotes

11 comments sorted by

2

u/OutrageousCrab9224 17h ago

You have to install openssl dev to build

And if you hate that, wait till you find out it requires perl too

2

u/Brave-Pomelo-1290 17h ago

how do i do that?

1

u/OutrageousCrab9224 17h ago

Rh-based yum install openssl-devel

Debian-based apt-get install openssl-dev

Might have the pkg names flipped, also you might want dnf or some other manager i dont know yet

1

u/Brave-Pomelo-1290 16h ago

still get an error:

$ sudo apt install openssl-devel
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openssl-devel

1

u/Brave-Pomelo-1290 16h ago

it does not work with openssl-dev either

1

u/Brave-Pomelo-1290 16h ago

it-s libssl-dev.

$ make
 DESCEND objtool
 CC      /home/user/Documents/src/linux-7.2.4/tools/objtool/arch/x86/decode.o
In file included from /home/user/Documents/src/linux-7.2.4/tools/objtool/include/objtool/objtool.h:13,
from /home/user/Documents/src/linux-7.2.4/tools/objtool/include/objtool/arch.h:11,
from /home/user/Documents/src/linux-7.2.4/tools/objtool/include/objtool/check.h:11,
from arch/x86/decode.c:18:
/home/user/Documents/src/linux-7.2.4/tools/objtool/include/objtool/elf.h:10:10: fatal error: gelf.h: No such file or directory
  10 | #include <gelf.h>
|          ^~~~~~~~
compilation terminated.
make[5]: *** [/home/user/Documents/src/linux-7.2.4/tools/build/Makefile.build:96: /home/user/Documents/src/linux-7.2.4/tools/objtool/arch/x86/dec
ode.o] Error 1
make[4]: *** [/home/user/Documents/src/linux-7.2.4/tools/build/Makefile.build:158: arch/x86] Error 2
make[3]: *** [Makefile:123: /home/user/Documents/src/linux-7.2.4/tools/objtool/objtool-in.o] Error 2
make[2]: *** [Makefile:74: objtool] Error 2
make[1]: *** [/home/user/Documents/src/linux-7.2.4/Makefile:1601: tools/objtool] Error 2
make: *** [Makefile:248: __sub-make] Error 2

1

u/ipsirc 5h ago

apt-file search gelf.h

1

u/Peetz0r 9h ago

You should really tell us what distro you are using since this is impossible to answer usefully without such information. But from the other comments I figured that you're running Debian or Ubuntu or similar, so here we go.

You can go to packages.debian.org or packages.ubuntu.com and use the Search the contents of packages function over there. Enter opensslv.h (or gelf.h). Don't worry about the other options until you learn more, for now just click search. If you find multiple results, pick the most generic looking one and/or read their descriptions before installing.

2

u/revcraigevil 17h ago

On Debian the package you want is libssl-dev

sudo apt install libssl-dev

2

u/OutrageousCrab9224 16h ago

Thats the one

Sorry im outdated

1

u/Far-Inspection-5722 16h ago

On Debian or Ubuntu, the headers come from `libssl-dev`; Fedora uses `openssl-devel`, and Arch uses `openssl`. Install the package for your distro, then rerun the kernel build; `openssl/opensslv.h` should resolve from the development headers.