[llvm] 7d92609 - [gn/mac] Fix isysroot flag when building compiler-rt

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 09:54:20 PDT 2024


Author: Nico Weber
Date: 2024-06-19T12:54:07-04:00
New Revision: 7d9260948f48ba2f3a9c4a3e4d5796cb91ea34f0

URL: https://github.com/llvm/llvm-project/commit/7d9260948f48ba2f3a9c4a3e4d5796cb91ea34f0
DIFF: https://github.com/llvm/llvm-project/commit/7d9260948f48ba2f3a9c4a3e4d5796cb91ea34f0.diff

LOG: [gn/mac] Fix isysroot flag when building compiler-rt

If the GN arg `sysroot` was set to a root-relative path like e.g.
`"//sysroot"`, we weren't rebasing it correctly, leading to
warnings from clang about it ignoring a non-existent sysroot.

Similar to 6073f87d7f160.

Added: 
    

Modified: 
    llvm/utils/gn/build/toolchain/target_flags.gni

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/build/toolchain/target_flags.gni b/llvm/utils/gn/build/toolchain/target_flags.gni
index 04d3d0fbcea2e..7a2a842afc1fb 100644
--- a/llvm/utils/gn/build/toolchain/target_flags.gni
+++ b/llvm/utils/gn/build/toolchain/target_flags.gni
@@ -44,7 +44,7 @@ if (current_os == "android") {
   if (current_os == "mac") {
     target_flags += [
       "-isysroot",
-      mac_sdk_path,
+      rebase_path(mac_sdk_path, root_build_dir),
       # TODO(lgrey): We should be getting this from `compiler_defaults`. Why
       # aren't we?
     "-mmacos-version-min=10.10",


        


More information about the llvm-commits mailing list