Linux: objtool Makefile hardcodes $(AR)

Created on 15 May 2019  路  3Comments  路  Source: ClangBuiltLinux/linux

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.

[BUG] linux [FIXED][LINUX] 5.2 [TOOL] llvm-ar

Most helpful comment

All 3 comments

Patch accepted: https://git.kernel.org/tip/8ea58f1e8b11cca3087b294779bf5959bf89cc10

Should be in the next tip pull request.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nickdesaulniers picture nickdesaulniers  路  5Comments

nathanchance picture nathanchance  路  4Comments

tpgxyz picture tpgxyz  路  4Comments

nathanchance picture nathanchance  路  3Comments

tpgxyz picture tpgxyz  路  4Comments