summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-03-23 22:13:25 +0000
committerIan Lynagh <igloo@earth.li>2010-03-23 22:13:25 +0000
commit64c64a6e9b30e7c089cddfce23a8eb92d644d2eb (patch)
tree8937050792d77d581f368963e1793f01f9d50f5a
parent624e821201ed68425c906358f8d45a69f4e61093 (diff)
downloadhaskell-64c64a6e9b30e7c089cddfce23a8eb92d644d2eb.tar.gz
Tweak the Makefile code for making .a libs; fixes trac #3642
The main change is that, rather than using "xargs ar" we now put all the filenames into a file, and do "ar @file". This means that ar adds all the files at once, which works around a problem where files with the same basename in a later invocation were overwriting the existing file in the .a archive.
-rw-r--r--rules/build-package-way.mk13
1 files changed, 7 insertions, 6 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index 25aa74ffbc..735527c235 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -73,15 +73,16 @@ $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
endif
else
# Build the ordinary .a library
-ifeq "$$($1_$2_SplitObjs)" "YES"
$$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS)
- "$$(RM)" $$(RM_OPTS) $$@
- (echo $$($1_$2_$3_NON_HS_OBJS) `$$($1_$2_$3_MKSTUBOBJS)`; $$(FIND) $$(patsubst %.$$($3_osuf),%_$$($3_osuf)_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@
+ "$$(RM)" $$(RM_OPTS) $$@ $$@.contents
+ifeq "$$($1_$2_SplitObjs)" "YES"
+ $$(FIND) $$(patsubst %.$$($3_osuf),%_$$($3_osuf)_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print >> $$@.contents
+ echo $$($1_$2_$3_NON_HS_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` >> $$@.contents
else
-$$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS)
- "$$(RM)" $$(RM_OPTS) $$@
- echo $$($1_$2_$3_ALL_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@
+ echo $$($1_$2_$3_ALL_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` >> $$@.contents
endif
+ "$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ @$$@.contents
+ "$$(RM)" $$(RM_OPTS) $$@.contents
endif
$(call all-target,$1_$2,all_$1_$2_$3)