From 448bde1798f335c853740ede1fb52a9d4bd2841f Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Sat, 13 May 2023 21:34:18 +0200 Subject: [PATCH 01/19] split out msvc common settings --- configure/CONFIG.msvcCommon | 280 +++++++++++++++++++++++ configure/os/CONFIG.win32-x86.win32-x86 | 283 +----------------------- 2 files changed, 282 insertions(+), 281 deletions(-) create mode 100644 configure/CONFIG.msvcCommon diff --git a/configure/CONFIG.msvcCommon b/configure/CONFIG.msvcCommon new file mode 100644 index 000000000..ce5730d79 --- /dev/null +++ b/configure/CONFIG.msvcCommon @@ -0,0 +1,280 @@ +# MSVC/clang-cl compiler defaults + +CMPLR_CLASS = msvc + +OPT_WHOLE_PROGRAM = YES + +#------------------------------------------------------- + +WINLINK = link + +RCCMD = $(LLVM_PREFIX)rc$(LLVM_SUFFIX) -l 0x409 $(INCLUDES) -fo $@ $< + +ARCMD = $(LLVM_PREFIX)lib$(LLVM_SUFFIX) -nologo -verbose -out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS) + +# +# Configure OS vendor C compiler +CC = cl + +# OS vendor c preprocessor +CPP = $(CC) -nologo -C -E + +# Configure OS vendor C++ compiler +# +# -EHsc - generate code for exceptions +# -GR - generate code for run time type identification +# +CCC = $(CC) -EHsc -GR + +# Override CONFIG.gnuCommon settings for cross builds. +GNU = NO +HDEPENDS_METHOD = MKMF + +# Compiler flags for C files (C++ is below) + +# +# -W display warnings at level d +# -W4 is for maximum (lint type) warnings +# -W3 is for production quality warnings +# -W2 displays significant warnings +# -W1 is the default and shows severe warnings only +# -w Set warning C to be shown at level +WARN_CFLAGS_YES = -W3 +WARN_CFLAGS_NO = -W1 + +# +# -Ox maximum optimizations +# -GL whole program optimization +# -Oy- re-enable creation of frame pointers +OPT_CFLAGS_YES_YES = -Ox -GL -Oy- +OPT_CFLAGS_YES_NO = -Ox -Oy- +OPT_CFLAGS_YES = $(OPT_CFLAGS_YES_$(OPT_WHOLE_PROGRAM)) + +# +# -Z7 generate C7 compatible debugging information (inside .obj) +# -RTCsu enable run-time error checks +OPT_CFLAGS_NO = -Z7 -RTCsu + +# specify object file name and location +OBJ_CFLAG = -Fo + +# +# the following options are required when +# vis c++ compiles the code (and includes +# the header files) +# +# -MT static multithreaded C RTL +# -MTd static multithreaded C RTL (debug version) +# -MD multithreaded C RTL in DLL +# -MDd multithreaded C RTL in DLL (debug version) +BUILD_DLL_CFLAGS_NO = +BUILD_DLL_CFLAGS_YES = -DEPICS_BUILD_DLL +BUILD_DLL_CFLAGS = $(BUILD_DLL_CFLAGS_$(SHARED_LIBRARIES)) +VISC_CFLAGS_DEBUG_NO = d +VISC_CFLAGS_DEBUG_YES = +VISC_CFLAGS_DEBUG = $(VISC_CFLAGS_DEBUG_$(HOST_OPT)) +STATIC_CFLAGS_YES= -MT$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) +STATIC_CFLAGS_NO= -MD$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) -DEPICS_CALL_DLL + +# Other compiler flags, used for CPP, C and C++ +# +# -FC - Show absolute path of source file in diagnostics +# -D__STDC__=0 gives us both: +# 1) define STDC for code (pretend ANSI conformance) +# 2) set it to 0 to use MS C "extensions" (open for _open etc.) +# because MS uses: if __STDC__ ... disable many nice things +# +CODE_CPPFLAGS += -nologo -FC -D__STDC__=0 +CODE_CPPFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE + +# Compiler flags for C++ files + +# +# -W disable warnings from levels > n +# -w set warning m to level n +# -w44355 "'this' used in the base initializer list" +# -w44344 "behavior change: use of explicit template arguments results in ..." +# -w44251 "class needs to have dll-interface to be used by clients of ..." +WARN_CXXFLAGS_YES = -W3 -w44355 -w44344 -w44251 +WARN_CXXFLAGS_NO = -W1 + +# Silence tr1 namespace deprecation warnings +WARN_CXXFLAGS += -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING + +# +# -Ox maximum optimizations +# -GL whole program optimization +# -Oy- re-enable creation of frame pointers +OPT_CXXFLAGS_YES_YES = -Ox -GL -Oy- +OPT_CXXFLAGS_YES_NO = -Ox -Oy- +OPT_CXXFLAGS_YES = $(OPT_CXXFLAGS_YES_$(OPT_WHOLE_PROGRAM)) + +# +# -Z7 generate C7 compatible debugging information (inside .obj) +# -RTCsu enable run-time error checks +OPT_CXXFLAGS_NO = -RTCsu -Z7 + +# specify object file name and location +OBJ_CXXFLAG = -Fo + +# +# the following options are required when +# vis c++ compiles the code (and includes +# the header files) +# +# -MT static multithreaded C RTL +# -MTd static multithreaded C RTL (debug version) +# -MD multithreaded C RTL in DLL +# -MDd multithreaded C RTL in DLL (debug version) +STATIC_CXXFLAGS_YES= -MT$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) +STATIC_CXXFLAGS_NO= -MD$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) -DEPICS_CALL_DLL + +STATIC_LDLIBS_YES=ws2_32.lib advapi32.lib user32.lib kernel32.lib winmm.lib dbghelp.lib +STATIC_LDLIBS_NO= +STATIC_LDFLAGS= +RANLIB= + +# add -profile here to run the ms profiler +# -LTCG whole program optimization +# -incremental:no full linking +# -fixed:no generate relocatable code +# -version:. - only 2 components allowed, 0-65535 each +# -debug generate debugging info +LINK_OPT_FLAGS_WHOLE_YES = -LTCG +LINK_OPT_FLAGS_YES = $(LINK_OPT_FLAGS_WHOLE_$(OPT_WHOLE_PROGRAM)) +LINK_OPT_FLAGS_YES += -incremental:no -opt:ref +LINK_OPT_FLAGS_YES += -release $(PROD_VERSION:%=-version:%) +LINK_OPT_FLAGS_NO = -debug -incremental:no -fixed:no +OPT_LDFLAGS = $(LINK_OPT_FLAGS_$(HOST_OPT)) + +LIB_OPT_FLAGS_YES = $(LINK_OPT_FLAGS_WHOLE_$(OPT_WHOLE_PROGRAM)) +LIB_OPT_LDFLAGS = $(LIB_OPT_FLAGS_$(HOST_OPT)) + +ARCH_DEP_CFLAGS= +SHRLIB_CFLAGS= + +OS_CLASS=WIN32 +POSIX=NO + +# ifdef WIN32 looks better that ifeq ($(OS_CLASS),WIN32) ?? +WIN32=1 + +EXE=.exe +OBJ=.obj +RES=.res + +# MS Visual C++ doesn't recognize *.cc as a C++ source file, +# so C++ compiles get the flag -TP +COMPILER_CXXFLAGS = -TP + +# Operating system flags +OP_SYS_CFLAGS = +OP_SYS_CXXFLAGS = $(COMPILER_CXXFLAGS) + +# Files and flags needed to link DLLs (used in RULES_BUILD) +WIN32_DLLFLAGS = -subsystem:windows -dll $(OPT_LDFLAGS) \ + $(USR_LDFLAGS) $(CMD_LDFLAGS) $(TARGET_LDFLAGS) $(LIB_LDFLAGS) + +# Specify dll .def file only if it exists +DLL_DEF_FLAG = $(addprefix -def:,$(wildcard ../$(addsuffix .def,$*))) + +# A WIN32 dll has three parts: +# x.dll: the real dll (SHRLIBNAME) +# x.lib: what you link to progs that use the dll (DLLSTUB_LIBNAME) +# x.exp: what you need to build the dll (in no variable) +LINK.shrlib = $(WINLINK) -nologo $(WIN32_DLLFLAGS) -out:$@ \ + -implib:$(@:%$(SHRLIB_SUFFIX)=%$(LIB_SUFFIX)) \ + $(DLL_DEF_FLAG) $(LIBRARY_LD_OBJS) $(LIBRARY_LD_RESS) $(SHRLIB_LDLIBS) + +# Adjust names of libraries to build +SHRLIB_SUFFIX_BASE = .dll +SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) +SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) +LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) +TESTSHRLIBNAME_YES = $(TESTBUILD_LIBRARY:%=%$(SHRLIB_SUFFIX_BASE)) + +# When SHARED_LIBRARIES is YES we are building a DLL shared library. +# When SHARED_LIBRARIES is NO we are building an object library +DLLSTUB_SUFFIX = .lib +DLLSTUB_LIBNAME_YES = $(BUILD_LIBRARY:%=%.lib) +DLLSTUB_LIBNAME = $(DLLSTUB_LIBNAME_$(SHARED_LIBRARIES)) +TESTDLLSTUB_LIBNAME_YES = $(TESTBUILD_LIBRARY:%=%.lib) +TESTDLLSTUB_LIBNAME = $(TESTDLLSTUB_LIBNAME_$(SHARED_LIBRARIES)) + +LIB_PREFIX= +LIB_SUFFIX=.lib +LIBNAME_NO = $(BUILD_LIBRARY:%=%.lib) +LIBNAME = $(LIBNAME_$(SHARED_LIBRARIES)) +TESTLIBNAME_NO = $(TESTBUILD_LIBRARY:%=%.lib) +TESTLIBNAME = $(TESTLIBNAME_$(SHARED_LIBRARIES)) + +# dll install location +INSTALL_SHRLIB = $(INSTALL_BIN) + + +#-------------------------------------------------- +# Products dependancy definitions + +PROD_DEPLIBS = $(foreach lib, $(PROD_LIBS) $(USR_LIBS), \ + $(firstword $(wildcard \ + $(addsuffix /$(DLLSTUB_PREFIX)$(lib)$(DLLSTUB_SUFFIX), \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ + $(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ + $(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ + ) $(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), \ + $(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB))))) + + +PROD_LDLIBS += $($*_DEPLIBS) $(PROD_DEPLIBS) +PROD_LDLIBS += $(addsuffix .lib, \ + $($*_SYS_LIBS) $(PROD_SYS_LIBS) $(USR_SYS_LIBS)) + +LDLIBS_STATIC_YES = LDLIBS +LDLIBS_SHARED_NO = LDLIBS +PROD_LDLIBS += $(STATIC_LDLIBS) \ + $($(firstword $(LDLIBS_STATIC_$(STATIC_BUILD)) \ + $(LDLIBS_SHARED_$(SHARED_LIBRARIES)))) + +#-------------------------------------------------- +# Libraries dependancy definitions + +# libs that we need to link the DLL with +# (it isnt necessary to rebuild the dll if these change) + +SHRLIB_DEPLIBS = $(foreach lib, $(LIB_LIBS) $(USR_LIBS), \ + $(firstword $(wildcard \ + $(addsuffix /$(DLLSTUB_PREFIX)$(lib)$(DLLSTUB_SUFFIX), \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ + $(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ + $(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \ + $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ + ) $(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), \ + $(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB))))) + + +SHRLIB_LDLIBS += $($*_DLL_DEPLIBS) $($*_DEPLIBS) $(SHRLIB_DEPLIBS) +SHRLIB_LDLIBS += $(addsuffix .lib, \ + $($*_SYS_DLL_LIBS) \ + $($*_SYS_LIBS) $(LIB_SYS_LIBS) $(USR_SYS_LIBS) ) + +#-------------------------------------------------- +# Linker definition +LINK.cpp = $(WINLINK) -nologo $(STATIC_LDFLAGS) $(LDFLAGS) $(PROD_LDFLAGS) \ + -out:$@ $(PROD_LD_OBJS) $(PROD_LD_RESS) $(PROD_LDLIBS) + +#-------------------------------------------------- +# UseManifestTool.pl checks MS Visual c++ compiler version number to +# decide whether or not to use the Manifest Tool command to embed the +# linker created .manifest file into a library or product target. +# useManifestTool.pl returns 0(don't use) or 1(use). +# +MT.exe = $(LLVM_PREFIX)mt$(LLVM_SUFFIX) -nologo -manifest $@.manifest +MT_DLL_COMMAND1 = $(MT.exe) "-outputresource:$@;\#2" +MT_EXE_COMMAND_YES = +MT_EXE_COMMAND_NO = $(MT.exe) "-outputresource:$@;\#1" +MT_EXE_COMMAND1 = $(MT_EXE_COMMAND_$(STATIC_BUILD)) +MT_DLL_COMMAND = $(MT_DLL_COMMAND$(shell $(PERL) $(TOOLS)/useManifestTool.pl)) +MT_EXE_COMMAND = $(MT_EXE_COMMAND$(shell $(PERL) $(TOOLS)/useManifestTool.pl)) diff --git a/configure/os/CONFIG.win32-x86.win32-x86 b/configure/os/CONFIG.win32-x86.win32-x86 index 767f4c7fa..dfd742a85 100644 --- a/configure/os/CONFIG.win32-x86.win32-x86 +++ b/configure/os/CONFIG.win32-x86.win32-x86 @@ -4,286 +4,7 @@ # Override these definitions in CONFIG_SITE.win32-x86.win32-x86 #------------------------------------------------------- -# Win32 valid build types and include directory suffixes +# Include common msvc compiler definitions +include $(CONFIG)/CONFIG.msvcCommon VALID_BUILDS = Host Ioc Command - -CMPLR_CLASS = msvc - -OPT_WHOLE_PROGRAM = YES - -#------------------------------------------------------- - -WINLINK = link - -RCCMD = rc -l 0x409 $(INCLUDES) -fo $@ $< - -ARCMD = lib -nologo -verbose -out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS) - -# -# Configure OS vendor C compiler -CC = cl - -# Override CONFIG.gnuCommon settings for cross builds. -GNU = NO -HDEPENDS_METHOD = MKMF - -# Compiler flags for C files (C++ is below) - -# -# -W display warnings at level d -# -W4 is for maximum (lint type) warnings -# -W3 is for production quality warnings -# -W2 displays significant warnings -# -W1 is the default and shows severe warnings only -# -w Set warning C to be shown at level -WARN_CFLAGS_YES = -W3 -WARN_CFLAGS_NO = -W1 - -# -# -Ox maximum optimizations -# -GL whole program optimization -# -Oy- re-enable creation of frame pointers -OPT_CFLAGS_YES_YES = -Ox -GL -Oy- -OPT_CFLAGS_YES_NO = -Ox -Oy- -OPT_CFLAGS_YES = $(OPT_CFLAGS_YES_$(OPT_WHOLE_PROGRAM)) - -# -# -Z7 generate C7 compatible debugging information (inside .obj) -# -RTCsu enable run-time error checks -OPT_CFLAGS_NO = -Z7 -RTCsu - -# specify object file name and location -OBJ_CFLAG = -Fo - -# -# the following options are required when -# vis c++ compiles the code (and includes -# the header files) -# -# -MT static multithreaded C RTL -# -MTd static multithreaded C RTL (debug version) -# -MD multithreaded C RTL in DLL -# -MDd multithreaded C RTL in DLL (debug version) -BUILD_DLL_CFLAGS_NO = -BUILD_DLL_CFLAGS_YES = -DEPICS_BUILD_DLL -BUILD_DLL_CFLAGS = $(BUILD_DLL_CFLAGS_$(SHARED_LIBRARIES)) -VISC_CFLAGS_DEBUG_NO = d -VISC_CFLAGS_DEBUG_YES = -VISC_CFLAGS_DEBUG = $(VISC_CFLAGS_DEBUG_$(HOST_OPT)) -STATIC_CFLAGS_YES= -MT$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) -STATIC_CFLAGS_NO= -MD$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) -DEPICS_CALL_DLL - -# OS vendor c preprocessor -CPP = cl -nologo -C -E - -# Configure OS vendor C++ compiler -# -# -EHsc - generate code for exceptions -# -GR - generate code for run time type identification -# -CCC = cl -EHsc -GR - -# Other compiler flags, used for CPP, C and C++ -# -# -FC - Show absolute path of source file in diagnostics -# -D__STDC__=0 gives us both: -# 1) define STDC for code (pretend ANSI conformance) -# 2) set it to 0 to use MS C "extensions" (open for _open etc.) -# because MS uses: if __STDC__ ... disable many nice things -# -CODE_CPPFLAGS += -nologo -FC -D__STDC__=0 -CODE_CPPFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE - - -# Compiler flags for C++ files - -# -# -W disable warnings from levels > n -# -w set warning m to level n -# -w44355 "'this' used in the base initializer list" -# -w44344 "behavior change: use of explicit template arguments results in ..." -# -w44251 "class needs to have dll-interface to be used by clients of ..." -WARN_CXXFLAGS_YES = -W3 -w44355 -w44344 -w44251 -WARN_CXXFLAGS_NO = -W1 - -# Silence tr1 namespace deprecation warnings -WARN_CXXFLAGS += -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING - -# -# -Ox maximum optimizations -# -GL whole program optimization -# -Oy- re-enable creation of frame pointers -OPT_CXXFLAGS_YES_YES = -Ox -GL -Oy- -OPT_CXXFLAGS_YES_NO = -Ox -Oy- -OPT_CXXFLAGS_YES = $(OPT_CXXFLAGS_YES_$(OPT_WHOLE_PROGRAM)) - -# -# -Z7 generate C7 compatible debugging information (inside .obj) -# -RTCsu enable run-time error checks -OPT_CXXFLAGS_NO = -RTCsu -Z7 - -# specify object file name and location -OBJ_CXXFLAG = -Fo - -# -# the following options are required when -# vis c++ compiles the code (and includes -# the header files) -# -# -MT static multithreaded C RTL -# -MTd static multithreaded C RTL (debug version) -# -MD multithreaded C RTL in DLL -# -MDd multithreaded C RTL in DLL (debug version) -STATIC_CXXFLAGS_YES= -MT$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) -STATIC_CXXFLAGS_NO= -MD$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) -DEPICS_CALL_DLL - -STATIC_LDLIBS_YES=ws2_32.lib advapi32.lib user32.lib kernel32.lib winmm.lib dbghelp.lib -STATIC_LDLIBS_NO= -STATIC_LDFLAGS= -RANLIB= - -# add -profile here to run the ms profiler -# -LTCG whole program optimization -# -incremental:no full linking -# -fixed:no generate relocatable code -# -version:. - only 2 components allowed, 0-65535 each -# -debug generate debugging info -LINK_OPT_FLAGS_WHOLE_YES = -LTCG -LINK_OPT_FLAGS_YES = $(LINK_OPT_FLAGS_WHOLE_$(OPT_WHOLE_PROGRAM)) -LINK_OPT_FLAGS_YES += -incremental:no -opt:ref -LINK_OPT_FLAGS_YES += -release $(PROD_VERSION:%=-version:%) -LINK_OPT_FLAGS_NO = -debug -incremental:no -fixed:no -OPT_LDFLAGS = $(LINK_OPT_FLAGS_$(HOST_OPT)) - -LIB_OPT_FLAGS_YES = $(LINK_OPT_FLAGS_WHOLE_$(OPT_WHOLE_PROGRAM)) -LIB_OPT_LDFLAGS = $(LIB_OPT_FLAGS_$(HOST_OPT)) - -ARCH_DEP_CFLAGS= -SHRLIB_CFLAGS= - -OS_CLASS=WIN32 -POSIX=NO - -# ifdef WIN32 looks better that ifeq ($(OS_CLASS),WIN32) ?? -WIN32=1 - -EXE=.exe -OBJ=.obj -RES=.res - -# MS Visual C++ doesn't recognize *.cc as a C++ source file, -# so C++ compiles get the flag -TP -COMPILER_CXXFLAGS = -TP - -# Operating system flags -OP_SYS_CFLAGS = -OP_SYS_CXXFLAGS = $(COMPILER_CXXFLAGS) - -# Files and flags needed to link DLLs (used in RULES_BUILD) -WIN32_DLLFLAGS = -subsystem:windows -dll $(OPT_LDFLAGS) \ - $(USR_LDFLAGS) $(CMD_LDFLAGS) $(TARGET_LDFLAGS) $(LIB_LDFLAGS) - -# Specify dll .def file only if it exists -DLL_DEF_FLAG = $(addprefix -def:,$(wildcard ../$(addsuffix .def,$*))) - -# A WIN32 dll has three parts: -# x.dll: the real dll (SHRLIBNAME) -# x.lib: what you link to progs that use the dll (DLLSTUB_LIBNAME) -# x.exp: what you need to build the dll (in no variable) -LINK.shrlib = $(WINLINK) -nologo $(WIN32_DLLFLAGS) -out:$@ \ - -implib:$(@:%$(SHRLIB_SUFFIX)=%$(LIB_SUFFIX)) \ - $(DLL_DEF_FLAG) $(LIBRARY_LD_OBJS) $(LIBRARY_LD_RESS) $(SHRLIB_LDLIBS) - -# Adjust names of libraries to build -SHRLIB_SUFFIX_BASE = .dll -SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) -SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) -LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX)) -TESTSHRLIBNAME_YES = $(TESTBUILD_LIBRARY:%=%$(SHRLIB_SUFFIX_BASE)) - -# When SHARED_LIBRARIES is YES we are building a DLL shared library. -# When SHARED_LIBRARIES is NO we are building an object library -DLLSTUB_SUFFIX = .lib -DLLSTUB_LIBNAME_YES = $(BUILD_LIBRARY:%=%.lib) -DLLSTUB_LIBNAME = $(DLLSTUB_LIBNAME_$(SHARED_LIBRARIES)) -TESTDLLSTUB_LIBNAME_YES = $(TESTBUILD_LIBRARY:%=%.lib) -TESTDLLSTUB_LIBNAME = $(TESTDLLSTUB_LIBNAME_$(SHARED_LIBRARIES)) - -LIB_PREFIX= -LIB_SUFFIX=.lib -LIBNAME_NO = $(BUILD_LIBRARY:%=%.lib) -LIBNAME = $(LIBNAME_$(SHARED_LIBRARIES)) -TESTLIBNAME_NO = $(TESTBUILD_LIBRARY:%=%.lib) -TESTLIBNAME = $(TESTLIBNAME_$(SHARED_LIBRARIES)) - -# dll install location -INSTALL_SHRLIB = $(INSTALL_BIN) - - -#-------------------------------------------------- -# Products dependancy definitions - -PROD_DEPLIBS = $(foreach lib, $(PROD_LIBS) $(USR_LIBS), \ - $(firstword $(wildcard \ - $(addsuffix /$(DLLSTUB_PREFIX)$(lib)$(DLLSTUB_SUFFIX), \ - $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ - $(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \ - $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ - $(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \ - $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ - ) $(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), \ - $(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB))))) - - -PROD_LDLIBS += $($*_DEPLIBS) $(PROD_DEPLIBS) -PROD_LDLIBS += $(addsuffix .lib, \ - $($*_SYS_LIBS) $(PROD_SYS_LIBS) $(USR_SYS_LIBS)) - -LDLIBS_STATIC_YES = LDLIBS -LDLIBS_SHARED_NO = LDLIBS -PROD_LDLIBS += $(STATIC_LDLIBS) \ - $($(firstword $(LDLIBS_STATIC_$(STATIC_BUILD)) \ - $(LDLIBS_SHARED_$(SHARED_LIBRARIES)))) - -#-------------------------------------------------- -# Libraries dependancy definitions - -# libs that we need to link the DLL with -# (it isnt necessary to rebuild the dll if these change) - -SHRLIB_DEPLIBS = $(foreach lib, $(LIB_LIBS) $(USR_LIBS), \ - $(firstword $(wildcard \ - $(addsuffix /$(DLLSTUB_PREFIX)$(lib)$(DLLSTUB_SUFFIX), \ - $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ - $(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \ - $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ - $(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \ - $($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \ - ) $(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), \ - $(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB))))) - - -SHRLIB_LDLIBS += $($*_DLL_DEPLIBS) $($*_DEPLIBS) $(SHRLIB_DEPLIBS) -SHRLIB_LDLIBS += $(addsuffix .lib, \ - $($*_SYS_DLL_LIBS) \ - $($*_SYS_LIBS) $(LIB_SYS_LIBS) $(USR_SYS_LIBS) ) - -#-------------------------------------------------- -# Linker definition -LINK.cpp = $(WINLINK) -nologo $(STATIC_LDFLAGS) $(LDFLAGS) $(PROD_LDFLAGS) \ - -out:$@ $(PROD_LD_OBJS) $(PROD_LD_RESS) $(PROD_LDLIBS) - -#-------------------------------------------------- -# UseManifestTool.pl checks MS Visual c++ compiler version number to -# decide whether or not to use the Manifest Tool command to embed the -# linker created .manifest file into a library or product target. -# useManifestTool.pl returns 0(don't use) or 1(use). -# -MT.exe = mt.exe -nologo -manifest $@.manifest -MT_DLL_COMMAND1 = $(MT.exe) "-outputresource:$@;\#2" -MT_EXE_COMMAND_YES = -MT_EXE_COMMAND_NO = $(MT.exe) "-outputresource:$@;\#1" -MT_EXE_COMMAND1 = $(MT_EXE_COMMAND_$(STATIC_BUILD)) -MT_DLL_COMMAND = $(MT_DLL_COMMAND$(shell $(PERL) $(TOOLS)/useManifestTool.pl)) -MT_EXE_COMMAND = $(MT_EXE_COMMAND$(shell $(PERL) $(TOOLS)/useManifestTool.pl)) From 8e8fb810623555be93efcc2ddf83df86b6682836 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Sat, 13 May 2023 21:34:55 +0200 Subject: [PATCH 02/19] explicit include SAL header to help clang-cl compiler --- modules/libcom/src/osi/compiler/msvc/compilerSpecific.h | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/libcom/src/osi/compiler/msvc/compilerSpecific.h b/modules/libcom/src/osi/compiler/msvc/compilerSpecific.h index 631da4f38..3566de6fc 100644 --- a/modules/libcom/src/osi/compiler/msvc/compilerSpecific.h +++ b/modules/libcom/src/osi/compiler/msvc/compilerSpecific.h @@ -48,6 +48,7 @@ * Enable format-string checking if compiler supports it (if msvc is 2015 or newer) */ #if _MSC_VER >= 1900 +# include # define EPICS_PRINTF_FMT(a) _Printf_format_string_ a #endif From 29da5d67e1ed310fe288f093d055d4b81ecc2a17 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Sat, 13 May 2023 21:37:29 +0200 Subject: [PATCH 03/19] add win32-x86-clang and windows-x64-clang targets --- configure/os/CONFIG.Common.win32-x86-clang | 18 ++++++++++++++++++ configure/os/CONFIG.Common.windows-x64-clang | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 configure/os/CONFIG.Common.win32-x86-clang create mode 100644 configure/os/CONFIG.Common.windows-x64-clang diff --git a/configure/os/CONFIG.Common.win32-x86-clang b/configure/os/CONFIG.Common.win32-x86-clang new file mode 100644 index 000000000..ecde48366 --- /dev/null +++ b/configure/os/CONFIG.Common.win32-x86-clang @@ -0,0 +1,18 @@ +# CONFIG.Common.win32-x86-clang +# +# Definitions for win32-x86-clang target build +# Override these definitions in CONFIG_SITE.Common.win32-x86-clang +#------------------------------------------------------- + +#Include definitions common to msvc compiler +include $(CONFIG)/CONFIG.msvcCommon + +VALID_BUILDS = Ioc Host Command + +# Override CONFIG.msvcCommon settings: +LLVM_PREFIX = llvm- +CC = clang-cl$(LLVM_SUFFIX) --target=i686-pc-windows-msvc +WINLINK = lld-link$(LLVM_SUFFIX) + +# clang-cl does not support /GL option +OPT_WHOLE_PROGRAM = NO diff --git a/configure/os/CONFIG.Common.windows-x64-clang b/configure/os/CONFIG.Common.windows-x64-clang new file mode 100644 index 000000000..2bb2fa80d --- /dev/null +++ b/configure/os/CONFIG.Common.windows-x64-clang @@ -0,0 +1,11 @@ +# CONFIG.Common.windows-x64-clang +# +# Definitions for windows-x64-clang target builds +# Sites may override these definitions in CONFIG_SITE.Common.windows-x64-clang +#------------------------------------------------------- + +#Include definitions common to win32-x86-clang builds +include $(CONFIG)/os/CONFIG.Common.win32-x86-clang + +# Override CONFIG.Common.win32-x86-clang settings: +CC = clang-cl$(LLVM_SUFFIX) --target=x86_64-pc-windows-msvc From 166157dcbf38bfa8c8e8e85cb51cc33e80c997e9 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Tue, 23 May 2023 18:23:17 +0200 Subject: [PATCH 04/19] allow clang windows as host arch --- configure/os/CONFIG.win32-x86-clang.Common | 9 +++++++++ configure/os/CONFIG.windows-x64-clang.Common | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 configure/os/CONFIG.win32-x86-clang.Common create mode 100644 configure/os/CONFIG.windows-x64-clang.Common diff --git a/configure/os/CONFIG.win32-x86-clang.Common b/configure/os/CONFIG.win32-x86-clang.Common new file mode 100644 index 000000000..65c83c486 --- /dev/null +++ b/configure/os/CONFIG.win32-x86-clang.Common @@ -0,0 +1,9 @@ +# CONFIG.win32-x86-clang.Common +# +# Definitions for win32-x86-clang host arch +# Override these definitions in CONFIG_SITE.win32-x86-clang.Common +#------------------------------------------------------- + +#Include definitions common to win32-x86 hosts +include $(CONFIG)/os/CONFIG.win32-x86.Common + diff --git a/configure/os/CONFIG.windows-x64-clang.Common b/configure/os/CONFIG.windows-x64-clang.Common new file mode 100644 index 000000000..6eeb37241 --- /dev/null +++ b/configure/os/CONFIG.windows-x64-clang.Common @@ -0,0 +1,9 @@ +# CONFIG.windows-x64-clang.Common +# +# Definitions for windows-x64-clang host arch +# Override these definitions in CONFIG_SITE.windows-x64-clang.Common +#------------------------------------------------------- + +#Include definitions common to windows-x64 hosts +include $(CONFIG)/os/CONFIG.windows-x64.Common + From 60239498a1ba7bea4f7cdd9bf2dc8e064a8b795e Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Tue, 23 May 2023 21:22:30 +0200 Subject: [PATCH 05/19] use forked pvData module with clang-cl fixes --- .gitmodules | 4 ++-- modules/pvData | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index e537fc586..5af8525a3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "modules/pvData"] path = modules/pvData - url = https://github.com/epics-base/pvDataCPP - branch = master + url = https://github.com/xiaoqiangwang/pvDataCPP + branch = fix_clang_windows [submodule "modules/pvAccess"] path = modules/pvAccess url = https://github.com/epics-base/pvAccessCPP diff --git a/modules/pvData b/modules/pvData index 2547514ab..1457428e8 160000 --- a/modules/pvData +++ b/modules/pvData @@ -1 +1 @@ -Subproject commit 2547514abb90875bf47dda728ecaa9e30a5ab354 +Subproject commit 1457428e8b0a912d67452a001199146ebe898471 From f0d98b9b9a76d9910f62b1533905f6add08180e9 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 12:03:46 +0200 Subject: [PATCH 06/19] use forked .ci module with clang windows support --- .ci | 2 +- .gitmodules | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci b/.ci index 1e0e326f7..ca6a3e668 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 1e0e326f74ffac4154ce80b5d41c410c754cf5d8 +Subproject commit ca6a3e66854622a3e9babd544b2a28a40db2733b diff --git a/.gitmodules b/.gitmodules index 5af8525a3..080754ade 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,5 +24,5 @@ branch = master [submodule ".ci"] path = .ci - url = https://github.com/epics-base/ci-scripts - branch = master + url = https://github.com/xiaoqiangwang/ci-scripts + branch = clang_windows From 763760c58b7a37da94a78773bf586a417a07f16a Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 12:04:11 +0200 Subject: [PATCH 07/19] add clang windows build --- .github/workflows/ci-scripts-build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 5a66f1d7b..5424e809f 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -46,6 +46,7 @@ jobs: CI_CROSS_TARGETS: ${{ matrix.cross }} EXTRA: ${{ matrix.extra }} TEST: ${{ matrix.test }} + CHOCO: llvm strategy: fail-fast: false matrix: @@ -153,6 +154,12 @@ jobs: configuration: default name: "Win2019 mingw" + - os: windows-2019 + cmp: clang+vs2019 + configuration: default + name: "Win2019 clang-cl" + choco: ["llvm"] + # Cross builds - os: ubuntu-latest From b615232788660c2a5934ca35ac03edb125a253ae Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 12:15:40 +0200 Subject: [PATCH 08/19] update ci-scripts module --- .ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci b/.ci index ca6a3e668..2940c2b1d 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit ca6a3e66854622a3e9babd544b2a28a40db2733b +Subproject commit 2940c2b1dcc262d2384e79b9c70f425f67b913d6 From 6b1d30408f89740654e257f7dfb1bebd100a53b5 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 12:37:50 +0200 Subject: [PATCH 09/19] update ci-scripts module --- .ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci b/.ci index 2940c2b1d..03727a166 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 2940c2b1dcc262d2384e79b9c70f425f67b913d6 +Subproject commit 03727a16642b312f13cee9ff5a7d7852d59b0297 From 3724420dc6aff4eebf0f8201de3e8c52e01ecedf Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 12:38:35 +0200 Subject: [PATCH 10/19] fail fast for testing purpose --- .github/workflows/ci-scripts-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 5424e809f..210fa4de3 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -48,7 +48,7 @@ jobs: TEST: ${{ matrix.test }} CHOCO: llvm strategy: - fail-fast: false + fail-fast: true matrix: # Job names also name artifacts, character limitations apply include: From 538a3d2f099b7af45e4cf7ea88c52c115d4efb67 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 13:16:44 +0200 Subject: [PATCH 11/19] update ci-scripts module --- .ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci b/.ci index 03727a166..b09f4c890 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 03727a16642b312f13cee9ff5a7d7852d59b0297 +Subproject commit b09f4c8901f7e0227537fd91cb764b3b3d79eeb8 From b948c03675be2f683cf6576f876135d0096bd698 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 13:19:55 +0200 Subject: [PATCH 12/19] debug: only build clang windows --- .github/workflows/ci-scripts-build.yml | 122 ------------------------- 1 file changed, 122 deletions(-) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 210fa4de3..80be5ba6c 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -52,134 +52,12 @@ jobs: matrix: # Job names also name artifacts, character limitations apply include: - - os: ubuntu-20.04 - cmp: gcc - configuration: default - cross: "windows-x64-mingw" - name: "Ub-20 gcc-9 + MinGW" - - - os: ubuntu-20.04 - cmp: gcc - configuration: static - cross: "windows-x64-mingw" - name: "Ub-20 gcc-9 + MinGW, static" - - - os: ubuntu-20.04 - cmp: gcc - configuration: static - extra: "CMD_CXXFLAGS=-std=c++11" - name: "Ub-20 gcc-9 C++11, static" - - - os: ubuntu-20.04 - cmp: gcc - configuration: static - extra: "CMD_CFLAGS=-funsigned-char CMD_CXXFLAGS=-funsigned-char" - name: "Ub-20 gcc-9 unsigned char" - - - os: ubuntu-20.04 - cmp: clang - configuration: default - name: "Ub-20 clang-10" - - - os: ubuntu-20.04 - cmp: clang - configuration: default - extra: "CMD_CXXFLAGS=-std=c++11" - name: "Ub-20 clang-10 C++11" - - - os: ubuntu-20.04 - cmp: gcc - configuration: default - cross: "RTEMS-pc686-qemu@5" - name: "Ub-20 gcc-9 + RT-5.1 pc686" - - - os: ubuntu-20.04 - cmp: gcc - configuration: default - cross: "RTEMS-beatnik@5" - test: NO - name: "Ub-20 gcc-9 + RT-5.1 beatnik" - - - os: ubuntu-20.04 - cmp: gcc - configuration: default - cross: "RTEMS-xilinx_zynq_a9_qemu@5" - test: NO - name: "Ub-20 gcc-9 + RT-5.1 xilinx_zynq_a9_qemu" - - - os: ubuntu-20.04 - cmp: gcc - configuration: default - cross: "RTEMS-uC5282@5" - test: NO - name: "Ub-20 gcc-9 + RT-5.1 uC5282" - - - os: ubuntu-20.04 - cmp: gcc - configuration: default - name: "Ub-20 gcc-9 + RT-4.10" - cross: "RTEMS-pc386-qemu@4.10" - test: NO - - - os: ubuntu-20.04 - cmp: gcc - configuration: default - name: "Ub-20 gcc-9 + RT-4.9" - cross: "RTEMS-pc386-qemu@4.9" - - - os: macos-latest - cmp: clang - configuration: default - name: "MacOS clang-12" - - - os: windows-2019 - cmp: vs2019 - configuration: debug - name: "Win2019 MSC-19" - extra: "CMD_CXXFLAGS=-analysis" - - - os: windows-2019 - cmp: vs2019 - configuration: static-debug - name: "Win2019 MSC-19, static" - extra: "CMD_CXXFLAGS=-analysis" - - - os: windows-2019 - cmp: vs2019 - configuration: debug - name: "Win2019 MSC-19, debug" - - - os: windows-2019 - cmp: gcc - configuration: default - name: "Win2019 mingw" - - os: windows-2019 cmp: clang+vs2019 configuration: default name: "Win2019 clang-cl" choco: ["llvm"] - # Cross builds - - - os: ubuntu-latest - cmp: gcc - configuration: default - name: "Cross linux-aarch64" - cross: linux-aarch64 - - - os: ubuntu-latest - cmp: gcc - configuration: default - name: "Cross linux-arm gnueabi" - cross: linux-arm@arm-linux-gnueabi - - - os: ubuntu-latest - cmp: gcc - configuration: default - name: "Cross linux-arm gnueabihf" - cross: linux-arm@arm-linux-gnueabihf - steps: - uses: actions/checkout@v3 with: From ccc730332a20bc4214dfa725f5c2ee5611877b91 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 16:45:08 +0200 Subject: [PATCH 13/19] Revert "debug: only build clang windows" This reverts commit b948c03675be2f683cf6576f876135d0096bd698. --- .github/workflows/ci-scripts-build.yml | 122 +++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 80be5ba6c..210fa4de3 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -52,12 +52,134 @@ jobs: matrix: # Job names also name artifacts, character limitations apply include: + - os: ubuntu-20.04 + cmp: gcc + configuration: default + cross: "windows-x64-mingw" + name: "Ub-20 gcc-9 + MinGW" + + - os: ubuntu-20.04 + cmp: gcc + configuration: static + cross: "windows-x64-mingw" + name: "Ub-20 gcc-9 + MinGW, static" + + - os: ubuntu-20.04 + cmp: gcc + configuration: static + extra: "CMD_CXXFLAGS=-std=c++11" + name: "Ub-20 gcc-9 C++11, static" + + - os: ubuntu-20.04 + cmp: gcc + configuration: static + extra: "CMD_CFLAGS=-funsigned-char CMD_CXXFLAGS=-funsigned-char" + name: "Ub-20 gcc-9 unsigned char" + + - os: ubuntu-20.04 + cmp: clang + configuration: default + name: "Ub-20 clang-10" + + - os: ubuntu-20.04 + cmp: clang + configuration: default + extra: "CMD_CXXFLAGS=-std=c++11" + name: "Ub-20 clang-10 C++11" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + cross: "RTEMS-pc686-qemu@5" + name: "Ub-20 gcc-9 + RT-5.1 pc686" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + cross: "RTEMS-beatnik@5" + test: NO + name: "Ub-20 gcc-9 + RT-5.1 beatnik" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + cross: "RTEMS-xilinx_zynq_a9_qemu@5" + test: NO + name: "Ub-20 gcc-9 + RT-5.1 xilinx_zynq_a9_qemu" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + cross: "RTEMS-uC5282@5" + test: NO + name: "Ub-20 gcc-9 + RT-5.1 uC5282" + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + name: "Ub-20 gcc-9 + RT-4.10" + cross: "RTEMS-pc386-qemu@4.10" + test: NO + + - os: ubuntu-20.04 + cmp: gcc + configuration: default + name: "Ub-20 gcc-9 + RT-4.9" + cross: "RTEMS-pc386-qemu@4.9" + + - os: macos-latest + cmp: clang + configuration: default + name: "MacOS clang-12" + + - os: windows-2019 + cmp: vs2019 + configuration: debug + name: "Win2019 MSC-19" + extra: "CMD_CXXFLAGS=-analysis" + + - os: windows-2019 + cmp: vs2019 + configuration: static-debug + name: "Win2019 MSC-19, static" + extra: "CMD_CXXFLAGS=-analysis" + + - os: windows-2019 + cmp: vs2019 + configuration: debug + name: "Win2019 MSC-19, debug" + + - os: windows-2019 + cmp: gcc + configuration: default + name: "Win2019 mingw" + - os: windows-2019 cmp: clang+vs2019 configuration: default name: "Win2019 clang-cl" choco: ["llvm"] + # Cross builds + + - os: ubuntu-latest + cmp: gcc + configuration: default + name: "Cross linux-aarch64" + cross: linux-aarch64 + + - os: ubuntu-latest + cmp: gcc + configuration: default + name: "Cross linux-arm gnueabi" + cross: linux-arm@arm-linux-gnueabi + + - os: ubuntu-latest + cmp: gcc + configuration: default + name: "Cross linux-arm gnueabihf" + cross: linux-arm@arm-linux-gnueabihf + steps: - uses: actions/checkout@v3 with: From 01fc9f83a9887f2f3370fce91dc4aff15d74ce18 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 21:27:53 +0200 Subject: [PATCH 14/19] use windows-2022 to use MinGW 11 MinGW 8 on windows-2019 cannot compile pvData module --- .github/workflows/ci-scripts-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index 210fa4de3..1f47fe042 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -149,10 +149,10 @@ jobs: configuration: debug name: "Win2019 MSC-19, debug" - - os: windows-2019 + - os: windows-2022 cmp: gcc configuration: default - name: "Win2019 mingw" + name: "Win2022 mingw" - os: windows-2019 cmp: clang+vs2019 From 61fa360461c35e6dfafaf00445d6d4bd4d8bfe5f Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 24 May 2023 22:14:39 +0200 Subject: [PATCH 15/19] update ci-scripts module --- .ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci b/.ci index b09f4c890..0c44689ad 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit b09f4c8901f7e0227537fd91cb764b3b3d79eeb8 +Subproject commit 0c44689ad7fb981ed2deaa68afa7d9b958e9c5db From d7a0edf121bb9058ec35776a8c1bccfb2d6b28f8 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Thu, 25 May 2023 19:18:36 +0200 Subject: [PATCH 16/19] direct include of CONFIG.msvcCommon --- configure/os/CONFIG.Common.windows-x64-clang | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/configure/os/CONFIG.Common.windows-x64-clang b/configure/os/CONFIG.Common.windows-x64-clang index 2bb2fa80d..428e13b34 100644 --- a/configure/os/CONFIG.Common.windows-x64-clang +++ b/configure/os/CONFIG.Common.windows-x64-clang @@ -4,8 +4,15 @@ # Sites may override these definitions in CONFIG_SITE.Common.windows-x64-clang #------------------------------------------------------- -#Include definitions common to win32-x86-clang builds -include $(CONFIG)/os/CONFIG.Common.win32-x86-clang +#Include definitions common to msvc compiler +include $(CONFIG)/CONFIG.msvcCommon -# Override CONFIG.Common.win32-x86-clang settings: +VALID_BUILDS = Ioc Host Command + +# Override CONFIG.msvcCommon settings: +LLVM_PREFIX = llvm- CC = clang-cl$(LLVM_SUFFIX) --target=x86_64-pc-windows-msvc +WINLINK = lld-link$(LLVM_SUFFIX) + +# clang-cl does not support /GL option +OPT_WHOLE_PROGRAM = NO From cfa5ad3195766de44da7b7e1f421c5b5c28e653b Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Thu, 25 May 2023 19:26:05 +0200 Subject: [PATCH 17/19] rename LLVM_PREFIX/SUFFIX to MSVC_PREFIX/SUFFIX --- configure/CONFIG.msvcCommon | 6 +++--- configure/os/CONFIG.Common.win32-x86-clang | 6 +++--- configure/os/CONFIG.Common.windows-x64-clang | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/configure/CONFIG.msvcCommon b/configure/CONFIG.msvcCommon index ce5730d79..7a60600bb 100644 --- a/configure/CONFIG.msvcCommon +++ b/configure/CONFIG.msvcCommon @@ -8,9 +8,9 @@ OPT_WHOLE_PROGRAM = YES WINLINK = link -RCCMD = $(LLVM_PREFIX)rc$(LLVM_SUFFIX) -l 0x409 $(INCLUDES) -fo $@ $< +RCCMD = $(MSVC_PREFIX)rc$(MSVC_SUFFIX) -l 0x409 $(INCLUDES) -fo $@ $< -ARCMD = $(LLVM_PREFIX)lib$(LLVM_SUFFIX) -nologo -verbose -out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS) +ARCMD = $(MSVC_PREFIX)lib$(MSVC_SUFFIX) -nologo -verbose -out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS) # # Configure OS vendor C compiler @@ -271,7 +271,7 @@ LINK.cpp = $(WINLINK) -nologo $(STATIC_LDFLAGS) $(LDFLAGS) $(PROD_LDFLAGS) \ # linker created .manifest file into a library or product target. # useManifestTool.pl returns 0(don't use) or 1(use). # -MT.exe = $(LLVM_PREFIX)mt$(LLVM_SUFFIX) -nologo -manifest $@.manifest +MT.exe = $(MSVC_PREFIX)mt$(MSVC_SUFFIX) -nologo -manifest $@.manifest MT_DLL_COMMAND1 = $(MT.exe) "-outputresource:$@;\#2" MT_EXE_COMMAND_YES = MT_EXE_COMMAND_NO = $(MT.exe) "-outputresource:$@;\#1" diff --git a/configure/os/CONFIG.Common.win32-x86-clang b/configure/os/CONFIG.Common.win32-x86-clang index ecde48366..c93478c90 100644 --- a/configure/os/CONFIG.Common.win32-x86-clang +++ b/configure/os/CONFIG.Common.win32-x86-clang @@ -10,9 +10,9 @@ include $(CONFIG)/CONFIG.msvcCommon VALID_BUILDS = Ioc Host Command # Override CONFIG.msvcCommon settings: -LLVM_PREFIX = llvm- -CC = clang-cl$(LLVM_SUFFIX) --target=i686-pc-windows-msvc -WINLINK = lld-link$(LLVM_SUFFIX) +MSVC_PREFIX = llvm- +CC = clang-cl$(MSVC_SUFFIX) --target=i686-pc-windows-msvc +WINLINK = lld-link$(MSVC_SUFFIX) # clang-cl does not support /GL option OPT_WHOLE_PROGRAM = NO diff --git a/configure/os/CONFIG.Common.windows-x64-clang b/configure/os/CONFIG.Common.windows-x64-clang index 428e13b34..e1b6bb6b6 100644 --- a/configure/os/CONFIG.Common.windows-x64-clang +++ b/configure/os/CONFIG.Common.windows-x64-clang @@ -10,9 +10,9 @@ include $(CONFIG)/CONFIG.msvcCommon VALID_BUILDS = Ioc Host Command # Override CONFIG.msvcCommon settings: -LLVM_PREFIX = llvm- -CC = clang-cl$(LLVM_SUFFIX) --target=x86_64-pc-windows-msvc -WINLINK = lld-link$(LLVM_SUFFIX) +MSVC_PREFIX = llvm- +CC = clang-cl$(MSVC_SUFFIX) --target=x86_64-pc-windows-msvc +WINLINK = lld-link$(MSVC_SUFFIX) # clang-cl does not support /GL option OPT_WHOLE_PROGRAM = NO From c68d5a8dc399e18a3ce901d91329d143a009e0a1 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Fri, 26 May 2023 08:33:10 +0200 Subject: [PATCH 18/19] direct include of CONFIG.msvcCommon --- configure/os/CONFIG.windows-x64.windows-x64 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure/os/CONFIG.windows-x64.windows-x64 b/configure/os/CONFIG.windows-x64.windows-x64 index dcb6e82de..c883f9742 100644 --- a/configure/os/CONFIG.windows-x64.windows-x64 +++ b/configure/os/CONFIG.windows-x64.windows-x64 @@ -4,9 +4,10 @@ # Override these definitions in CONFIG_SITE.windows-x64.windows-x64 #------------------------------------------------------- -#Include definitions common to win32-x86 builds -include $(CONFIG)/os/CONFIG.win32-x86.win32-x86 --include $(CONFIG)/os/CONFIG_SITE.win32-x86.win32-x86 +# Include common msvc compiler definitions +include $(CONFIG)/CONFIG.msvcCommon + +VALID_BUILDS = Host Ioc Command OPT_LDFLAGS += -MACHINE:X64 # -MACHINE:X64 From ccbe608c4ac79affe6af94ac58dafc8cb29766a4 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Mon, 19 Jun 2023 09:47:03 +0200 Subject: [PATCH 19/19] pvDataCPP with a different clang-cl workaround --- modules/pvData | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/pvData b/modules/pvData index 1457428e8..c87dcdeef 160000 --- a/modules/pvData +++ b/modules/pvData @@ -1 +1 @@ -Subproject commit 1457428e8b0a912d67452a001199146ebe898471 +Subproject commit c87dcdeef3fe65e2a12ee7c91d5c361608969264