Index: Makefile.config.in =================================================================== --- Makefile.config.in +++ Makefile.config.in @@ -58,6 +58,10 @@ PROJ_SRC_ROOT := $(LLVM_SRC_ROOT) PROJ_SRC_DIR := $(LLVM_SRC_ROOT)$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)) +ifeq ($(LLVM_SRC_ROOT), $(LLVM_OBJ_ROOT)) +$(error In-source builds are discouraged. Configure from a separate build directory) +endif + ifneq ($(CLANG_SRC_ROOT),) CLANG_SRC_ROOT:= $(call realpath, $(CLANG_SRC_ROOT)) PROJ_SRC_DIR := $(patsubst $(LLVM_SRC_ROOT)/tools/clang%,$(CLANG_SRC_ROOT)%,$(PROJ_SRC_DIR))