]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Makefile: Only specify '--prefix=' when building with clang + GNU as
authorNathan Chancellor <nathan@kernel.org>
Tue, 9 Mar 2021 20:59:15 +0000 (13:59 -0700)
committerMasahiro Yamada <masahiroy@kernel.org>
Tue, 16 Mar 2021 15:37:53 +0000 (00:37 +0900)
commit71eb5c859a5914e14a2223d053f3e545811e741c
tree7d6d57562cce30d4d9d0a1b3a6fe8c7787088714
parent9fc2872b700a35208c485ac01411a633475a7145
Makefile: Only specify '--prefix=' when building with clang + GNU as

When building with LLVM_IAS=1, there is no point to specifying
'--prefix=' because that flag is only used to find GNU cross tools,
which will not be used indirectly when using the integrated assembler.
All of the 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.

Some further notes from 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.

A small consequence of this change (to keep things simple) is that
'--prefix=' will always be specified now, even with a native build, when
it was not before. This should not be an issue due to the way that the
Makefile searches for the prefix (based on elfedit's location). This
ends up improving the experience for host builds because PATH is better
respected and matches GCC's behavior more closely. See the below thread
for more details:

https://lore.kernel.org/r/20210205213651.GA16907@Ryzen-5-4500U.localdomain/

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile