[RFC,v1,07/23] objtool: Introduce STATIC_CHECK

Message ID 1687247390-31979-3-git-send-email-tangyouling@loongson.cn
State New
Headers
Series LoongArch: Add objtool and ORC unwinder support |

Commit Message

Youling Tang June 20, 2023, 7:49 a.m. UTC
  From: "Madhavan T. Venkataraman" <madvenka@linux.microsoft.com>

Objtool currently implements static stack validation. Another method called
dynamic validation can be supported for other architectures.

Define STATIC_CHECK to select the files required for static validation
in objtool build.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
---
 tools/objtool/Build    | 6 +++---
 tools/objtool/Makefile | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)
  

Patch

diff --git a/tools/objtool/Build b/tools/objtool/Build
index 4e9ec210f134..0eec935b52c9 100644
--- a/tools/objtool/Build
+++ b/tools/objtool/Build
@@ -2,13 +2,13 @@  objtool-y += arch/$(SRCARCH)/
 
 objtool-y += weak.o
 
-objtool-y += check.o
-objtool-y += special.o
+objtool-$(STATIC_CHECK) += check.o
+objtool-$(STATIC_CHECK) += special.o
 objtool-y += builtin-check.o
 objtool-y += cfi.o
 objtool-y += insn.o
 objtool-y += decode.o
-objtool-y += unwind_hints.o
+objtool-$(STATIC_CHECK) += unwind_hints.o
 objtool-y += elf.o
 objtool-y += objtool.o
 
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 83b100c1e7f6..2262b49691b8 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -55,9 +55,10 @@  BUILD_ORC := n
 
 ifeq ($(SRCARCH),x86)
 	BUILD_ORC := y
+	STATIC_CHECK := y
 endif
 
-export BUILD_ORC
+export BUILD_ORC STATIC_CHECK
 export srctree OUTPUT CFLAGS SRCARCH AWK
 include $(srctree)/tools/build/Makefile.include