HomePhabricator

Provide default location of sysroot for Baremetal toolchain.

Authored by abidh on Dec 7 2020, 1:09 AM.

Description

Provide default location of sysroot for Baremetal toolchain.

Currently, Baremetal toolchain requires user to pass a sysroot location
using a --sysroot flag. This is not very convenient for the user. It also
creates problem for toolchain vendors who don't have a fixed location to
put the sysroot bits.

Clang does provide 'DEFAULT_SYSROOT' which can be used by the toolchain
builder to provide the default location. But it does not work if toolchain
is targeting multiple targets e.g. arm-none-eabi/riscv64-unknown-elf which
clang is capable of doing.

This patch tries to solve this problem by providing a default location of
the toolchain if user does not explicitly provides --sysroot. The exact
location and name can be different but it should fulfill these conditions:

  1. The sysroot path should have a target triple element so that multi-target

toolchain problem (as I described above) could be addressed.

  1. The location should not be $TOP/$Triple as this is used by gcc generally

and will be a problem for installing both gcc and clang based toolchain at
the same location.

Reviewed By: jroelofs

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

Details

Committed
abidhDec 7 2020, 1:19 AM
Reviewer
jroelofs
Differential Revision
D92677: Provide default location of sysroot for Baremetal toolchain.
Parents
rG7d04e70627aa: [Lit] Fix flaky test on heavily loaded bots
Branches
Unknown
Tags
Unknown