From b1b0a3c3e39bcc8700da162a8590247006067033 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Thu, 14 Oct 2021 16:04:40 -0400 Subject: [PATCH] Remove MSVC and ICC stuff in the build system (#42586) --- Make.inc | 62 ++------------------------------------------ cli/Makefile | 2 -- deps/dsfmt.mk | 4 --- deps/libuv.mk | 9 ------- deps/tools/common.mk | 2 -- src/Makefile | 10 ------- src/flisp/Makefile | 8 ------ src/support/Makefile | 14 ---------- 8 files changed, 2 insertions(+), 109 deletions(-) diff --git a/Make.inc b/Make.inc index 5018b8ac03e31..c7ea30ebdb759 100644 --- a/Make.inc +++ b/Make.inc @@ -448,32 +448,14 @@ endif # Compiler specific stuff -ifeq ($(USEMSVC), 1) -USEGCC := 0 -USECLANG := 0 -USEICC := 0 -else -USEMSVC := 0 ifeq ($(USECLANG), 1) USEGCC := 0 -USEICC := 0 -else -ifeq ($(USEICC), 1) -USEGCC := 0 -USECLANG := 0 else # default to gcc USEGCC := 1 USECLANG := 0 -USEICC := 0 -endif -endif endif -ifeq ($(USEIFC), 1) -FC := ifort -else FC := $(CROSS_COMPILE)gfortran -endif ifeq ($(OS), FreeBSD) USEGCC := 0 @@ -529,19 +511,6 @@ JCPPFLAGS += -D_LARGEFILE_SOURCE -D_DARWIN_USE_64_BIT_INODE=1 endif endif -ifeq ($(USEICC),1) -ifeq ($(SANITIZE),1) -$(error Sanitizers only supported with clang. Try setting SANITIZE=0) -endif -CC := icc -CXX := icpc -JCFLAGS := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -fp-model precise -fp-model except -no-ftz -JCPPFLAGS := -JCXXFLAGS := -pipe $(fPIC) -fno-rtti -std=c++14 -DEBUGFLAGS := -O0 -g -DJL_DEBUG_BUILD -fstack-protector -SHIPFLAGS := -O3 -g -falign-functions -endif - ifeq ($(USECCACHE), 1) # Expand CC, CXX and FC here already because we want the original definition and not the ccache version. CC_ARG := $(CC) @@ -577,29 +546,14 @@ FC_ARG := $(shell echo $(FC) | cut -s -d' ' -f2-) endif JFFLAGS := -O2 $(fPIC) -ifneq ($(USEMSVC),1) CPP := $(CC) -E AR := $(CROSS_COMPILE)ar AS := $(CROSS_COMPILE)as LD := $(CROSS_COMPILE)ld -else #USEMSVC -CPP := $(CC) -EP -AR := lib -ifeq ($(ARCH),x86_64) -AS := ml64 -else -AS := ml -endif #ARCH -LD := link -endif #USEMSVC RANLIB := $(CROSS_COMPILE)ranlib OBJCOPY := $(CROSS_COMPILE)objcopy -ifneq ($(USEMSVC), 1) CPP_STDOUT := $(CPP) -P -else -CPP_STDOUT := $(CPP) -E -endif # file extensions ifeq ($(OS), WINNT) @@ -634,7 +588,7 @@ define SONAME_FLAGS endef endif -ifeq ($(OS)$(USEMSVC),WINNT0) +ifeq ($(OS),WINNT) define IMPLIB_FLAGS -Wl,--out-implib,$(build_libdir)/$(notdir $1).a endef @@ -985,7 +939,6 @@ JCXXFLAGS += -D_FILE_OFFSET_BITS=64 endif # Set some ARCH-specific flags -ifneq ($(USEICC),1) ifeq ($(ISX86),1) CC += -m$(BINARY) CXX += -m$(BINARY) @@ -994,7 +947,6 @@ CC_ARG += -m$(BINARY) CXX_ARG += -m$(BINARY) FC_ARG += -m$(BINARY) endif -endif ifeq ($(OS),WINNT) ifneq ($(ARCH),x86_64) @@ -1256,7 +1208,7 @@ endif ifeq ($(OS), Darwin) WHOLE_ARCHIVE := -Xlinker -all_load NO_WHOLE_ARCHIVE := -else ifneq ($(USEMSVC), 1) +else WHOLE_ARCHIVE := -Wl,--whole-archive NO_WHOLE_ARCHIVE := -Wl,--no-whole-archive endif @@ -1311,7 +1263,6 @@ JLIBLDFLAGS := -Wl,-compatibility_version,$(SOMAJOR) -Wl,-current_version,$(JULI endif ifeq ($(OS), WINNT) -ifneq ($(USEMSVC), 1) HAVE_SSP := 1 OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \ $(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic @@ -1319,10 +1270,6 @@ JLDFLAGS := -Wl,--stack,8388608 ifeq ($(ARCH),i686) JLDFLAGS += -Wl,--large-address-aware endif -else #USEMSVC -OSLIBS += kernel32.lib ws2_32.lib psapi.lib advapi32.lib iphlpapi.lib shell32.lib winmm.lib userenv.lib secur32.lib -JLDFLAGS := -stack:8388608 -endif JCPPFLAGS += -D_WIN32_WINNT=0x0502 UNTRUSTED_SYSTEM_LIBM := 1 endif @@ -1383,11 +1330,6 @@ $(error BUILD_CUSTOM_LIBCXX is currently only supported with Clang. Try setting endif endif # Clang CUSTOM_LD_LIBRARY_PATH := LD_LIBRARY_PATH="$(build_libdir)" -ifeq ($(USEICC),1) -CXXFLAGS += -cxxlib-nostd -static-intel -CLDFLAGS += -static-intel -LDFLAGS += -cxxlib-nostd -static-intel -endif endif # Some special restrictions on BB usage: diff --git a/cli/Makefile b/cli/Makefile index d4a1b2472c24d..11855ee6244dc 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -65,7 +65,6 @@ $(DIRS): @mkdir -p $@ ifeq ($(OS),WINNT) -ifneq ($(USEMSVC), 1) $(BUILDDIR)/julia_res.o: $(JULIAHOME)/contrib/windows/julia.rc $(JULIAHOME)/VERSION JLVER=`cat $(JULIAHOME)/VERSION` && \ JLVERi=`echo $$JLVER | perl -nle \ @@ -75,7 +74,6 @@ $(BUILDDIR)/julia_res.o: $(JULIAHOME)/contrib/windows/julia.rc $(JULIAHOME)/VERS EXE_OBJS += $(BUILDDIR)/julia_res.o EXE_DOBJS += $(BUILDDIR)/julia_res.o endif -endif # Embed an Info.plist in the julia executable # Create an intermediate target Info.plist for Darwin code signing. diff --git a/deps/dsfmt.mk b/deps/dsfmt.mk index bf6062c2130f6..e22f1b51fe8f7 100644 --- a/deps/dsfmt.mk +++ b/deps/dsfmt.mk @@ -3,12 +3,8 @@ ifneq ($(USE_BINARYBUILDER_DSFMT),1) DSFMT_CFLAGS := $(CFLAGS) -DNDEBUG -DDSFMT_MEXP=19937 $(fPIC) -DDSFMT_DO_NOT_USE_OLD_NAMES -DDSFMT_SHLIB -ifneq ($(USEMSVC), 1) DSFMT_CFLAGS += -O3 -finline-functions -fomit-frame-pointer -fno-strict-aliasing \ --param max-inline-insns-single=1800 -Wall -std=c99 -shared -else -DSFMT_CFLAGS += -Wl,-dll,-def:../../libdSFMT.def -endif ifeq ($(ARCH), x86_64) DSFMT_CFLAGS += -msse2 -DHAVE_SSE2 endif diff --git a/deps/libuv.mk b/deps/libuv.mk index ff749fef38651..1fcdd63ff6963 100644 --- a/deps/libuv.mk +++ b/deps/libuv.mk @@ -5,20 +5,11 @@ LIBUV_TAR_URL=https://api.github.com/repos/JuliaLang/libuv/tarball/$1 $(eval $(call git-external,libuv,LIBUV,configure,,$(SRCCACHE))) UV_CFLAGS := -O2 -ifeq ($(USEMSVC), 1) -UV_CFLAGS += -DBUILDING_UV_SHARED -endif -ifeq ($(USEICC), 1) -UV_CFLAGS += -static-intel -endif UV_FLAGS := LDFLAGS="$(LDFLAGS) $(CLDFLAGS) -v" ifneq ($(UV_CFLAGS),) UV_FLAGS += CFLAGS="$(CFLAGS) $(UV_CFLAGS)" endif -ifeq ($(USEMSVC), 1) -UV_FLAGS += --disable-shared -endif ifneq ($(VERBOSE), 0) UV_MFLAGS += V=1 diff --git a/deps/tools/common.mk b/deps/tools/common.mk index aacae86139ee6..96893a455c06b 100644 --- a/deps/tools/common.mk +++ b/deps/tools/common.mk @@ -9,9 +9,7 @@ ifneq ($(XC_HOST),) CONFIGURE_COMMON += --host=$(XC_HOST) endif ifeq ($(OS),WINNT) -ifneq ($(USEMSVC), 1) CONFIGURE_COMMON += LDFLAGS="$(LDFLAGS) -Wl,--stack,8388608" -endif else CONFIGURE_COMMON += LDFLAGS="$(LDFLAGS) $(RPATH_ESCAPED_ORIGIN)" endif diff --git a/src/Makefile b/src/Makefile index 05fd2b77fd97a..11bc210191bda 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,14 +19,12 @@ FLAGS := \ -I$(SRCDIR)/flisp -I$(SRCDIR)/support \ -I$(LIBUV_INC) -I$(build_includedir) \ -I$(JULIAHOME)/deps/valgrind -ifneq ($(USEMSVC), 1) FLAGS += -Wall -Wno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden -fno-common \ -Wno-comment -Wpointer-arith -Wundef ifeq ($(USEGCC),1) # GCC bug #25509 (void)__attribute__((warn_unused_result)) FLAGS += -Wno-unused-result endif JCFLAGS += -Wold-style-definition -Wstrict-prototypes -Wc++-compat -endif ifeq ($(USECLANG),1) FLAGS += -Wno-return-type-c-linkage @@ -87,10 +85,6 @@ endif RT_LLVM_LIBS := support -ifeq ($(USEMSVC), 1) -SRCS += getopt -endif - SRCS += $(RUNTIME_SRCS) CODEGEN_SRCS += $(RUNTIME_CODEGEN_SRCS) @@ -345,11 +339,7 @@ $(BUILDDIR)/julia_version.h: $(JULIAHOME)/VERSION @echo "#endif" >> $@.$(JULIA_BUILD_MODE).tmp mv $@.$(JULIA_BUILD_MODE).tmp $@ -ifneq ($(USEMSVC), 1) CXXLD = $(CXX) -shared -else -CXXLD = $(LD) -dll -export:jl_setjmp -export:jl_longjmp -endif $(build_shlibdir)/libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT): $(SRCDIR)/julia.expmap $(OBJS) $(BUILDDIR)/flisp/libflisp.a $(BUILDDIR)/support/libsupport.a $(LIBUV) @$(call PRINT_LINK, $(CXXLD) $(call IMPLIB_FLAGS,$@) $(JCXXFLAGS) $(CXXLDFLAGS) $(SHIPFLAGS) $(OBJS) $(RPATH_LIB) -o $@ \ diff --git a/src/flisp/Makefile b/src/flisp/Makefile index 50566a0258386..4d15591389d74 100644 --- a/src/flisp/Makefile +++ b/src/flisp/Makefile @@ -50,13 +50,11 @@ endif FLAGS := -I$(LLTSRCDIR) $(JCFLAGS) $(HFILEDIRS:%=-I%) \ -I$(LIBUV_INC) -I$(UTF8PROC_INC) -I$(build_includedir) $(LIBDIRS:%=-L%) \ -DLIBRARY_EXPORTS -DUTF8PROC_EXPORTS -ifneq ($(USEMSVC), 1) ifneq ($(OS), emscripten) FLAGS += -DUSE_COMPUTED_GOTO endif FLAGS += -Wall -Wno-strict-aliasing -fvisibility=hidden -Wpointer-arith -Wundef FLAGS += -Wold-style-definition -Wstrict-prototypes -Wc++-compat -endif DEBUGFLAGS += $(FLAGS) SHIPFLAGS += $(FLAGS) @@ -95,11 +93,7 @@ $(BUILDDIR)/$(LIBTARGET).a: $(OBJS) | $(BUILDDIR) rm -rf $@ @$(call PRINT_LINK, $(AR) -rcs $@ $(OBJS)) -ifneq ($(USEMSVC), 1) CCLD := $(CC) -else -CCLD := $(LD) -endif $(BUILDDIR)/$(EXENAME)-debug$(EXE): $(DOBJS) $(LIBFILES_debug) $(BUILDDIR)/$(LIBTARGET)-debug.a $(BUILDDIR)/flmain.dbg.obj | $(BUILDDIR)/flisp.boot @$(call PRINT_LINK, $(CCLD) $(DEBUGFLAGS) $(JLDFLAGS) $(DOBJS) $(BUILDDIR)/flmain.dbg.obj -o $@ $(BUILDDIR)/$(LIBTARGET)-debug.a $(LIBFILES_debug) $(LIBS) $(OSLIBS)) @@ -130,9 +124,7 @@ endif endif test: -ifneq ($(USEMSVC), 1) $(call spawn,./$(EXENAME)$(EXE)) unittest.lsp -endif clean: rm -f $(BUILDDIR)/*.o diff --git a/src/support/Makefile b/src/support/Makefile index f123d26886ff7..6083823e95408 100644 --- a/src/support/Makefile +++ b/src/support/Makefile @@ -18,9 +18,6 @@ else ifeq ($(ARCH),x86_64) SRCS += _setjmp.win64 endif endif -ifeq ($(USEMSVC), 1) -SRCS += dirname -endif HEADERS := $(wildcard *.h) $(LIBUV_INC)/uv.h @@ -28,10 +25,8 @@ OBJS := $(SRCS:%=$(BUILDDIR)/%.o) DOBJS := $(SRCS:%=$(BUILDDIR)/%.dbg.obj) FLAGS := $(HFILEDIRS:%=-I%) -I$(LIBUV_INC) -I$(UTF8PROC_INC) -DLIBRARY_EXPORTS -DUTF8PROC_EXPORTS -ifneq ($(USEMSVC), 1) FLAGS += -Wall -Wno-strict-aliasing -fvisibility=hidden -Wpointer-arith -Wundef JCFLAGS += -Wold-style-definition -Wstrict-prototypes -Wc++-compat -endif DEBUGFLAGS += $(FLAGS) SHIPFLAGS += $(FLAGS) @@ -45,19 +40,10 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.c $(HEADERS) | $(BUILDDIR) @$(call PRINT_CC, $(CC) $(JCPPFLAGS) $(JCFLAGS) $(SHIPFLAGS) $(DISABLE_ASSERTIONS) -c $< -o $@) $(BUILDDIR)/%.dbg.obj: $(SRCDIR)/%.c $(HEADERS) | $(BUILDDIR) @$(call PRINT_CC, $(CC) $(JCPPFLAGS) $(JCFLAGS) $(DEBUGFLAGS) -c $< -o $@) -ifneq ($(USEMSVC), 1) $(BUILDDIR)/%.o: $(SRCDIR)/%.S | $(BUILDDIR) @$(call PRINT_CC, $(CC) $(JCPPFLAGS) $(SHIPFLAGS) -c $< -o $@) $(BUILDDIR)/%.dbg.obj: $(SRCDIR)/%.S | $(BUILDDIR) @$(call PRINT_CC, $(CC) $(JCPPFLAGS) $(DEBUGFLAGS) -c $< -o $@) -else -$(BUILDDIR)/%.o: $(SRCDIR)/%.S | $(BUILDDIR) - @$(call PRINT_CC, $(CPP) -P $(JCPPFLAGS) $(SHIPFLAGS) $<) - @$(call PRINT_CC, $(AS) $(JCPPFLAGS) $(SHIPFLAGS) -Fo $@ -c $*.i) -$(BUILDDIR)/%.dbg.obj: $(SRCDIR)/%.S | $(BUILDDIR) - @$(call PRINT_CC, $(CPP) -P $(JCPPFLAGS) $(DEBUGFLAGS) $<) - @$(call PRINT_CC, $(AS) $(JCPPFLAGS) $(DEBUGFLAGS) -Fo $@ -c $*.i) -endif $(BUILDDIR)/host/Makefile: mkdir -p $(BUILDDIR)/host