[all-commits] [llvm/llvm-project] 275592: Provide default location of sysroot for Baremetal ...

llvmbot via All-commits all-commits at lists.llvm.org
Mon Dec 7 01:32:41 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 275592e714130345a481a5cb889c89b73a98614f
      https://github.com/llvm/llvm-project/commit/275592e714130345a481a5cb889c89b73a98614f
  Author: Hafiz Abid Qadeer <abidh at codesourcery.com>
  Date:   2020-12-07 (Mon, 07 Dec 2020)

  Changed paths:
    M clang/lib/Driver/ToolChains/BareMetal.cpp
    M clang/lib/Driver/ToolChains/BareMetal.h
    A clang/test/Driver/baremetal-sysroot.cpp

  Log Message:
  -----------
  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.

2. 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




More information about the All-commits mailing list