The work-around in question is here:
|
ifneq ($(SHARED), 0) |
|
shared: $(FLINT_DIR)/$(FLINT_LIB_FULL) |
|
|
|
# The following is to avoid reaching the maximum length of command line |
|
# arguments, mainly present on MinGW. |
|
define xxx_merged_lobj_rule |
|
$(BUILD_DIR)/$(1)_merged.lo: $($(1)_LOBJS) | $(BUILD_DIR) |
|
@$(LD) -r $($(1)_LOBJS) -o $(BUILD_DIR)/$(1)_merged.lo |
|
endef |
|
$(foreach dir, $(DIRS), $(eval $(call xxx_merged_lobj_rule,$(dir)))) |
|
MERGED_LOBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.lo) |
|
|
|
$(FLINT_DIR)/$(FLINT_LIB_FULL): $(MERGED_LOBJS) |
|
@echo "Building $(FLINT_LIB_FULL)" |
|
@$(CC) $(CFLAGS) -shared $(EXTRA_SHARED_FLAGS) $(MERGED_LOBJS) -o $(FLINT_LIB_FULL) $(LDFLAGS) $(LIBS) |
|
@$(RM_F) $(FLINT_LIB) |
|
@$(RM_F) $(FLINT_LIB_MAJOR) |
|
@$(LN_S) $(FLINT_LIB_FULL) $(FLINT_LIB) |
|
@$(LN_S) $(FLINT_LIB_FULL) $(FLINT_LIB_MAJOR) |
|
endif |
Unfortunately, not all linkers support the -r option. Notably the MinGW backend for lld, the LLVM linker, does not support it, preventing cross-compiling of FLINT under Unix for aarch64 Windows: https://github.com/llvm/llvm-project/blob/main/lld/MinGW/Options.td
Can this work-around be used only on Windows and systems where it is known to be necessary?
The work-around in question is here:
flint/Makefile.in
Lines 411 to 430 in 74907c3
Unfortunately, not all linkers support the
-roption. Notably the MinGW backend forlld, the LLVM linker, does not support it, preventing cross-compiling of FLINT under Unix foraarch64Windows: 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?