設置 | 登錄 | 註冊

目前共有4篇帖子。

#error New address family defined, please update secclass_map.

1樓 巨大八爪鱼 2025-3-7 17:17

fedora41系统中编译linux4.14.2内核报错:#error New address family defined, please update secclass_map.


解决方法:https://lore.kernel.org/selinux/20190225005528.28371-1-paulo@paulo.ac/

scripts/selinux/genheaders/genheaders.c和scripts/selinux/mdp/mdp.c去除#include <sys/socket.h>。

security/selinux/include/classmap.h添加#include <linux/socket.h>。

2樓 巨大八爪鱼 2025-3-7 17:18

解决方法:

scripts/selinux/genheaders/genheaders.c和scripts/selinux/mdp/mdp.c去除#include <sys/socket.h>。

security/selinux/include/classmap.h添加#include <linux/socket.h>。


https://lore.kernel.org/selinux/20190225005528.28371-1-paulo@paulo.ac/

3樓 巨大八爪鱼 2025-3-7 17:35
In function ‘a20_test’:
cc1: note: source object is likely at address zero
In function ‘wrfs32’,
    inlined from ‘a20_test’ at arch/x86/boot/a20.c:74:2:
arch/x86/boot/boot.h:144:9: warning: array subscript 0 is outside array bounds of ‘u32[0]’ {aka ‘unsigned int[]’} [-Warray-bounds=]
In function ‘a20_test’:
cc1: note: source object is likely at address zero
arch/x86/boot/bioscall.S: Assembler messages:
arch/x86/boot/bioscall.S:38: Warning: found `movsd'; assuming `movsl' was meant
arch/x86/boot/bioscall.S:73: Warning: found `movsd'; assuming `movsl' was meant
Unsupported relocation type: R_X86_64_PLT32 (4)
make[2]: *** [arch/x86/boot/compressed/Makefile:120: arch/x86/boot/compressed/vmlinux.relocs] Error 1
make[1]: *** [arch/x86/boot/Makefile:112: arch/x86/boot/compressed/vmlinux] Error 2

make: *** [arch/x86/Makefile:296: bzImage] Error 2


解决办法:

https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b21ebf2fb4cde1618915a97cc773e287ff49173e

在arch/x86/kernel/machine_kexec_64.c,arch/x86/kernel/module.c和arch/x86/tools/relocs.c这三个文件中:
case R_X86_64_PC32:的下方添加case R_X86_64_PLT32:

4樓 巨大八爪鱼 2025-3-7 17:42

kernel module Makefile示例:

(注意要加EXTRA_CFLAGS=-Wno-missing-attributes)

KDIR := /home/oct1158/Downloads/linux-4.14.2


obj-m := test.o


build:

    $(MAKE) -C $(KDIR) M=$(shell pwd) EXTRA_CFLAGS=-Wno-missing-attributes modules


clean:

    $(MAKE) -C $(KDIR) M=$(shell pwd) clean

內容轉換:

回覆帖子
內容:
用戶名: 您目前是匿名發表。
驗證碼:
看不清?換一張
©2010-2025 Purasbar Ver3.0 [手機版] [桌面版]
除非另有聲明,本站採用知識共享署名-相同方式共享 3.0 Unported許可協議進行許可。