[all-commits] [llvm/llvm-project] 1682c9: [Clang][Driver] Support relative paths for CLANG_C...

Carlo Cabrera via All-commits all-commits at lists.llvm.org
Thu Oct 3 23:10:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1682c99a8877364f1d847395cef501e813804caa
      https://github.com/llvm/llvm-project/commit/1682c99a8877364f1d847395cef501e813804caa
  Author: Carlo Cabrera <github at carlo.cab>
  Date:   2024-10-03 (Thu, 03 Oct 2024)

  Changed paths:
    M clang/lib/Driver/Driver.cpp

  Log Message:
  -----------
  [Clang][Driver] Support relative paths for CLANG_CONFIG_FILE_SYSTEM_DIR (#110962)

Shipping a system configuration file for Clang is useful, but it limits
the relocatability of the toolchain because it bakes in a reference to
an absolute path on the file system.

Let's fix that by allowing for `CLANG_CONFIG_FILE_SYSTEM_DIR` to be set
to a relative path, and then interpreting that relative to the location
of the driver if applicable.

This would be useful for the LLVM package we ship at Homebrew. We
currently have to bake in a `DEFAULT_SYSROOT` in order to ship a
toolchain that works out of the box on macOS. If
`CLANG_CONFIG_FILE_SYSTEM_DIR` supported relative paths, we could
replace that with a configuration file which would be easier to update
when the compiled-in `DEFAULT_SYSROOT` becomes stale (e.g. on macOS
version upgrades).

We could, of course, set `CLANG_CONFIG_FILE_SYSTEM_DIR` to an absolute
path to begin with. However, we do have users who install Homebrew into
a prefix that is different from the one used on our buildbots, so doing
this would result in a broken toolchain for those users.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list