[all-commits] [llvm/llvm-project] 096477: gn build: Use target OS to control whether to use/...

pcc via All-commits all-commits at lists.llvm.org
Wed Apr 6 13:49:44 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 096477e25e440ca923703750c628c862cd2a876c
      https://github.com/llvm/llvm-project/commit/096477e25e440ca923703750c628c862cd2a876c
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2022-04-06 (Wed, 06 Apr 2022)

  Changed paths:
    M llvm/utils/gn/build/toolchain/BUILD.gn

  Log Message:
  -----------
  gn build: Use target OS to control whether to use/depend on llvm-ar.

When cross-compiling from Mac to non-Mac, we need to use the just-built
llvm-ar instead of libtool. We're currently doing the right thing
when determining which archiver command to use, but the path to ar
and the toolchain dependencies were being set based on the host OS
(current_os evaluated in host OS toolchain), instead of the target
OS. Fix the problem by looking up current_os inside toolchain_args.

Differential Revision: https://reviews.llvm.org/D123244


  Commit: 02a7b1754f76b6ecd3930aabc618f9209ac20dd0
      https://github.com/llvm/llvm-project/commit/02a7b1754f76b6ecd3930aabc618f9209ac20dd0
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2022-04-06 (Wed, 06 Apr 2022)

  Changed paths:
    M llvm/utils/gn/build/toolchain/BUILD.gn
    M llvm/utils/gn/build/toolchain/target_flags.gni
    M llvm/utils/gn/secondary/compiler-rt/BUILD.gn
    M llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
    M llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
    M llvm/utils/gn/secondary/compiler-rt/target.gni
    M llvm/utils/gn/secondary/llvm/triples.gni

  Log Message:
  -----------
  Reland "gn build: Fix support for building the builtins for baremetal."

Our support for building for baremetal was conditional on a default
off arg and would have failed to build if you had somehow arranged
to pass the correct --target flag; presumably nobody noticed because
nobody was turning it on. A better approach is to model baremetal
as a separate "OS" called "baremetal" and build it in the same way
as we cross-compile for other targets. That's what this patch does.
I only hooked up the arm64 target but others can be added.

Relanding after fixing Mac build breakage in D123244.

Differential Revision: https://reviews.llvm.org/D122862


Compare: https://github.com/llvm/llvm-project/compare/6795f37c1481...02a7b1754f76


More information about the All-commits mailing list