Reland "gn build: Fix support for building the builtins for baremetal."
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 1 Apr 2022 03:34:05 +0000 (20:34 -0700)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 6 Apr 2022 20:45:40 +0000 (13:45 -0700)
commit02a7b1754f76b6ecd3930aabc618f9209ac20dd0
tree79958aa293efe66a7b58966dbde712f0feb2c559
parent096477e25e440ca923703750c628c862cd2a876c
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
llvm/utils/gn/build/toolchain/BUILD.gn
llvm/utils/gn/build/toolchain/target_flags.gni
llvm/utils/gn/secondary/compiler-rt/BUILD.gn
llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
llvm/utils/gn/secondary/compiler-rt/target.gni
llvm/utils/gn/secondary/llvm/triples.gni