编译内核模块时如何使用标志
How to use flags while compiling Kernel Modules
我需要为我的内核模块使用一些优化和循环展开标志。但是我不知道如何将这些标志添加到 makefile 中。
KMOD= hello # Name of KLD to build
SRCS= hello.c # List of source files
.include <bsd.kmod.mk>
我尝试 google 搜索但没有得到任何我可以使用的东西。谢谢你的时间。
编辑 1:
我正在循环执行一些内核内存修补。所以我不希望循环展开,因为这意味着需要更多修补。
我试过了
KMOD= hello # Name of KLD to build
SRCS= hello.c # List of source files
CFLAGS = -O0 -fno-unroll-loops #tried combination of this and +=
.include <bsd.kmod.mk>
我也试过了,(我知道这只是一厢情愿)
make DEBUG_FLAGS = -O0 -fno-unroll-loops
我需要为我的内核模块使用一些优化和循环展开标志。但是我不知道如何将这些标志添加到 makefile 中。
KMOD= hello # Name of KLD to build
SRCS= hello.c # List of source files
.include <bsd.kmod.mk>
我尝试 google 搜索但没有得到任何我可以使用的东西。谢谢你的时间。
编辑 1: 我正在循环执行一些内核内存修补。所以我不希望循环展开,因为这意味着需要更多修补。
我试过了
KMOD= hello # Name of KLD to build
SRCS= hello.c # List of source files
CFLAGS = -O0 -fno-unroll-loops #tried combination of this and +=
.include <bsd.kmod.mk>
我也试过了,(我知道这只是一厢情愿)
make DEBUG_FLAGS = -O0 -fno-unroll-loops