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>
Signed-off-by: Yousef Algadri <yusufgadrie@gmail.com>
Signed-off-by: Raphiel Rollerscaperers <rapherion@raphielgang.org>
Signed-off-by: Twisted <36546624+TwistedPrime@users.noreply.github.com>
Signed-off-by: MadeOfGreat <ravenklawasd@gmail.com>
Signed-off-by: GhostMaster69-dev <rathore6375@gmail.com>
  • Loading branch information
nickdesaulniers authored and dhelo11 committed Sep 9, 2024
1 parent d725a84 commit fd36bbb
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 @@ -531,6 +531,7 @@ KBUILD_AFLAGS += $(CLANG_FLAGS)
ifeq ($(ld-name),lld)
KBUILD_CFLAGS += -fuse-ld=lld
endif
KBUILD_CPPFLAGS += -Qunused-arguments
endif


Expand Down Expand Up @@ -801,7 +802,6 @@ endif
KBUILD_CFLAGS += $(stackp-flag)

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

0 comments on commit fd36bbb

Please sign in to comment.