[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQ0tdK+BEzs=39A4XbCXjAsbyyFp6fgXfhjP+5v_Nsddw@mail.gmail.com>
Date: Wed, 10 Mar 2021 04:58:39 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH 2/2] Makefile: Only specify '--prefix=' when building with
clang + GNU as
On Wed, Mar 10, 2021 at 4:55 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> On Wed, Mar 3, 2021 at 6:07 AM Nathan Chancellor <nathan@...nel.org> wrote:
> >
> > When building with LLVM_IAS=1, there is no point to specifying
> > '--prefix=' because that flag is only used to find the cross assembler,
> > which is clang itself when building with LLVM_IAS=1. All of the other
> > tools are invoked directly from PATH or a full path specified via the
> > command line, which does not depend on the value of '--prefix='.
> >
> > Sharing commands to reproduce issues becomes a little bit easier without
> > a '--prefix=' value because that '--prefix=' value is specific to a
> > user's machine due to it being an absolute path.
> >
> > Signed-off-by: Nathan Chancellor <nathan@...nel.org>
>
>
> I was tricked by a couple of Reviewed-by/Tested-by tags.
>
> With this patch applied, the code looks as follows:
>
>
> ifneq ($(CROSS_COMPILE),)
> CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
> ifneq ($(LLVM_IAS),1)
> GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
> CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
> CLANG_FLAGS += -no-integrated-as
> endif
> endif
>
>
> For the native build (empty CROSS_COMPILE),
> you cannot add -no-integrated-as.
>
>
> I dropped this from my tree.
>
>
>
> Is the correct code as follows?
>
>
> ifneq ($(LLVM_IAS),1)
> CLANG_FLAGS += -no-integrated-as
> ifneq ($(CROSS_COMPILE),)
> CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
> GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
> CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
> endif
> endif
>
>
>
>
If you send v2, can you include comments from Fangrui Song?
Fangrui Song:
clang can spawn GNU as (if -f?no-integrated-as is specified) and GNU
objcopy (-f?no-integrated-as and -gsplit-dwarf and -g[123]).
objcopy is only used for GNU as assembled object files.
With integrated assembler, the object file streamer creates .o and
.dwo simultaneously.
With GNU as, two objcopy commands are needed to extract .debug*.dwo to
.dwo files && another command to remove .debug*.dwo sections.
I did not know the objtool part, and I think it is worth recording.
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists