| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves all URL references to Trac Wiki to their corresponding
GitLab counterparts.
This substitution is classified as follows:
1. Automated substitution using sed with Ben's mapping rule [1]
Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...
New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...
2. Manual substitution for URLs containing `#` index
Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz
New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz
3. Manual substitution for strings starting with `Commentary`
Old: Commentary/XxxYyy...
New: commentary/xxx-yyy...
See also !539
[1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
https://phabricator.haskell.org/D5169 built libghci for both vanilla way
and profiling way. We need to include both in the bindist list so they
will be installed.
Test Plan:
```
$ grep '^BuildFlavour' mk/build.mk
BuildFlavour=perf
$ make test_bindist
$ grep HSghc-prim bindist-list.uniq
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.o
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.p_o
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3.a
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3-ghc8.7.20190101.so
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3_p.a
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We do this for vanilla way already.
Let's also merge sections for profiling way and use it instead of the .a
library when it exists.
Test Plan:
```
$ inplace/bin/ghc-stage2 --interactive -prof -fexternal-interpreter
GHCi, version 8.7.20180921: http://www.haskell.org/ghc/ :? for help
Prelude> pid <- System.Posix.Process.getProcessID
Prelude> maps <- readFile $ "/proc/" ++ show pid ++ "/maps"
Prelude> pid
3807346
Prelude> putStrLn $ unlines $ take 20 $ lines maps
00400000-02103000 r-xp 00000000 00:1a 199277344
/data/users/watashi/ghc/inplace/lib/bin/ghc-iserv-prof
02104000-02106000 r--p 01d03000 00:1a 199277344
/data/users/watashi/ghc/inplace/lib/bin/ghc-iserv-prof
02106000-02417000 rw-p 01d05000 00:1a 199277344
/data/users/watashi/ghc/inplace/lib/bin/ghc-iserv-prof
02417000-0280a000 rw-p 00000000 00:00 0
[heap]
40098000-400b0000 rwxp 000d2000 00:1a 199276023
/data/users/watashi/ghc/libraries/bytestring/dist-install/build/HSbytestring-0.10.8.2.p_o
400b7000-400d8000 rwxp 00000000 00:00 0
401d1000-401d2000 rwxp 000e9000 00:1a 199276023
/data/users/watashi/ghc/libraries/bytestring/dist-install/build/HSbytestring-0.10.8.2.p_o
40415000-40419000 rwxp 0000b000 00:1a 199275165
/data/users/watashi/ghc/libraries/deepseq/dist-install/build/HSdeepseq-1.4.4.0.p_o
404f8000-40526000 rwxp 000af000 00:1a 199274234
/data/users/watashi/ghc/libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.p_o
```
Reviewers: simonmar, bgamari, austin, hvr
Reviewed By: simonmar
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5169
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
ld.gold is buggy when using -r and a linker script. See upstream bug
https://sourceware.org/bugzilla/show_bug.cgi?id=22266
This has been causing various brokenness for the GHC runtime linker,
where we load these broken object files.
Test Plan: Test program from #14675
Reviewers: bgamari, RyanGlScott, alpmestan, hvr, erikd
Subscribers: rwbarton, thomie, erikd, carter
GHC Trac Issues: #14328, #14675, #14291
Differential Revision: https://phabricator.haskell.org/D4431
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This tool can be used to generate dll's for any list of object files
given to it. It will then repartition them automatically to fit within
a dll and generates as many dll's as needed to do this. Cyclic dependencies
between these generated dlls are handle automatically so there is no need
to tell it how to partition.
It is also a lot more general than `dll-split` as it is able to split any
package not just `libGHC`. It also uses a trick using GNU style import libraries
to hide the splitting from the rest of the pipeline. Which means come linking time
you don't need to know which dll contains what symbol or how many split dlls were
created.
The import libraries are by default created with libtool. However since libtool is BFD
based it is very slow. So if present and detected by configure the `genlib` tool
from the msys2 project is used. This makes a difference of about ~45 minutes when compiling.
To install `genlib` run `pacman -Sy mingw-w64-$(uname -m)-tools-git`.
More detailed explaination of the process can be found here
https://ghc.haskell.org/trac/ghc/wiki/WindowsDynamicLinking
Test Plan: ./validate
Reviewers: austin, hvr, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: snowleopard, rwbarton, thomie, erikd, #ghc_windows_task_force
GHC Trac Issues: #5987
Differential Revision: https://phabricator.haskell.org/D3883
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes dll-split from the code base, the reason is dll-split
no longer makes any sense. It was designed to split a dll in two, but we
now already have many more symbols than would fit inside two dlls. So we
need a third one. This means there's no point in having to maintain this
list as it'll never work anyway and the solution isn't scalable.
Test Plan: ./validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, #ghc_windows_task_force
GHC Trac Issues: #5987
Differential Revision: https://phabricator.haskell.org/D3882
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Initial implementation of split-section on Windows.
This also corrects section namings and uses the platform
convention of `$` instead of `.` to separate sections.
Implementation is based on @awson's patches to binutils.
Binutils requires some extra help when compiling the libraries
for GHCi usage. We drop the `-T` and use implicit scripts to amend
the linker scripts instead of replacing it.
Because of these very large GHCi object files, we need big-obj support,
which will be added by another patch.
Test Plan: ./validate
Reviewers: awson, austin, bgamari
Subscribers: dfeuer, rwbarton, thomie, snowleopard, #ghc_windows_task_force
GHC Trac Issues: #12913
Differential Revision: https://phabricator.haskell.org/D3383
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The build failure when cross-compiling from
linux to windows looks like:
HC [stage 1] ghc/stage2/build/tmp/ghc-stage2.exe
Call hs_init_ghc() from your main() function to set these options.
/usr/libexec/gcc/i686-w64-mingw32/ld: cannot find -lHSghc-8.3-0
Similar to commit 745032dd02da511067c2939259ed212852187e0f
("rts: tweak cross-compilation to mingw32") decision to split
stage2 should be done based based on TargetOS, not HostOS.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: http://www.haskell.org/ghc/ :? 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: http://www.haskell.org/ghc/ :? 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: https://phabricator.haskell.org/D3298
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is two types of options passed directly to 'ld'
(and not to 'gcc' driver):
- CONF_LD_LINKER_OPTS_STAGE$4
- EXTRA_LD_OPTS
This changedoes two things:
- split 'EXTRA_LD_OPTS' into two variables:
- EXTRA_LD_OPTS (accepts 'gcc' wrapper options)
- EXTRA_LD_LINKER_OPTS (accepts raw 'ld' options)
- wraps all LD_LINKER options as '-Wl,' when passed
to 'gcc' driver.
Fixes https://phabricator.haskell.org/D2776
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Only use the merge_sections.ld linker script if SplitSections is enabled.
I thought I had a way to make the linker script actually work on Windows
and produce object files instead of image files (by using the "INSERT AFTER"
linker script command to get the default script's output format setting),
but that fix caused ghci to crash with an illegal instruction on startup.
Gave up and made a simpler fix of just disabling this for normal builds,
as it's only really relevant with SplitSections enabled anyway.
Reviewers: austin, thomie, bgamari
Reviewed By: austin, thomie
Subscribers: Phyx, thomie
Differential Revision: https://phabricator.haskell.org/D1505
GHC Trac Issues: #8405
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a flag -split-sections that does similar things to
-split-objs, but using sections in single object files instead of
relying on the Satanic Splitter and other abominations. This is very
similar to the GCC flags -ffunction-sections and -fdata-sections.
The --gc-sections linker flag, which allows unused sections to actually
be removed, is added to all link commands (if the linker supports it) so
that space savings from having base compiled with sections can be
realized.
Supported both in LLVM and the native code-gen, in theory for all
architectures, but really tested on x86 only.
In the GHC build, a new SplitSections variable enables -split-sections
for relevant parts of the build.
Test Plan: validate with both settings of SplitSections
Reviewers: dterei, Phyx, austin, simonmar, thomie, bgamari
Reviewed By: simonmar, thomie, bgamari
Subscribers: hsyl20, erikd, kgardas, thomie
Differential Revision: https://phabricator.haskell.org/D1242
GHC Trac Issues: #8405
|
|
|
|
|
|
|
| |
This reverts commit 9fc2d777f53110040f48ab27643a16888fa377f5.
This appears to cause interface file issues during rebuilds. Punting
back to @thomie for further investigation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The current scheme in rules/distdir-way-opts.mk is something like this:
GHC_LD_OPTS = MOST_HC_OPTS + ALL_LD_OPTS
MOST_DIR_HC_OPTS = MOST_HC_OPTS + -odir,-hidir,-stubdir
ALL_HC_OPTS = MOST_DIR_HC_OPTS +
-hisuf,-osuf,-hcsuf,-split-objs,-dynamic-too
Notice that both ALL_HC_OPTS and GHC_LD_OPTS include MOST_HC_OPTS, and
currently both got added when linking. Adding MOST_HC_OPTS twice results
in overly long and hard to decipher command lines (and build logs). This
commit fixes that.
Afaik, -odir,-hidir,-stubdir,-hisuf,-osuf,-hcsuf,-spit-objs,-dynamic-too
are all not needed when linking, so this change should be safe to make.
GHC_LD_OPTS is for linking, ALL_HC_OPTS is for compiling.
ALL_HC_OPTS was added to the linking commands in
37a6a52facd1c3999ce4472c50b0030568be1e04, to make sure
-no-user-package-conf would be in the options list. It still is after
this change.
Reviewers: austin, bgamari
Differential Revision: https://phabricator.haskell.org/D1379
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are multiple hacks all over the build system to account for the
fact that the ghc package uses different build subdirectories
(stage1/stage2) than the other packages (dist/dist-install).
One such hack filtered on 'ghc%', with the intention of filtering the
ghc package only. After renaming bin-package-db to ghc-boot
(d2f9972a35ce05ceb8a78893e433ef1df06f73ef, Phab:D1313, #10796), ghc-boot
also got caught in the hack, which broke the build when running without
parallelism.
This patch replaces the before mentioned hack by a different one, such
that filtering on 'ghc%' is no longer necessary. See Note [inconsistent
distdirs].
Reviewed by: austin
Differential Revision: https://phabricator.haskell.org/D1333
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, we used $1_$2_PACKAGE_KEY to parametrize $1. But the
documentation says that $1 should be the directory... and we're now
putting the libraries in $1_$2_LIB_NAME. So use /that/. This is just
alpha-renaming, so as long as we're consistent, there's no material
difference.)
I also fixed a bug of a package ID calculation which I missed first
time around, which was tickled by this change.
BTW, this means DEP_KEYS and TRANSITIVE_DEP_KEYS are unused, so
remove them from ghc-cabal.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: austin
Subscribers: thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D1010
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When we introduced user-friendly library names
(e.g. unix-2.7.1.0-G4Yo1pNtYrk8nCq1cx8P9d instead of
unix_G4Yo1pNtYrk8nCq1cx8P9d) we added a new variable to
be written out by ghc-cabal, $1_$2_LIB_NAME.
What I didn't realize at the time was that this conflicts
with an existing variable in the build system, $1_$2_$3_LIB_NAME,
which (confusingly) refers to something like
'libHSunix-2.7.1.0-G4Yo1pNtYrk8nCq1cx8P9d.so'. This is pretty
confusing (despite never conflicting), so I renamed this variable
to LIB_FILE for enhanced greppability.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: austin
Subscribers: thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D1002
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the library file name format
NOTE: This patch originally updated to Cabal HEAD, but was reduced to
update to Cabal 1.22 HEAD by hvr as this is needed in order to
update the filepath submodule to version 1.4.0, and subsequently
to be cherry-picked into the ghc-7.10 branch
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D707
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch set makes us no longer assume that a package key is a human
readable string, leaving Cabal free to "do whatever it wants" to allocate
keys; we'll look up the PackageId in the database to display to the user.
This also means we have a new level of qualifier decisions to make at the
package level, and rewriting some Safe Haskell error reporting code to DTRT.
Additionally, we adjust the build system to use a new ghc-cabal output
Make variable PACKAGE_KEY to determine library names and other things,
rather than concatenating PACKAGE/VERSION as before.
Adds a new `-this-package-key` flag to subsume the old, erroneously named
`-package-name` flag, and `-package-key` to select packages by package key.
RFC: The md5 hashes are pretty tough on the eye, as far as the file
system is concerned :(
ToDo: safePkg01 test had its output updated, but the fix is not really right:
the rest of the dependencies are truncated due to the fact the we're only
grepping a single line, but ghc-pkg is wrapping its output.
ToDo: In a later commit, update all submodules to stop using -package-name
and use -this-package-key. For now, we don't do it to avoid submodule
explosion.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, simonmar, hvr, austin
Subscribers: simonmar, relrod, carter
Differential Revision: https://phabricator.haskell.org/D80
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
| |
|
|
|
|
| |
Part of #7833
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
In particular, this means that GHCi will use DLLs, rather than loading
object files itself.
|
| |
|
|
|
|
|
|
| |
We now put a handful of modules in a separate DLL.
For now the list is hand-written, but we could automate it in the
future.
|
| |
|
| |
|
|
|
|
| |
hs-suffix-rules now calls hs-suffix-rules-srcdir, saving some duplication
|
|
|
|
|
|
| |
I don't think we need these, and they haven't been doing anything
useful for dynamic-by-default builds anyway as they hardcode the 'v'
way.
|
|
|
|
| |
Based on a patch from markwright in #3072.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
When building things to run in the build tree, we want the install name
to be the location in the build tree.
Bindists may be installed somewhere other than the configured install
location, so we weren't even necessarily setting it to the right value.
|
| |
|
| |
|
|
|
|
|
| |
We don't use them (we use the .so/.dll instead), so no point generating
them.
|
|
|
|
|
|
|
| |
I've been meaning to track this one down for a long time.
Occasionally a build will fail with an error about a .so library being
truncated; the reason was that we weren't tracking the dependencies of
the GHC stage2 .so library correctly.
|
| |
|
|
|
|
|
| |
I don't think I completely understand what's going on here, but this
does seem to fix it, and morally it seems like the right thing.
|
|
|
|
|
| |
The test isn't very pretty; it involves trawling through the
objdump -p output. I couldn't find an easier way, unfortuantely.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change reduces the (default) verbosity of the build system.
This makes it easier to spot warnings in the output and, also, it
makes it easier to estimate how far along are we in the build process
by just glancing at the output.
To get the traditional fully verbose output, set V=1, like this:
make V=1
|
|/ |
|