Commit a7be1631 authored by Simon Marlow's avatar Simon Marlow Committed by Ben Gamari
Browse files

Always build GHCi libs

Since the introduction of -split-sections, using GHCi with the RTS
linker is really slow:

$ time (echo :quit | ./inplace/bin/ghc-stage2 --interactive -fexternal-interpreter)
GHCi, version 8.1.20170304:  :? for help
Prelude> Leaving GHCi.

real        0m3.793s

(when we use `-fexternal-interpreter` it uses the RTS linker by default,
you can make it use the system linker by adding `-dynamic`)

Building the GHCi libs doesn't take much time or space in the GHC build,
but makes things much quicker for people using the RTS linker:

$ time (echo :quit | ./inplace/bin/ghc-stage2 --interactive -fexternal-interpreter)
GHCi, version 8.1.20170304:  :? for help
Prelude> Leaving GHCi.

real        0m0.285s

So I propose that we build and ship them unconditionally.

Test Plan: validate, perf tests above

Reviewers: bgamari, austin, niteria, erikd, Phyx

Reviewed By: bgamari

Subscribers: rwbarton, thomie, snowleopard

Differential Revision:
parent 899fb880
...@@ -32,11 +32,13 @@ endif ...@@ -32,11 +32,13 @@ endif
$1_$2_CONFIGURE_OPTS += --disable-library-for-ghci $1_$2_CONFIGURE_OPTS += --disable-library-for-ghci
ifeq "$$(filter v,$$($1_$2_WAYS))" "v" ifeq "$$(filter v,$$($1_$2_WAYS))" "v"
$1_$2_CONFIGURE_OPTS += --enable-library-vanilla $1_$2_CONFIGURE_OPTS += --enable-library-vanilla
# Build the GHCi lib even if GHCi is dynamic (and therefore won't use
# these by default), because they will be used by
# (a) ghci -fexternal-interpreter
# (b) statically-linked binaries that use the GHC package
ifeq "$$(GhcWithInterpreter)" "YES" ifeq "$$(GhcWithInterpreter)" "YES"
$1_$2_CONFIGURE_OPTS += --enable-library-for-ghci $1_$2_CONFIGURE_OPTS += --enable-library-for-ghci
endif endif
else else
$1_$2_CONFIGURE_OPTS += --disable-library-vanilla $1_$2_CONFIGURE_OPTS += --disable-library-vanilla
endif endif
...@@ -143,9 +143,6 @@ endif ...@@ -143,9 +143,6 @@ endif
endif endif
# Build the GHCi library # Build the GHCi library
$1_$2_GHCI_LIB = $$($1_$2_dyn_LIB)
ifeq "$3" "v" ifeq "$3" "v"
$1_$2_GHCI_LIB = $1/$2/build/HS$$($1_$2_COMPONENT_ID).$$($3_osuf) $1_$2_GHCI_LIB = $1/$2/build/HS$$($1_$2_COMPONENT_ID).$$($3_osuf)
ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES" ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES"
...@@ -164,7 +161,6 @@ $(call all-target,$1_$2,$$($1_$2_GHCI_LIB)) ...@@ -164,7 +161,6 @@ $(call all-target,$1_$2,$$($1_$2_GHCI_LIB))
endif endif
endif # "$$($1_$2_BUILD_GHCI_LIB)" "YES" endif # "$$($1_$2_BUILD_GHCI_LIB)" "YES"
endif # "$3" "v" endif # "$3" "v"
$(call profEnd, build-package-way($1,$2,$3)) $(call profEnd, build-package-way($1,$2,$3))
endef # build-package-way endef # build-package-way
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment