-
|
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 11 replies
-
I use https://www.msys2.org. Our CI uses msys2 too, so it is more or less guaranteed to work. I have not tried llvm-mingw (or even heard of it), but looks like it's actually clang, renamed to g++. |
Beta Was this translation helpful? Give feedback.
-
@alabuzhev |
Beta Was this translation helpful? Give feedback.
-
@shmuz I tried it and successfully compiled both 32 and 64 error- and warning-free after 960cc4c. |
Beta Was this translation helpful? Give feedback.
-
As for now I've installed from https://github.com/niXman/mingw-builds-binaries
What's weird is that the produced Far.exe is 10 MB while in GitHub releases it's 5 MB. |
Beta Was this translation helpful? Give feedback.
-
@zg0 |
Beta Was this translation helpful? Give feedback.
-
which one? |
Beta Was this translation helpful? Give feedback.
-
Since this toolchain comes with a completely different standard library, it would be useful to support it. And now we do. Overall:
|
Beta Was this translation helpful? Give feedback.
-
@alabuzhev, I'm sorry to bother you again on this closed discussion, but would it be possible to make a few of changes to the makefile, for supporting cross-compilation with llvm/clang (basically, be explicit about the tools/libraries, so it won't use the system defaults), and also have the option to use python instead of wine? Currently, I apply the following patch to make things work: diff --git a/far/makefile_gcc_common b/far/makefile_gcc_common
index c8672169b..4b492308c 100644
--- a/far/makefile_gcc_common
+++ b/far/makefile_gcc_common
@@ -44,21 +44,29 @@ CP = $(UTILS_PREFIX)cp -f
MV = $(UTILS_PREFIX)mv -f
ifdef CLANG
-CXX = clang++
+CXX = clang --driver-mode=g++ -stdlib=libc++
CC = clang
+WINDRES = llvm-windres
+DLLTOOL = llvm-dlltool
+RANLIB = llvm-ranlib
+AR = llvm-ar
else # CLANG
CXX = $(GCC_PREFIX)g++$(DW2)
CC = $(GCC_PREFIX)gcc$(DW2)
-endif # CLANG
-
WINDRES = $(GCC_PREFIX)windres
DLLTOOL = $(GCC_PREFIX)dlltool
RANLIB = $(GCC_PREFIX)ranlib
AR = $(GCC_PREFIX)ar
+endif # CLANG
M4 = $(strip $(call os_name, $(TOOLS_PREFIX)m4)) -P -DFARBIT=$(DIRBIT) -DBUILD_TYPE=$(FARMANAGER_BUILD_TYPE) -DSCM_REVISION=$(FARMANAGER_SCM_REVISION) -DHOSTTYPE=$(HOST_TYPE)
GAWK = $(strip $(call os_name, $(TOOLS_PREFIX)gawk))
-LGEN = $(WINE_CMD)$(strip $(call os_name, $(TOOLSDIR)lng.generator.exe))
+
+ifdef PYTHON
+ LGEN = $(strip $(call os_name, python $(FARDIR)../misc/lng/lng.generator.py))
+else
+ LGEN = $(WINE_CMD)$(strip $(call os_name, $(TOOLSDIR)lng.generator.exe))
+endif
# Toolchain setup end
# Output directory setup
@@ -176,8 +184,13 @@ CFLAGS += \
ifeq ($(USE_LTO),1)
CFLAGS += \
-flto \
+
+ifndef CLANG
+CFLAGS += \
-flto-odr-type-merging \
+endif
+
endif # USE_LTO
LNKFLAGS += \
@@ -212,12 +225,16 @@ LLD_FLAGS = \
ifdef CLANG
ifeq ($(DIRBIT), 32)
-CLANG_TARGET = i686-pc-windows-gnu
+CLANG_TARGET = i686-w64-mingw32
else
-CLANG_TARGET = x86_64-pc-windows-gnu
+CLANG_TARGET = x86_64-w64-mingw32
endif
CLANG_FLAGS = \
+ --start-no-unused-arguments \
+ -rtlib=compiler-rt \
+ -unwindlib=libunwind \
+ --end-no-unused-arguments \
-target $(CLANG_TARGET) \
-Wno-unknown-warning-option \
-fms-extensions \ Of course, this also works for msys2. The Also, I want to bring to your attention, that the upcoming version (18) of libc++ (can be tested with the pre-release version of llvm-mingw), implements the C++23 diff --git a/far/common/cpp.hpp b/far/common/cpp.hpp
index cbd012328..45beb6651 100644
--- a/far/common/cpp.hpp
+++ b/far/common/cpp.hpp
@@ -128,6 +128,7 @@ namespace std
}
#endif
+#if (__cplusplus < 202302L)
#ifndef __cpp_lib_ranges_fold
#include <functional>
#include <iterator>
@@ -161,6 +162,7 @@ namespace std::ranges
inline constexpr fold_left_fn fold_left;
}
#endif
+#endif
#ifndef __cpp_size_t_suffix
|
Beta Was this translation helpful? Give feedback.
-
@bitraid please feel free to create a PR.
Specifying |
Beta Was this translation helpful? Give feedback.
-
Yes, exactly. It's for compiling windows programs on linux. I'll come up with something to address the stdlib issue, and add to github workflow. |
Beta Was this translation helpful? Give feedback.
Since this toolchain comes with a completely different standard library, it would be useful to support it.
And now we do.
Overall: