Skip to content

Commit

Permalink
ANDROID: Makefile: set -Qunused-arguments sooner
Browse files Browse the repository at this point in the history
The recently added support for -fuse-ld=lld is problematic for kbuild in
that cc-option tests that add -Werror -c -fuse-ld=lld, as -c implies
that no linker is invoked, and thus -fuse-ld=lld is an unused flag.
Therefor, -Qunused-arguments needs to be set sooner in the Makefile,
otherwise cc-option will fail when building with:

$ make LD=ld.lld

Also, -Qunused-arguments has been supported by Clang for a long time;
there's no need to wrap it in cc-option.

Bug: 63740206
Bug: 124794189
Change-Id: I90fb78fab1197db781ede09327783f616e5fbfaf
Link: ClangBuiltLinux/linux#366
Suggested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
  • Loading branch information
nickdesaulniers authored and ExtremeXT committed Aug 6, 2024
1 parent adbcd4f commit 1e16938
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ export CLANG_FLAGS
ifeq ($(ld-name),lld)
KBUILD_CFLAGS += -fuse-ld=lld
endif
KBUILD_CPPFLAGS += -Qunused-arguments
endif

RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
Expand Down Expand Up @@ -737,7 +738,6 @@ endif
KBUILD_CFLAGS += $(stackp-flag)

ifeq ($(cc-name),clang)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
Expand Down

0 comments on commit 1e16938

Please sign in to comment.