Skip to content

Commit

Permalink
Remove MSVC and ICC stuff in the build system (#42586)
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralBShah authored Oct 14, 2021
1 parent 4c222c9 commit b1b0a3c
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 109 deletions.
62 changes: 2 additions & 60 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1311,18 +1263,13 @@ 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
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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions deps/dsfmt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions deps/libuv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions deps/tools/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,10 +85,6 @@ endif

RT_LLVM_LIBS := support

ifeq ($(USEMSVC), 1)
SRCS += getopt
endif

SRCS += $(RUNTIME_SRCS)

CODEGEN_SRCS += $(RUNTIME_CODEGEN_SRCS)
Expand Down Expand Up @@ -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 $@ \
Expand Down
8 changes: 0 additions & 8 deletions src/flisp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -130,9 +124,7 @@ endif
endif

test:
ifneq ($(USEMSVC), 1)
$(call spawn,./$(EXENAME)$(EXE)) unittest.lsp
endif

clean:
rm -f $(BUILDDIR)/*.o
Expand Down
14 changes: 0 additions & 14 deletions src/support/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@ else ifeq ($(ARCH),x86_64)
SRCS += _setjmp.win64
endif
endif
ifeq ($(USEMSVC), 1)
SRCS += dirname
endif

HEADERS := $(wildcard *.h) $(LIBUV_INC)/uv.h

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)
Expand All @@ -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
Expand Down

0 comments on commit b1b0a3c

Please sign in to comment.