Skip to content

Commit

Permalink
powerpc/boot: Set target when cross-compiling for clang
Browse files Browse the repository at this point in the history
Source: Kernel.org
MR: 96580
Type: Security Fix
Disposition: Backport from git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable linux-4.14.y
ChangeID: d75c8c0afd357e66b55b4548919bb6d5a5a8e8fb
Description:

commit 813af51f5d30a2da6a2523c08465f9726e51772e upstream.

Clang needs to be told which target it is building for when cross
compiling.

Link: ClangBuiltLinux/linux#259
Signed-off-by: Joel Stanley <joel@jms.id.au>
Tested-by: Daniel Axtens <dja@axtens.net> # powerpc 64-bit BE
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[nc: Use 'ifeq ($(cc-name),clang)' instead of 'ifdef CONFIG_CC_IS_CLANG'
     because that config does not exist in 4.14; the Kconfig rewrite
     that added that config happened in 4.18]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster@mvista.com>
  • Loading branch information
shenki authored and mvakuster committed Feb 1, 2019
1 parent 9e7aac2 commit c6b84c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/powerpc/boot/Makefile
Expand Up @@ -49,6 +49,11 @@ endif

BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc

ifeq ($(cc-name),clang)
BOOTCFLAGS += $(CLANG_FLAGS)
BOOTAFLAGS += $(CLANG_FLAGS)
endif

ifdef CONFIG_DEBUG_INFO
BOOTCFLAGS += -g
endif
Expand Down

0 comments on commit c6b84c4

Please sign in to comment.