4

I'm trying to build the newest version of glibc (2.19) on CentOS 5.6 and I've run into some issues

The documentation of glibc says that I need at minimum the linux kernel headers 2.6.19 (even if this is not the kernel I am using). I tried to install the headers using

make headers_install INSTALL_HDR_PATH=/root/kernel/headers/ 

This command finishes without complaining about anything going wrong but when I go to build glibc after configuring with

/root/glibc/glibc-2.19-source/configure --prefix=/root/glibc/glibc-2.19/ --enable-kernel=2.6.18 --with-headers=/root/kernel/headers/include
make -j 12

make encounters an error

#include <selinux/selinux.h> selinux/selinux.h: no such file or directory

I think the selinux headers ought to be in /root/kernel/headers/include because I read on wikipedia:

It has been integrated into the Linux kernel mainline since version 2.6, on 8 August 2003

I looked in /root/kernel/header/include and the is no folder named selinux

My question is: Should the selinux headers be installed with the rest of the kernel headers and if so how should I get them to be installed?

I'm using gcc 4.9.0 and binutils 2.24. My current version of glibc is 2.5. My kernel version is 2.6.18

Note that I am not willing to accept much downtime and do not want to change active kernel versions or replace my current glibc altogether.

2 Answers 2

3

You can easily find out what package provides that specific file issuing:

$ yum provides */selinux.h

I don't have a CentOS 5.9 around to try it, but most probably the result will be kernel-devel and libselinux-devel packages.

You should always use the kernel headers that match the kernel you are using.

1
  • 2
    In Debian it's libselinux1-dev. Commented Apr 24, 2020 at 7:44
0

While compiling systemd I ran into error

In file included from ../src/shared/env-file-label.c:7:
../src/shared/selinux-util.h:13:10: fatal error: selinux/selinux.h: No such file or directory
   13 | #include <selinux/selinux.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

Package libselinux-dev worked on Ubuntu 22

$ apt install libselinux-dev

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .