summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-11-26 17:21:12 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-03-05 22:22:40 -0500
commit37f257afcd6a52cf4d76c60d766b1aeb520b9f05 (patch)
treeac800e46fbf94c16ce39170f4a720637b07dde06 /rules
parent646b6dfbe125aa756a935e840979ba11b4a882c0 (diff)
downloadhaskell-37f257afcd6a52cf4d76c60d766b1aeb520b9f05.tar.gz
Rip out object splitting
The splitter is an evil Perl script that processes assembler code. Its job can be done better by the linker's --gc-sections flag. GHC passes this flag to the linker whenever -split-sections is passed on the command line. This is based on @DemiMarie's D2768. Fixes Trac #11315 Fixes Trac #9832 Fixes Trac #8964 Fixes Trac #8685 Fixes Trac #8629
Diffstat (limited to 'rules')
-rw-r--r--rules/build-package-way.mk5
-rw-r--r--rules/build-perl.mk78
-rw-r--r--rules/distdir-opts.mk8
-rw-r--r--rules/distdir-way-opts.mk1
4 files changed, 0 insertions, 92 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index f9eca23cce..122ec60a90 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -74,12 +74,7 @@ else # ifneq "$3" "dyn"
# Build the ordinary .a library
$$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS)
$$(call removeFiles,$$@ $$@.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) >> $$@.contents
-else
echo $$($1_$2_$3_ALL_OBJS) >> $$@.contents
-endif
ifeq "$$($1_$2_ArSupportsAtFile)" "YES"
$$(call cmd,$1_$2_AR) $$($1_$2_AR_OPTS) $$($1_$2_EXTRA_AR_ARGS) $$@ @$$@.contents
else
diff --git a/rules/build-perl.mk b/rules/build-perl.mk
deleted file mode 100644
index 6bec7d93e7..0000000000
--- a/rules/build-perl.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# -----------------------------------------------------------------------------
-#
-# (c) 2009 The University of Glasgow
-#
-# This file is part of the GHC build system.
-#
-# To understand how the build system works and how to modify it, see
-# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
-# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
-#
-# -----------------------------------------------------------------------------
-
-
-# Build a perl script. Invoke like this:
-#
-# driver/mangler_PERL_SRC = ghc-asm.pl
-# driver/mangler_dist_PROGNAME = ghc-asm
-#
-# $(eval $(call build-perl,driver/mangler,dist))
-
-define build-perl
-$(call trace, build-perl($1,$2))
-$(call profStart, build-perl($1,$2))
-# $1 = dir
-# $2 = distdir
-
-ifeq "$$($1_$2_PROGNAME)" ""
-$$(error $1_$2_PROGNAME is not set)
-endif
-ifneq "$$($1_$2_PROG)" ""
-$$(error $1_$2_PROG is set)
-endif
-$1_$2_PROG = $$($1_$2_PROGNAME)
-
-ifneq "$$($$($1_$2_PROG)_INPLACE)" ""
-$$(error $$($1_$2_PROG)_INPLACE defined twice)
-endif
-ifeq "$$($1_$2_TOPDIR)" "YES"
-$$($1_$2_PROG)_INPLACE = $$(INPLACE_LIB)/bin/$$($1_$2_PROG)
-else
-$$($1_$2_PROG)_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG)
-endif
-
-$1_$2_INPLACE = $$($$($1_$2_PROG)_INPLACE)
-
-$(call all-target,$1_$2,$$($1_$2_INPLACE))
-
-$(call clean-target,$1,$2,$1/$2 $$($1_$2_INPLACE))
-.PHONY: clean_$1
-clean_$1 : clean_$1_$2
-
-ifneq "$$(BINDIST)" "YES"
-
-$1/$2/$$($1_$2_PROG): $1/$$/$$($1_PERL_SRC) $$$$(unlit_INPLACE) | $$$$(dir $$$$@)/.
- $$(call removeFiles,$$@)
- echo '#!$$(PERL)' >> $$@
- echo 'my $$$$TARGETPLATFORM = "$$(TARGETPLATFORM)";' >> $$@
- echo 'my $$$$TABLES_NEXT_TO_CODE = "$(GhcEnableTablesNextToCode)";' >> $$@
- cat $$< >> $$@
-
-$$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) | $$$$(dir $$$$@)/.
- "$$(CP)" $$< $$@
- $$(EXECUTABLE_FILE) $$@
-endif
-
-ifeq "$$($1_$2_INSTALL)" "YES"
-# Don't add to INSTALL_BINS or INSTALL_LIBEXECS, because they will get
-# stripped when calling 'make install-strip', and stripping a Perl script
-# doesn't work.
-ifeq "$$($1_$2_TOPDIR)" "YES"
-INSTALL_LIBEXEC_SCRIPTS += $$($1_$2_INPLACE)
-else
-INSTALL_SCRIPTS += $$($1_$2_INPLACE)
-endif
-endif
-
-$(call profEnd, build-perl($1,$2))
-endef
diff --git a/rules/distdir-opts.mk b/rules/distdir-opts.mk
index 6cabac35d2..b8f10bb2ca 100644
--- a/rules/distdir-opts.mk
+++ b/rules/distdir-opts.mk
@@ -89,14 +89,6 @@ $1_$2_ALL_HAPPY_OPTS = \
$$($1_$2_HAPPY_OPTS) \
$$(EXTRA_HAPPY_OPTS)
-# We don't bother splitting the bootstrap packages (built with stage 0)
-ifeq "$$($1_$2_SplitObjs)" ""
-ifeq "$$(SplitObjs) $3" "YES 1"
-$1_$2_SplitObjs = YES
-else
-$1_$2_SplitObjs = NO
-endif
-endif
# Disable split sections when building with stage0, it won't be supported yet
# and it's probably not very relevant anyway (smaller stage1 ghc?).
ifeq "$$($1_$2_SplitSections)" ""
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index 9166abc378..de2e45d4b9 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -163,7 +163,6 @@ $1_$2_$3_MOST_DIR_HC_OPTS = \
$1_$2_$3_ALL_HC_OPTS = \
-hisuf $$($3_hisuf) -osuf $$($3_osuf) -hcsuf $$($3_hcsuf) \
$$($1_$2_$3_MOST_DIR_HC_OPTS) \
- $$(if $$(findstring YES,$$($1_$2_SplitObjs)),$$(if $$(findstring dyn,$3),,-split-objs),) \
$$(if $$(findstring YES,$$($1_$2_SplitSections)),$$(if $$(findstring dyn,$3),,-split-sections),) \
$$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),$$(if $$(findstring v,$3),-dynamic-too))