On Thu, Aug 15, 2024 at 2:54 PM Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: > > On Thu, 2024-08-15 at 14:17 -0700, Andrii Nakryiko wrote: > > [...] > > > > @@ -164,6 +176,31 @@ endef > > > > > > include ../lib.mk > > > > > > +NON_CHECK_FEAT_TARGETS := clean docs-clean > > > +CHECK_FEAT := $(filter-out $(NON_CHECK_FEAT_TARGETS),$(or $(MAKECMDGOALS), "none")) > > > +ifneq ($(CHECK_FEAT),) > > > +FEATURE_USER := .selftests > > > +FEATURE_TESTS := llvm > > > +FEATURE_DISPLAY := $(FEATURE_TESTS) > > > + > > > +# Makefile.feature expects OUTPUT to end with a slash > > > +$(let OUTPUT,$(OUTPUT)/,\ > > > + $(eval include ../../../build/Makefile.feature)) > > > +endif > > > + > > > +ifeq ($(feature-llvm),1) > > > + LLVM_CFLAGS += -DHAVE_LLVM_SUPPORT > > > + LLVM_CONFIG_LIB_COMPONENTS := mcdisassembler all-targets > > > + # both llvm-config and lib.mk add -D_GNU_SOURCE, which ends up as conflict > > > + LLVM_CFLAGS += $(filter-out -D_GNU_SOURCE,$(shell $(LLVM_CONFIG) --cflags)) > > > + LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS)) > > > + ifeq ($(shell $(LLVM_CONFIG) --shared-mode),static) > > > + LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --system-libs $(LLVM_CONFIG_LIB_COMPONENTS)) > > > + LLVM_LDLIBS += -lstdc++ > > > + endif > > > + LLVM_LDFLAGS += $(shell $(LLVM_CONFIG) --ldflags) > > > +endif > > > + > > > > Seems like we raced between me commenting on v1 and you posting v2 :( > > Yes, I should have waited a bit more, sorry. > no worries > > But I just noticed that formatting seems off here. Can you please > > check space vs tabs issues? > > For the block above the lines are indented using two spaces and four spaces. > This is not a rule body, so should not be a problem afaik. > What's not working on your side? > oh, it's just for consistency with the rest of Makefile. We use tabs for indentation, so let's stay consistent. > > > SCRATCH_DIR := $(OUTPUT)/tools > > > BUILD_DIR := $(SCRATCH_DIR)/build > > > INCLUDE_DIR := $(SCRATCH_DIR)/include > > [...] >