make headers_install 用法

Exporting kernel headers for use by userspace

The “make headers_install” command exports the kernel’s header files in a form suitable for use by userspace programs.

The linux kernel’s exported header files describe the API for user space programs attempting to use kernel services. These kernel header files are used by the system’s C library (such as glibc or uClibc) to define available system calls, as well as constants and structures to be used with these system calls. The C library’s header files include the kernel header files from the “linux” subdirectory. The system’s libc headers are usually installed at the default location /usr/include and the kernel headers in subdirectories under that (most notably /usr/include/linux and /usr/include/asm).

Kernel headers are backwards compatible, but not forwards compatible. This means that a program built against a C library using older kernel headers should run on a newer kernel (although it may not have access to new features), but a program built against newer kernel headers may not work on an older kernel.

The “make headers_install” command can be run in the top level directory of the kernel source code (or using a standard out-of-tree build). It takes two optional arguments:

make headers_install ARCH=i386 INSTALL_HDR_PATH=/usr

ARCH indicates which architecture to produce headers for, and defaults to the current architecture. The linux/asm directory of the exported kernel headers is platform-specific, to see a complete list of supported architectures use the command:

ls -d include/asm-* | sed 's/.*-//'

INSTALL_HDR_PATH indicates where to install the headers. It defaults to “./usr”.

An ‘include’ directory is automatically created inside INSTALL_HDR_PATH and headers are installed in ‘INSTALL_HDR_PATH/include’.

The kernel header export infrastructure is maintained by David Woodhouse <dwmw2@infradead.org>.

Next  Previous

Exporting kernel headers for use by userspace — The Linux Kernel documentationicon-default.png?t=M276https://www.kernel.org/doc/html/latest/kbuild/headers_install.html#:~:text=The%20%E2%80%9Cmake%20headers_install%E2%80%9D%20command%20exports%20the%20kernel%E2%80%99s%20header,user%20space%20programs%20attempting%20to%20use%20kernel%20services.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用\[1\]和引用\[3\]的内容,出现"make: *** \[Makefile:260: install-pkgconfig\] Error 1"的错误可能是由于缺少安装基本工具或者编译过程中的其他问题导致的。解决方法可以参考引用\[3\]中提到的安装基本工具的步骤,即使用以下命令安装基本工具: sudo apt install -y g++ sudo apt install -y cmake sudo apt install -y make sudo apt install -y wget sudo apt install -y unzip 另外,根据引用\[1\]中提到的解决方法,如果使用make -i8命令出现错误,可以尝试使用sudo make -j8命令来编译。 对于引用\[2\]中提到的"fatal error: stdlib.h:没有那个文件或目录"错误,可以尝试在cmake命令中添加-DENABLE_PRECOMPILED_HEADERS = OFF参数来解决。 综上所述,您可以尝试按照上述方法解决make: *** \[Makefile:260: install-pkgconfig\] Error 1的问题。 #### 引用[.reference_title] - *1* *2* [Ubuntu20.04编译安装opencv3.2和opencv_contrib-3.2](https://blog.csdn.net/qq_41721951/article/details/124047966)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [【C++版Opencv】【Ubuntu】VScode配置Opencv](https://blog.csdn.net/wss794/article/details/124850094)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值