Skip to content

Commit d7a6d4e

Browse files
committed
Fix the ldd patch so that it works on Windows
1 parent eca229b commit d7a6d4e

File tree

1 file changed

+19
-42
lines changed

1 file changed

+19
-42
lines changed

bin/patch-ldd.diff

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,36 @@
11
diff --git a/Makefile.in b/Makefile.in
2-
index 0f25aa2b5..cc0e44708 100644
2+
index 0f25aa2b5..5c0166b99 100644
33
--- a/Makefile.in
44
+++ b/Makefile.in
5-
@@ -416,6 +416,10 @@ endif
5+
@@ -416,14 +416,7 @@ endif
66
ifneq ($(SHARED), 0)
77
shared: $(FLINT_DIR)/$(FLINT_LIB_FULL)
88

9-
+ifneq ($(strip $(filter gnu% linux-gnu%,@FLINT_BUILD_OS@)),)
10-
+# No command line length limitations under build_os=gnu*|linux-gnu*
9+
-# The following is to avoid reaching the maximum length of command line
10+
-# arguments, mainly present on MinGW.
11+
-define xxx_merged_lobj_rule
12+
-$(BUILD_DIR)/$(1)_merged.lo: $($(1)_LOBJS) | $(BUILD_DIR)
13+
- @$(LD) -r $($(1)_LOBJS) -o $(BUILD_DIR)/$(1)_merged.lo
14+
-endef
15+
-$(foreach dir, $(DIRS), $(eval $(call xxx_merged_lobj_rule,$(dir))))
16+
-MERGED_LOBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.lo)
1117
+MERGED_OBJS := $(foreach dir,$(DIRS),$($(dir)_OBJS))
12-
+else
13-
# The following is to avoid reaching the maximum length of command line
14-
# arguments, mainly present on MinGW.
15-
define xxx_merged_lobj_rule
16-
@@ -424,6 +428,7 @@ $(BUILD_DIR)/$(1)_merged.lo: $($(1)_LOBJS) | $(BUILD_DIR)
17-
endef
18-
$(foreach dir, $(DIRS), $(eval $(call xxx_merged_lobj_rule,$(dir))))
19-
MERGED_LOBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.lo)
20-
+endif
2118

2219
$(FLINT_DIR)/$(FLINT_LIB_FULL): $(MERGED_LOBJS)
2320
@echo "Building $(FLINT_LIB_FULL)"
24-
@@ -437,6 +442,10 @@ endif
21+
@@ -437,14 +430,7 @@ endif
2522
ifneq ($(STATIC), 0)
2623
static: $(FLINT_DIR)/$(FLINT_LIB_STATIC)
2724

28-
+ifneq ($(strip $(filter gnu% linux-gnu%,@FLINT_BUILD_OS@)),)
29-
+# No command line length limitations under build_os=gnu*|linux-gnu*
25+
-# The following is to avoid reaching the maximum length of command line
26+
-# arguments, mainly present on MinGW.
27+
-define xxx_merged_obj_rule
28+
-$(BUILD_DIR)/$(1)_merged.o: $($(1)_OBJS) | $(BUILD_DIR)
29+
- @$(LD) -r $($(1)_OBJS) -o $(BUILD_DIR)/$(1)_merged.o
30+
-endef
31+
-$(foreach dir, $(DIRS), $(eval $(call xxx_merged_obj_rule,$(dir))))
32+
-MERGED_OBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.o)
3033
+MERGED_OBJS := $(foreach dir,$(DIRS),$($(dir)_OBJS))
31-
+else
32-
# The following is to avoid reaching the maximum length of command line
33-
# arguments, mainly present on MinGW.
34-
define xxx_merged_obj_rule
35-
@@ -445,6 +454,7 @@ $(BUILD_DIR)/$(1)_merged.o: $($(1)_OBJS) | $(BUILD_DIR)
36-
endef
37-
$(foreach dir, $(DIRS), $(eval $(call xxx_merged_obj_rule,$(dir))))
38-
MERGED_OBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.o)
39-
+endif
4034

4135
$(FLINT_DIR)/$(FLINT_LIB_STATIC): $(MERGED_OBJS)
4236
@echo "Building $(FLINT_LIB_STATIC)"
43-
diff --git a/configure.ac b/configure.ac
44-
index 511d0be9a..9f161e490 100644
45-
--- a/configure.ac
46-
+++ b/configure.ac
47-
@@ -164,8 +164,12 @@ fi
48-
49-
dnl Get system triplet
50-
dnl NOTE: This is already invoked from LT_INIT
51-
+dnl AC_CANONICAL_BUILD
52-
dnl AC_CANONICAL_HOST
53-
54-
+FLINT_BUILD_OS="${build_os}"
55-
+AC_SUBST(FLINT_BUILD_OS)
56-
+
57-
################################################################################
58-
# configure headers
59-
################################################################################

0 commit comments

Comments
 (0)