mbox series

[0/2] poewrpc/Boot: Fix cross compiling with clang

Message ID 20181104231133.30848-1-joel@jms.id.au
Headers show
Series poewrpc/Boot: Fix cross compiling with clang | expand

Message

Joel Stanley Nov. 4, 2018, 11:11 p.m. UTC
Hello,

These patches allow clang to cross-compile the powerpc boot wrapper.
The boot wrapper constructs it's own compiler flags as it may not be
built for the same arch as the kernel.

The powerpc64le kernel builds natively with clang and with this patch it
can cross compile too.

Joel Stanley (2):
  Makefile: Export clang toolchain variables
  powerpc/boot: Set target when cross-compiling for clang

 Makefile                   | 3 +++
 arch/powerpc/boot/Makefile | 7 +++++++
 2 files changed, 10 insertions(+)

-- 
2.19.1

Comments

Nick Desaulniers Nov. 5, 2018, 10:37 p.m. UTC | #1
On Sun, Nov 4, 2018 at 3:11 PM Joel Stanley <joel@jms.id.au> wrote:
>

> Hello,

>

> These patches allow clang to cross-compile the powerpc boot wrapper.

> The boot wrapper constructs it's own compiler flags as it may not be

> built for the same arch as the kernel.


Hi Joel, thanks for the series!  I'm just curious, how does the boot
wrapper run on a different arch than the kernel?

>

> The powerpc64le kernel builds natively with clang and with this patch it

> can cross compile too.

>

> Joel Stanley (2):

>   Makefile: Export clang toolchain variables

>   powerpc/boot: Set target when cross-compiling for clang

>

>  Makefile                   | 3 +++

>  arch/powerpc/boot/Makefile | 7 +++++++

>  2 files changed, 10 insertions(+)

>

> --

> 2.19.1

>



-- 
Thanks,
~Nick Desaulniers
Joel Stanley Nov. 6, 2018, 12:36 a.m. UTC | #2
On Tue, 6 Nov 2018 at 09:07, Nick Desaulniers <ndesaulniers@google.com> wrote:
>

> On Sun, Nov 4, 2018 at 3:11 PM Joel Stanley <joel@jms.id.au> wrote:

> >

> > Hello,

> >

> > These patches allow clang to cross-compile the powerpc boot wrapper.

> > The boot wrapper constructs it's own compiler flags as it may not be

> > built for the same arch as the kernel.

>

> Hi Joel, thanks for the series!  I'm just curious, how does the boot

> wrapper run on a different arch than the kernel?


The kernel can have a ppc32 boot wrapper for a ppc64 kernel. There's
some rationale in the boot wrapper's Makefile:

 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/boot/Makefile#n10

Cheers,

Joel