Re: where is headers_install in KBUILD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 25 Feb 2019 06:43:39 -0500, YU Bo said:

> But, my "question" is:  when i test some program which needs kernel headers,
> where to install those headers file?
> In Documention/kbuild/headers_install.rst, i learn it :
> 	make headers_install INSTALL_HDR_PATH=/usr
> In my case, Is it ok to do that?I do not think it will work.

You need to put the headers into a directory that will be accessible to your
"program that needs kernel headers" at build time. Hint: gcc has a "-I" option
for a reason, and CFLAGS is an actual thing for a reason....

Note that in general, most programs *won't* need the new kernel headers,
because glibc (or musl, or whatever your libc is) will be insulating you from
the actual syscall interface anyhow.

Also, dropping the headers into /usr/include is dangerous, as the next time
you apply software updates, they could overlay your version of the headers
with the distro's version, which will cause lots of debugging fun the next time
you rebuild your program and it builds against old headers.  If you're lucky,
the build will fail.  If you're unlucky, the program will build but fail in subtle
ways at runtime....

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux