Currently, there is no way to override the AR definition in tools/objtool/Makefile.
Apply the following debugging patch:
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 53f8be0f4a1f..f8b4380d861e 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -49,6 +49,7 @@ $(OBJTOOL_IN): fixdep FORCE
@$(MAKE) $(build)=objtool
$(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN)
+ @echo '$$(AR): $(AR)'
@$(CONFIG_SHELL) ./sync-check.sh
$(QUIET_LINK)$(CC) $(OBJTOOL_IN) $(LDFLAGS) -o $@
then run:
$ make -j$(nproc) AR=llvm-ar defconfig modules_prepare
...
CC arch/x86/kernel/asm-offsets.s
LD /tmp/linux/tools/objtool/objtool-in.o
$(AR): ar
...
This is problematic for hermetic builds where we will remove the GNU tools to ensure they are never called.
I'll send a patch for this shortly.
Patch sent: https://lore.kernel.org/lkml/[email protected]/
Patch accepted: https://git.kernel.org/tip/8ea58f1e8b11cca3087b294779bf5959bf89cc10
Should be in the next tip pull request.
Merged into mainline: https://git.kernel.org/torvalds/c/8ea58f1e8b11cca3087b294779bf5959bf89cc10
Most helpful comment
Merged into mainline: https://git.kernel.org/torvalds/c/8ea58f1e8b11cca3087b294779bf5959bf89cc10