Skip to content

Commit

Permalink
fix clang issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mirostauder committed Jan 3, 2024
1 parent c41331a commit a5990ea
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ endif
STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPLUSPLUS) | cut -c3-4)


### handle clang issue https://bugs.llvm.org/show_bug.cgi?id=16404
CLANGFIX :=
ifeq ($(CXX),clang++)
CLANG_VERSION := $(shell clang -dumpversion | tr '.' ' ' | awk '{ printf("%04d.%04d.%04d", $$1, $$2, $$3) }')
CLANG_MIN_VER := $(shell echo 14.0 | tr '.' ' ' | awk '{ printf("%04d.%04d.%04d", $$1, $$2, $$3) }')
ifneq ($(CLANG_MIN_VER),$(firstword $(sort $(CLANG_VERSION) $(CLANG_MIN_VER))))
CLANGFIX := --rtlib=compiler-rt --unwindlib=libgcc
endif
endif

PSQLCH :=
ifeq ($(PROXYSQLCLICKHOUSE),1)
PSQLCH := -DPROXYSQLCLICKHOUSE
Expand Down Expand Up @@ -199,9 +209,9 @@ $(ODIR)/%.o: %.cpp

$(EXECUTABLE): $(ODIR) $(OBJ) $(LIBPROXYSQLAR)
ifeq ($(PROXYSQLCLICKHOUSE),1)
$(CXX) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(CLICKHOUSE_CPP_LDIR)/libclickhouse-cpp-lib-static.a $(LZ4_LDIR)/liblz4.a $(MYCXXFLAGS) $(CXXFLAGS) $(LDIRS) $(LIBS) $(MYLIBS)
$(CXX) -o $@ $(OBJ) $(CLANGFIX) $(LIBPROXYSQLAR) $(CLICKHOUSE_CPP_LDIR)/libclickhouse-cpp-lib-static.a $(LZ4_LDIR)/liblz4.a $(MYCXXFLAGS) $(CXXFLAGS) $(LDIRS) $(LIBS) $(MYLIBS)
else
$(CXX) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(MYCXXFLAGS) $(CXXFLAGS) $(LDIRS) $(LIBS) $(MYLIBS)
$(CXX) -o $@ $(OBJ) $(CLANGFIX) $(LIBPROXYSQLAR) $(MYCXXFLAGS) $(CXXFLAGS) $(LDIRS) $(LIBS) $(MYLIBS)
endif
ifeq ($(UNAME_S),Darwin)
shasum $(EXECUTABLE) > $(EXECUTABLE).sha1
Expand Down

0 comments on commit a5990ea

Please sign in to comment.