|
@@ -908,6 +908,18 @@ mod_sign_cmd = true
|
|
endif
|
|
endif
|
|
export mod_sign_cmd
|
|
export mod_sign_cmd
|
|
|
|
|
|
|
|
+ifdef CONFIG_STACK_VALIDATION
|
|
|
|
+ has_libelf := $(call try-run,\
|
|
|
|
+ echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0)
|
|
|
|
+ ifeq ($(has_libelf),1)
|
|
|
|
+ objtool_target := tools/objtool FORCE
|
|
|
|
+ else
|
|
|
|
+ $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
|
|
|
|
+ SKIP_STACK_VALIDATION := 1
|
|
|
|
+ export SKIP_STACK_VALIDATION
|
|
|
|
+ endif
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
ifeq ($(KBUILD_EXTMOD),)
|
|
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
|
|
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
|
|
@@ -1035,18 +1047,6 @@ prepare0: archprepare gcc-plugins
|
|
# All the preparing..
|
|
# All the preparing..
|
|
prepare: prepare0 prepare-objtool
|
|
prepare: prepare0 prepare-objtool
|
|
|
|
|
|
-ifdef CONFIG_STACK_VALIDATION
|
|
|
|
- has_libelf := $(call try-run,\
|
|
|
|
- echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0)
|
|
|
|
- ifeq ($(has_libelf),1)
|
|
|
|
- objtool_target := tools/objtool FORCE
|
|
|
|
- else
|
|
|
|
- $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
|
|
|
|
- SKIP_STACK_VALIDATION := 1
|
|
|
|
- export SKIP_STACK_VALIDATION
|
|
|
|
- endif
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
PHONY += prepare-objtool
|
|
PHONY += prepare-objtool
|
|
prepare-objtool: $(objtool_target)
|
|
prepare-objtool: $(objtool_target)
|
|
|
|
|