-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditionally disable command line length work-around in Makefile.in
#2098
Comments
They must have something to merge files, no? |
IIUC, on Windows one would use Disabling the work-around on systems without known command line length limitations seems safest/easiest. And, to be clear, we are just talking about one of the |
I'm sure I am misunderstanding something; you would like to disable merging of files for MinGW, that one system that actually requires it in order compile FLINT? |
No. We are running The proposal is to "merge" only if the system running |
I have thought about this for a little bit, and I do not think this is an issue about FLINT. I believe this is a pretty standard feature of linkers, and so I would first like to see this discussed at LLVM before trying to solve it here. However, I am still opening to merging relevant PRs that may resolve this issue. |
OK. In the mean time, we will work around this with a patch against the latest release (3.1.3-p1). I've just tested the following patch under each of diff -ruN flint-3.1.3-p1/Makefile.in flint-3.1.3-p1-patched/Makefile.in
--- flint-3.1.3-p1/Makefile.in 2024-05-24 08:52:40
+++ flint-3.1.3-p1-patched/Makefile.in 2024-10-20 23:32:18
@@ -416,6 +416,10 @@
ifneq ($(SHARED), 0)
shared: $(FLINT_DIR)/$(FLINT_LIB_FULL)
+ifneq ($(strip $(filter gnu% linux-gnu%,@FLINT_BUILD_OS@)),)
+# No command line length limitations under build_os=gnu*|linux-gnu*
+MERGED_LOBJS := $(foreach dir,$(DIRS),$($(dir)_LOBJS))
+else
# The following is to avoid reaching the maximum length of command line
# arguments, mainly present on MinGW.
define xxx_merged_lobj_rule
@@ -424,6 +428,7 @@
endef
$(foreach dir, $(DIRS), $(eval $(call xxx_merged_lobj_rule,$(dir))))
MERGED_LOBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.lo)
+endif
$(FLINT_DIR)/$(FLINT_LIB_FULL): $(MERGED_LOBJS)
@echo "Building $(FLINT_LIB_FULL)"
@@ -437,6 +442,10 @@
ifneq ($(STATIC), 0)
static: $(FLINT_DIR)/$(FLINT_LIB_STATIC)
+ifneq ($(strip $(filter gnu% linux-gnu%,@FLINT_BUILD_OS@)),)
+# No command line length limitations under build_os=gnu*|linux-gnu*
+MERGED_OBJS := $(foreach dir,$(DIRS),$($(dir)_OBJS))
+else
# The following is to avoid reaching the maximum length of command line
# arguments, mainly present on MinGW.
define xxx_merged_obj_rule
@@ -445,6 +454,7 @@
endef
$(foreach dir, $(DIRS), $(eval $(call xxx_merged_obj_rule,$(dir))))
MERGED_OBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.o)
+endif
$(FLINT_DIR)/$(FLINT_LIB_STATIC): $(MERGED_OBJS)
@echo "Building $(FLINT_LIB_STATIC)"
diff -ruN flint-3.1.3-p1/configure.ac flint-3.1.3-p1-patched/configure.ac
--- flint-3.1.3-p1/configure.ac 2024-05-24 08:52:40
+++ flint-3.1.3-p1-patched/configure.ac 2024-10-20 23:25:02
@@ -129,7 +129,11 @@
dnl Get system triplet
dnl NOTE: This is already invoked from LT_INIT
+dnl AC_CANONICAL_BUILD
dnl AC_CANONICAL_HOST
+
+FLINT_BUILD_OS="${build_os}"
+AC_SUBST(FLINT_BUILD_OS)
################################################################################
# configure headers It differs from my proposal by "merging" except under GNU/Linux, rather than only under MinGW. |
For reference, the error output from the linker is simply
Asking for |
The work-around in question is here:
flint/Makefile.in
Lines 411 to 430 in 74907c3
Unfortunately, not all linkers support the
-r
option. Notably the MinGW backend forlld
, the LLVM linker, does not support it, preventing cross-compiling of FLINT under Unix foraarch64
Windows: https://github.com/llvm/llvm-project/blob/main/lld/MinGW/Options.tdCan this work-around be used only on Windows and systems where it is known to be necessary?
The text was updated successfully, but these errors were encountered: