Index: tools/llvm-config/BuildVariables.inc.in =================================================================== --- tools/llvm-config/BuildVariables.inc.in +++ tools/llvm-config/BuildVariables.inc.in @@ -34,3 +34,4 @@ #define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@" #define LLVM_DYLIB_VERSION "@LLVM_DYLIB_VERSION@" #define LLVM_HAS_GLOBAL_ISEL "@LLVM_HAS_GLOBAL_ISEL@" +#define LLVM_DEFAULT_SYSROOT "@LLVM_DEFAULT_SYSROOT@" Index: tools/llvm-config/CMakeLists.txt =================================================================== --- tools/llvm-config/CMakeLists.txt +++ tools/llvm-config/CMakeLists.txt @@ -53,6 +53,7 @@ set(LLVM_ENABLE_SHARED OFF) endif() string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}") +set(LLVM_DEFAULT_SYSROOT ${DEFAULT_SYSROOT}) configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY) # Set build-time environment(s). Index: tools/llvm-config/llvm-config.cpp =================================================================== --- tools/llvm-config/llvm-config.cpp +++ tools/llvm-config/llvm-config.cpp @@ -207,6 +207,7 @@ --components List of all possible components.\n\ --targets-built List of all targets currently built.\n\ --host-target Target triple used to configure LLVM.\n\ + --default-sysroot Print the default sysroot.\n\ --build-mode Print build mode of LLVM tree (e.g. Debug or Release).\n\ --assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\ --build-system Print the build system used to build LLVM (always cmake).\n\ @@ -519,6 +520,8 @@ OS << '\n'; } else if (Arg == "--targets-built") { OS << LLVM_TARGETS_BUILT << '\n'; + } else if (Arg == "--default-sysroot") { + OS << LLVM_DEFAULT_SYSROOT << '\n'; } else if (Arg == "--host-target") { OS << Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE) << '\n'; } else if (Arg == "--build-mode") {