[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKwvOdmFPLAv_FucACe9LQC49gm2WCgXUBKkhWy4pONt29njWQ@mail.gmail.com>
Date: Fri, 30 Jul 2021 14:58:35 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>,
Fangrui Song <maskray@...gle.com>,
Michal Marek <michal.lkml@...kovi.net>,
Arnd Bergmann <arnd@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Christoph Hellwig <hch@...radead.org>,
Nathan Chancellor <nathan@...nel.org>
Subject: Re: [PATCH v4 1/2] Makefile: infer --target from ARCH for CC=clang
On Fri, Jul 30, 2021 at 2:54 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> On Fri, Jul 30, 2021 at 1:17 PM Nick Desaulniers
> <ndesaulniers@...gle.com> wrote:
> >
> > +ifeq ($(SRCARCH),arm)
> > +CLANG_FLAGS += --target=arm-linux-gnueabi
> ..,.
>
> Ugh.
>
> A wise man once said: "All problems in computer science can be solved
> with another level of indirection".
>
> Just do it like this:
>
> CLANG_TARGET_FLAGS_arm = arm-linux-gnueabi
> CLANG_TARGET_FLAGS_hexagon = hexagon-linux-gnu
> ..
> CLANG_TARGET_FLAGS = $(CLANG_TARGET_FLAGS_$(ARCH))
>
> Which is a lot denser and simpler.
>
> And then the only if-statement can be something along the lines of
>
> ifeq ($(CLANG_TARGET_FLAGS),)
> $(error Specify clang target flags)
> else
> CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS)
> endif
D'oh, just sent v5 before seeing this. SGTM will work on v6.
>
> Plus add *random handwaving* about all the details for CROSS_COMPILE
> and friends.
>
> Linus
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists