10 months agoUse https links in user-facing startup and error messages
Ingo Blechschmidt [Fri, 14 Dec 2018 16:10:56 +0000 (11:10 -0500)] 
Use https links in user-facing startup and error messages

I consider myself lucky that in my circle of friends, `http` urls (as
opposed to `https` urls) are frowned upon in that we generally
apologize in the rase cases that we share an `http` url.

This pull request changes `http` links into their `https` analogues in
the following places:

* In the GHCI startup message (and parts of the User's Guide, where
there are verbatim transcripts of GHCi sessions).
* In a couple of error messages, asking the user to report a bug.

(I also took the liberty to change a single space before the reportabug
url into two spaces, harmonizing this occurence with the others.)

I'm not trying to start a war. I just had a moment to spare and felt
like preparing this diff. Merge or don't merge as you wish!

Reviewers: bgamari, erikd, simonmar

Subscribers: goldfire, rwbarton, carter

Differential Revision:

10 months agorts: Annotate fallthroughs in AArch64 linker
Ben Gamari [Fri, 14 Dec 2018 14:55:15 +0000 (09:55 -0500)] 
rts: Annotate fallthroughs in AArch64 linker

10 months agoUpdate -F RTS help:
Ömer Sinan Ağacan [Fri, 14 Dec 2018 04:31:00 +0000 (07:31 +0300)] 
Update -F RTS help:

- Add default value
- Update the help line as multiple short lines instead of one long line,
  for consistency with other lines.

Reviewers: simonmar, bgamari, erikd

Reviewed By: bgamari

Subscribers: rwbarton, carter

Differential Revision:

10 months agogitlab-ci: Bump Darwin boot compiler to 8.6.3
Ben Gamari [Thu, 13 Dec 2018 23:00:28 +0000 (18:00 -0500)] 
gitlab-ci: Bump Darwin boot compiler to 8.6.3

10 months agogitlab-ci: Add linters
Ben Gamari [Thu, 13 Dec 2018 18:53:27 +0000 (13:53 -0500)] 
gitlab-ci: Add linters

These are taken from our previous arcanist linters as well as the
gitolite hooks but with some heavy refactoring.

10 months agollvm-targets: Add amd64-unknown-freebsd triple
Ben Gamari [Thu, 13 Dec 2018 18:25:05 +0000 (13:25 -0500)] 
llvm-targets: Add amd64-unknown-freebsd triple

396aac4c65a47b6252e0a73d2a3066e924d53f11 added the
amd64-portbld-freebsd triple but #15718 suggests that we should rather
be using x86_64-unknown-freebsd. Not knowing which is correct I've left
the amd64-portbld- triplet in place.

10 months agotestsuite: Fix typo: integer-gimp /= integer-gmp
Ben Gamari [Thu, 13 Dec 2018 16:45:27 +0000 (11:45 -0500)] 
testsuite: Fix typo: integer-gimp /= integer-gmp

10 months agogitlab-ci: Add LLVM way
Ben Gamari [Thu, 13 Dec 2018 05:26:59 +0000 (00:26 -0500)] 
gitlab-ci: Add LLVM way

10 months agogitlab-ci: Enable darwin builds
Ben Gamari [Thu, 13 Dec 2018 05:26:19 +0000 (00:26 -0500)] 
gitlab-ci: Enable darwin builds

10 months agogitlab-ci: Don't save artifacts for unreg and integer-simple ways
Ben Gamari [Thu, 13 Dec 2018 05:25:58 +0000 (00:25 -0500)] 
gitlab-ci: Don't save artifacts for unreg and integer-simple ways

10 months agoAdd some complexities to Data.List documentation (#15003)
Sven Tennie [Wed, 5 Dec 2018 16:58:40 +0000 (17:58 +0100)] 
Add some complexities to Data.List documentation (#15003)

Describe complexity and add an example for `GHC.List.filter`.

10 months agollvmGen: Fix minor correctness issue
Gabor Greif [Tue, 20 Nov 2018 17:18:55 +0000 (18:18 +0100)] 
llvmGen: Fix minor correctness issue

The alias is of type i8, so its global variable name
should have type i8*. Anyway we should never deal
with pointers to (i8*)!

10 months agoFix broken link in comment (#16010)
Sven Tennie [Tue, 11 Dec 2018 17:04:20 +0000 (18:04 +0100)] 
Fix broken link in comment (#16010)

10 months agoRemove another unused import from WwLib
Simon Peyton Jones [Thu, 13 Dec 2018 23:37:04 +0000 (23:37 +0000)] 
Remove another unused import from WwLib

10 months agoShow recursive Stg bindings in Rec {} blocks
Ömer Sinan Ağacan [Thu, 13 Dec 2018 04:55:38 +0000 (07:55 +0300)] 
Show recursive Stg bindings in Rec {} blocks

Makes the printer same as Rec binding printer in Core

Reviewers: sgraf, bgamari

Reviewed By: sgraf

Subscribers: rwbarton, carter

Differential Revision:

10 months agotestsuite: Normalise away package name differences from safePkg01
Ben Gamari [Wed, 12 Dec 2018 21:57:01 +0000 (16:57 -0500)] 
testsuite: Normalise away package name differences from safePkg01

Spurious changes observed in a integer-simple build. In service of #16043.

10 months agotestsuite: Normalise away spurious differences in out-of-scope instances
Ben Gamari [Wed, 12 Dec 2018 21:45:55 +0000 (16:45 -0500)] 
testsuite: Normalise away spurious differences in out-of-scope instances

This fixes a variety of testsuite failures with integer-simple of the form

--- typecheck/should_fail/
+++ typecheck/should_fail/
@@ -12,7 +12,7 @@
           -- Defined in ‘integer-<IMPL>-<VERSION>:GHC.Integer.Type’
         instance Ord () -- Defined in ‘GHC.Classes’ 21 others
- three instances involving out-of-scope types
+ two instances involving out-of-scope types
         (use -fprint-potential-instances to see them all)
      In the expression: g A
       In an equation for ‘g’: g (B _ _) = g A

In service of fixing #16043.

10 months agotestsuite: Fix a number of GHCi-related failures due to integer-simple
Ben Gamari [Wed, 12 Dec 2018 21:42:37 +0000 (16:42 -0500)] 
testsuite: Fix a number of GHCi-related failures due to integer-simple

Towards fixing #16043.

10 months agotestsuite: Print which ways we are going to run
Ben Gamari [Wed, 12 Dec 2018 21:41:49 +0000 (16:41 -0500)] 
testsuite: Print which ways we are going to run

10 months agoconfigure: Disable LD_NO_GOLD logic when cross-compiling
Ben Gamari [Wed, 12 Dec 2018 17:17:21 +0000 (12:17 -0500)] 
configure: Disable LD_NO_GOLD logic when cross-compiling

This is generally terrible: see #16025. In short, we previously just blindly
used an un-prefixed ld for LD_NO_GOLD. This is blatantly wrong. Ideally we would
actually verify that is indeed broken (by binutils #22266) before
insisting on using another linker but sadly we cannot do so when cross-compiling
since this would require running host code.

For now we simply disable the LD_NO_GOLD logic when cross-compiling and hope
that the user has verified that their isn't affected by #22266.

10 months agoRetainerProfiler: Update retainer profiler debugging
Alexander Vershilov [Wed, 12 Dec 2018 14:53:57 +0000 (09:53 -0500)] 
RetainerProfiler: Update retainer profiler debugging

Debug code have not been updated for a long time,
now it's changed to it compiles with recent RTS.

Reviewers: bgamari, erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision:

10 months agotestsuite: Try accepting new output for memcpy test
Ben Gamari [Wed, 12 Dec 2018 04:55:47 +0000 (23:55 -0500)] 
testsuite: Try accepting new output for memcpy test

See #16037.

10 months agoEnable more GitLab CI ways
Ben Gamari [Wed, 12 Dec 2018 01:12:10 +0000 (20:12 -0500)] 
Enable more GitLab CI ways

But allow failure since CircleCI is still our source of truth.

10 months agogitlab-ci: Fix job names
Ben Gamari [Wed, 12 Dec 2018 01:03:35 +0000 (20:03 -0500)] 
gitlab-ci: Fix job names

10 months agogitlab-ci: Enable Haddock documentation
Ben Gamari [Sat, 1 Dec 2018 20:36:19 +0000 (15:36 -0500)] 
gitlab-ci: Enable Haddock documentation

10 months agoFix recompilation checking of pure plugins
Daniel Gröber [Tue, 11 Dec 2018 23:36:00 +0000 (18:36 -0500)] 
Fix recompilation checking of pure plugins

Previously when switching from using a Plugin with
`RecompMaybe`/`ForceRecompile` in `pluginRecompile` to a Plugin with
`NoForceRecompile` GHC would never even consider recompiling.

However the previously active plugin could have modified the
compilation output so we should recompile.

Test Plan: validate

Reviewers: bgamari, mpickering

Subscribers: mpickering, rwbarton, carter

GHC Trac Issues: #15858

Differential Revision:

10 months agoRemove dead code
Simon Peyton Jones [Wed, 12 Dec 2018 20:21:12 +0000 (20:21 +0000)] 
Remove dead code

This is a follow-up to
 d77501cd5b Improvements to demand analysis

I forgot to remove some now-dead code

10 months agoImprovements to demand analysis
Simon Peyton Jones [Wed, 12 Dec 2018 17:22:07 +0000 (17:22 +0000)] 
Improvements to demand analysis

This patch collects a few improvements triggered by Trac #15696,
and fixing Trac #16029

* Stop making toCleanDmd behave specially for unlifted types.
  This special case was the cause of stupid behaviour in Trac
  #16029.  And to my joy I discovered the let/app invariant
  rendered it unnecessary.  (Maybe the special case pre-dated
  the let/app invariant.)

  Result: less special-case handling in the compiler, and
  better perf for the compiled code.

* In WwLib.mkWWstr_one, treat seqDmd like U(AAA).  It was not
  being so treated before, which again led to stupid code.

* Update and improve Notes

There are .stderr test wibbles because we get slightly different
strictness signatures for an argumment of unlifted type:
    <L,U> rather than <S,U>        for Int#
    <S,U> rather than <S(S),U(U)>  for Int

10 months agoTypo fix, replace a foldl with foldl'
Ömer Sinan Ağacan [Wed, 12 Dec 2018 08:51:20 +0000 (11:51 +0300)] 
Typo fix, replace a foldl with foldl'

10 months agotestsuite: Mark linkwhole as broken on FreeBSD
Ben Gamari [Tue, 11 Dec 2018 22:57:11 +0000 (17:57 -0500)] 
testsuite: Mark linkwhole as broken on FreeBSD

See #16035.

10 months agotestsuite: Mark keep-cafs and keep-cafs-fail as broken on FreeBSD
Ben Gamari [Tue, 11 Dec 2018 22:51:21 +0000 (17:51 -0500)] 
testsuite: Mark keep-cafs and keep-cafs-fail as broken on FreeBSD

See #16035.

10 months agotestsuite: Skip T703 on non-Linux platforms
Ben Gamari [Tue, 11 Dec 2018 22:44:43 +0000 (17:44 -0500)] 
testsuite: Skip T703 on non-Linux platforms

While the test is in principle applicable to many platforms, the current
implementation requires readelf, which we can only assume is present on
ELF-based platforms (e.g. Linux).

See Trac #703.

10 months agotestsuite: Don't use sed -i in T15369
Ben Gamari [Tue, 11 Dec 2018 22:39:58 +0000 (17:39 -0500)] 
testsuite: Don't use sed -i in T15369

BSD sed doesn't allow use of sed -i on symlinks and the source file is symlinked
into place.

10 months agotestsuite: Ensure that unregisterised function is called
Ben Gamari [Tue, 11 Dec 2018 22:34:10 +0000 (17:34 -0500)] 
testsuite: Ensure that unregisterised function is called

Strangely the previous formulation works locally and under CircleCI but fails on
another machine. Odd.

10 months agoEnable rebindable fail with overloaded strings
Shayne Fletcher [Tue, 11 Dec 2018 18:49:48 +0000 (13:49 -0500)] 
Enable rebindable fail with overloaded strings

Summary: enable rebindable fail with overloaded strings

Reviewers: bgamari, simonpj

Reviewed By: bgamari, simonpj

Subscribers: simonpj, ndmitchell, rwbarton, carter

GHC Trac Issues: #15645

Differential Revision:

10 months agoExplicitly pass -fno-PIC to C compiler on linux
Zejun Wu [Tue, 11 Dec 2018 18:49:12 +0000 (13:49 -0500)] 
Explicitly pass -fno-PIC to C compiler on linux

Recent gcc on some linux ditributions may have -fPIC on by default

$ uname -a
Linux watashi-arch32 4.18.5-arch1-1.0-ARCH #1 SMP PREEMPT Tue Aug 28
20:45:30 CEST 2018 i686 GNU/Linux
$ gcc --version
gcc (GCC) 7.3.1 20180312
$ touch dummy.c
$ gcc -Q -v dummy.c 2>&1 | grep PIC
options enabled:  -fPIC -fPIE -faggressive-loop-optimizations

This results in following error for i686:

$ TEST=T13366 make test
unknown symbol `_GLOBAL_OFFSET_TABLE_'
ghc-stage2: unable to load package `ghc-prim-0.5.3'

As our runtime linker doesn't support R_386_GOTPC relocations at all
Also while we don't have such problem on x86_64, it's not desired to
build PIC objects either.

Test Plan: `TEST=T13366 make test` passed on

Reviewers: simonmar, bgamari, austin

Reviewed By: simonmar

Subscribers: rwbarton, carter

GHC Trac Issues: #15848

Differential Revision:

10 months agotestsuite: Add tests for #15270
Ben Gamari [Tue, 11 Dec 2018 18:48:08 +0000 (13:48 -0500)] 
testsuite: Add tests for #15270

Reviewers: alpmestan

Reviewed By: alpmestan

Subscribers: rwbarton, carter

Differential Revision:

10 months agoSupport generating HIE files
Alec Theriault [Tue, 11 Dec 2018 18:47:35 +0000 (13:47 -0500)] 
Support generating HIE files

Adds a `-fenable-ide-info` flag which instructs GHC to generate `.hie`
files (see the wiki page:

This is a rebased version of Zubin Duggal's (@wz1000) GHC changes for
his GSOC project, as posted here:

Test Plan: ./validate

Reviewers: bgamari, gershomb, nomeata, alanz, sjakobi

Reviewed By: alanz, sjakobi

Subscribers: alanz, hvr, sjakobi, rwbarton, wz1000, carter

Differential Revision:

10 months agoRTS linker: don't crash early when not finding extra-libraries
Kyrill Briantsev [Tue, 11 Dec 2018 18:45:10 +0000 (13:45 -0500)] 
RTS linker: don't crash early when not finding extra-libraries

Allow GHCi to not crash when no assumed DLL is found in the standard
location.  E.g. when loading the package built "dyn" way, we may well
have the package's DLL around, and it's the system linker which loads
necessary dependencies.

Why does this (partially) fix #11042? It's because we often (and when
having packages built `dyn` way -- almost always) don't need to load
anything recorded in the `extra-libraries` stanza, since if the package
DLL exists, GHCi linker simply calls the system linker (via `dlopen`/
`LoadLibrary` APIs) to load it and doesn't bother to load package
prelinked object file (if any) or package static library.

Thus, all "regular" (with no fancy low-level package content
manipulation) packages built "dyn" way should be OK after this fix.

Reviewers: hvr, bgamari, int-index

Reviewed By: bgamari, int-index

Subscribers: Phyx, int-index, rwbarton, carter

GHC Trac Issues: #11042

Differential Revision:

10 months agodmdAnal: Move handling of datacon strictness to mkWWstr_one
Ben Gamari [Tue, 11 Dec 2018 18:34:47 +0000 (13:34 -0500)] 
dmdAnal: Move handling of datacon strictness to mkWWstr_one

Previously datacon strictness was accounted for when we demand analysed a case
analysis. However, this results in pessimistic demands in some cases. For
instance, consider the program (from T10482)

    data family Bar a
    data instance Bar (a, b) = BarPair !(Bar a) !(Bar b)
    newtype instance Bar Int = Bar Int

    foo :: Bar ((Int, Int), Int) -> Int -> Int
    foo f k =
      case f of
        BarPair x y -> case burble of
                          True -> case x of
                                    BarPair p q -> ...
                          False -> ...

We really should be able to assume that `p` is already evaluated since it came
from a strict field of BarPair.

However, as written the demand analyser can not conclude this since we may end
up in the False branch of the case on `burble` (which places no demand on `x`).
By accounting for the data con strictness later, applied to the demand of the
RHS, we get the strict demand signature we want.

See Note [Add demands for strict constructors] for a more comprehensive

Test Plan: Validate

Reviewers: simonpj, osa1, goldfire

Subscribers: rwbarton, carter

GHC Trac Issues: #15696

Differential Revision:

10 months agoPPC NCG: Generate MO_?_QuotRem for subword sizes
Peter Trommler [Tue, 11 Dec 2018 18:22:00 +0000 (13:22 -0500)] 
PPC NCG: Generate MO_?_QuotRem for subword sizes

Handle Int*QuotRemOP and Word*QuotRemOp in PPC NCG.
Refactor common code with remainder operation.

Test Plan: validate (I validated on Linux powerpc64le and x86_64)

Reviewers: erikd, hvr, bgamari, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, carter

Differential Revision:

10 months agoSupport registering Plugins through the GHC API
Daniel Gröber [Tue, 11 Dec 2018 18:24:12 +0000 (13:24 -0500)] 
Support registering Plugins through the GHC API

This allows tooling using the GHC API to use plugins internally.
Hopefully this will make it possible to decouple the development of
useful plugins from (currently) kitchen-sink type tooling projects
such as ghc-mod or HIE -- at least to some extent.

Test Plan: validate

Reviewers: bgamari, mpickering

Subscribers: mpickering, alanz, rwbarton, carter

GHC Trac Issues: #15826

Differential Revision:

10 months agoPPC NCG: Implement MachOps for smaller sizes
Peter Trommler [Tue, 11 Dec 2018 18:21:50 +0000 (13:21 -0500)] 
PPC NCG: Implement MachOps for smaller sizes

Generate code for MachOps with smaller than wordsize data.
Refactor conversion MachOps.

Fixes #15854

Test Plan: validate (I validated on powerpc64le and x86_64 Linux)

Reviewers: bgamari, hvr, erikd, simonmar

Subscribers: rwbarton, carter

GHC Trac Issues: #15854

Differential Revision:

10 months agoMisleading msg with qualified imports "No module named X imported"
Roland Senn [Tue, 11 Dec 2018 18:20:37 +0000 (13:20 -0500)] 
Misleading msg with qualified imports "No module named X imported"

To check whether a given module has been imported, we do the following:
From the list of all qualified names we extract the distinct module
names to a list of module names.
Then we check whether the given module name is in this list of module

Test Plan: make test TEST=T14225

Reviewers: mpickering, hvr, monoidal, osa1, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #14225

Differential Revision:

10 months agoDo not save performance test results if worktree is dirty.
David Eichmann [Tue, 11 Dec 2018 18:19:50 +0000 (13:19 -0500)] 
Do not save performance test results if worktree is dirty.

Reviewers: bgamari, tdammers

Reviewed By: bgamari, tdammers

Subscribers: rwbarton, carter

GHC Trac Issues: #15924

Differential Revision:

10 months agoFix recompilation bug with default class methods (#15970)
Simon Marlow [Tue, 11 Dec 2018 18:18:47 +0000 (13:18 -0500)] 
Fix recompilation bug with default class methods (#15970)

If a module uses a class, then it can instantiate the class and
thereby use its default methods, so we must include the default
methods when calculating the fingerprint for the class.

Test Plan:
New unit test: driver/T15970


=====> T15970(normal) 1 of 1 [0, 0, 0]
cd "" && $MAKE -s --no-print-directory T15970
Wrong exit code for T15970()(expected 0 , actual 2 )
Stdout ( T15970 ):
Makefile:13: recipe for target 'T15970' failed
Stderr ( T15970 ):
C.o:function Main_zdfTypeClassMyDataType1_info: error: undefined
reference to 'A_toTypedData2_closure'
C.o:function Main_main1_info: error: undefined reference to
C.o(.data+0x298): error: undefined reference to 'A_toTypedData2_closure'
C.o(.data+0x480): error: undefined reference to 'A_toTypedData2_closure'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

After: test passes.

Reviewers: bgamari, simonpj, erikd, watashi, afarmer

Subscribers: rwbarton, carter

GHC Trac Issues: #15970

Differential Revision:

10 months agoFix uninformative hp2ps error when the cmdline contains double quotes
Zejun Wu [Tue, 11 Dec 2018 18:18:03 +0000 (13:18 -0500)] 
Fix uninformative hp2ps error when the cmdline contains double quotes

Reapply D5346 with fix incompatible shell quoting in tests. It seems
like `$'string'` is not recognized under all test environments, so let's
avoid it in tests.

Test Plan:
hp2ps: "T15904".hp, line 2: integer must follow identifier

use new ghc and hp2ps to profile a simple program.

Reviewers: simonmar, bgamari, erikd, tdammers

Reviewed By: bgamari

Subscribers: tdammers, carter, rwbarton

GHC Trac Issues: #15904

Differential Revision:

10 months agocosmetic change: expandtab in utils/hp2ps/HpFile.c
Zejun Wu [Tue, 11 Dec 2018 18:15:13 +0000 (13:15 -0500)] 
cosmetic change: expandtab in utils/hp2ps/HpFile.c

rGHCbba2b9bf2d69700dc114118658507aaac34c5e62 expand tabs in
utils/hp2ps/HpFile.c with tabwidth 2, but the code was written as
tabwidth 8.  This change simply retabs the code with tabwidth 8 and
removes trailing spaces.

Test Plan: Tested in stacked diff: {D5388}

Reviewers: simonmar, bgamari, afarmer, tdammers

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision:

10 months agocircleci: ignore gitlab branches for all jobs in the validate workflow
Alp Mestanogullari [Tue, 11 Dec 2018 18:11:46 +0000 (13:11 -0500)] 
circleci: ignore gitlab branches for all jobs in the validate workflow

Our previous attempt ended up breaking the CircleCI config, but
this one has been tested, see:

which shows the builds getting triggered correctly. I also pushed the same
branch under 'gitlab/alp/test', and that didn't trigger any build, as desired.

Reviewers: bgamari

Subscribers: rwbarton, carter

Differential Revision:

10 months agoHadrian: ability to run a subset of the testsuite
Alp Mestanogullari [Tue, 11 Dec 2018 18:11:32 +0000 (13:11 -0500)] 
Hadrian: ability to run a subset of the testsuite

This was supposed to be working already but didn't work when we
specified several tests with --only. This patch not only fixes this
but also makes it possible to specify a subset of tests to run with the
TEST environment variable, like the make build system. Here are some

    hadrian/ test --only=plugins01
    hadrian/ test --only="plugins01 plugins02"
    TEST="plugins01 plugins02" hadrian/ test
    TEST=plugins03 hadrian/ test --only="plugins01 plugins02"

When both the TEST environment variable and the --only flag are used,
we simply concatenate the list of tests from both sources and ask the
testsuite driver to run them all.

This patch addresses #16026.

Test Plan: hadrian/ test --only="plugins01 plugins02"

Reviewers: bgamari, snowleopard

Reviewed By: bgamari, snowleopard

Subscribers: rwbarton, carter

GHC Trac Issues: #16026

Differential Revision:

10 months agoHadrian: simple targets for building libraries and executables
Alp Mestanogullari [Tue, 11 Dec 2018 18:10:03 +0000 (13:10 -0500)] 
Hadrian: simple targets for building libraries and executables

This patch introduces (phony) build targets of the form

    (1) stage<N>:<lib>:<name>   (e.g: stage1:lib:Cabal)
    (2) stage<N>:<exe>:<name>   (e.g: stage2:exe:ghc-bin)

where (1) builds the given library with the stage N compiler and (2)
builds the given executable with the stage N-1 compiler. This patch may
be generating too many such targets but it's a first stab that we can

This fixes #15949.

Test Plan: hadrian/ stage1:exe:ghc-bin

Reviewers: bgamari, snowleopard

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15949

Differential Revision:

10 months agoconfigure: Don't use ln -v
Ben Gamari [Tue, 11 Dec 2018 18:02:50 +0000 (13:02 -0500)] 
configure: Don't use ln -v

There's no reason why we need to print the linked files and apparently
ln on OpenBSD doesn't support -v.

Fixes #15946.

Test Plan: Validate

Reviewers: monoidal

Reviewed By: monoidal

Subscribers: rwbarton, erikd, carter

GHC Trac Issues: #15946

Differential Revision:

10 months agoAdd +RTS -F to the --help output
Simon Marlow [Tue, 11 Dec 2018 18:02:37 +0000 (13:02 -0500)] 
Add +RTS -F to the --help output

Test Plan: `./inplace/bin/ghc-stage2 +RTS --help"

Reviewers: bgamari, sgraf, erikd

Reviewed By: sgraf

Subscribers: adamse, rwbarton, carter

Differential Revision:

10 months agoRevert dynamically linking ghc.
David Eichmann [Tue, 11 Dec 2018 18:02:25 +0000 (13:02 -0500)] 
Revert dynamically linking ghc.

Building a dynamically linked ghc is broken do to incorrectly building
and installing libffi. This disables building a dynamically linked ghc
and ghc-iserv-dyn while keeping most of the code in the relevant
commits: 79d5427e1 and 89fa34ecd

Test Plan:
Ensure build environment does NOT have a system libffi installed (you
may want to use a nix environment).
Then `hadrian/ -c --flavour=default`.

Reviewers: bgamari, alpmestan

Reviewed By: alpmestan

Subscribers: rwbarton, carter

GHC Trac Issues: #15837

Differential Revision:

10 months agocircleci: Add integer-simple build target
Ben Gamari [Tue, 11 Dec 2018 18:01:00 +0000 (13:01 -0500)] 
circleci: Add integer-simple build target

Fixes #15915.

10 months agotestsuite: Mark tickets identified in #15467 as broken
Ben Gamari [Tue, 11 Dec 2018 03:01:48 +0000 (22:01 -0500)] 
testsuite: Mark tickets identified in #15467 as broken

10 months agorts: Disable fallthrough attribute when compiling with Clang
Ben Gamari [Tue, 11 Dec 2018 02:48:51 +0000 (21:48 -0500)] 
rts: Disable fallthrough attribute when compiling with Clang

Apparently clang doesn't enable implicitly fallthrough warnings by default when compiling
C and the attribute cause warnings of their own (#16019).

10 months agoutils/gen-dll: Bump containers upper bound
Ben Gamari [Sun, 9 Dec 2018 20:28:52 +0000 (15:28 -0500)] 
utils/gen-dll: Bump containers upper bound

Fixes #16023.

10 months agoCircleCI: Add configurations for Centos 7 and Debian 9
Ben Gamari [Sat, 8 Dec 2018 01:23:58 +0000 (20:23 -0500)] 
CircleCI: Add configurations for Centos 7 and Debian 9

10 months agotestsuite: Use explicit -e in sed command
Ben Gamari [Sun, 9 Dec 2018 16:05:52 +0000 (11:05 -0500)] 
testsuite: Use explicit -e in sed command

Otherwise Darwin's sed interprets the command as the suffix for -i.

10 months agoFix #16008 with a pinch of addConsistencyConstraints
Ryan Scott [Tue, 11 Dec 2018 11:22:49 +0000 (06:22 -0500)] 
Fix #16008 with a pinch of addConsistencyConstraints

#16008 happened because we forgot to typecheck nullary
associated type family instances in a way that's consistent with the
type variables bound by the parent class. Oops. Easily fixed with a
use of `checkConsistencyConstraints`.

Test Plan: make test TEST=T16008

Reviewers: simonpj, goldfire, bgamari

Reviewed By: goldfire

Subscribers: rwbarton, carter

GHC Trac Issues: #16008

Differential Revision:

10 months agoFix minor mistake in comment about data decls.
Richard Eisenberg [Mon, 10 Dec 2018 03:26:43 +0000 (22:26 -0500)] 
Fix minor mistake in comment about data decls.

Fixes #16024. [skip ci]

10 months agohadrian: Drop nix build script
Ben Gamari [Sat, 8 Dec 2018 17:57:59 +0000 (17:57 +0000)] 
hadrian: Drop nix build script

It's currently too out-of-date to build current hadrian and is arguably
completely broken anyways (see #15794).

10 months agotestsuite: 32-bit expected output for T15460
Ben Gamari [Sat, 8 Dec 2018 14:35:40 +0000 (09:35 -0500)] 
testsuite: 32-bit expected output for T15460

10 months agorts: Ensure that task->id is initialized
Ben Gamari [Sat, 8 Dec 2018 04:25:53 +0000 (23:25 -0500)] 
rts: Ensure that task->id is initialized

Reviewers: erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision:

10 months agoUse --no-as-needed with LLD too
Simon Marlow [Sat, 8 Dec 2018 04:25:40 +0000 (23:25 -0500)] 
Use --no-as-needed with LLD too

Test Plan: validate using LLD as the linker (TODO)

Reviewers: bgamari, angerman, kavon, erikd

Reviewed By: bgamari

Subscribers: watashi, rwbarton, carter

Differential Revision:

10 months agoAdd -fno-safe-haskell flag
Matthew Pickering [Sat, 8 Dec 2018 04:25:20 +0000 (23:25 -0500)] 
Add -fno-safe-haskell flag

This flag can be set to turn off the Safe Haskell checks.

Whether a module is marked Safe/Unsafe/Trustworthy is ignored when
this flag to set.

Reviewers: bgamari, tdammers

Reviewed By: tdammers

Subscribers: rwbarton, carter

GHC Trac Issues: #15920

Differential Revision:

10 months agoFix StgLint bound id check, generalize StgLint
Ömer Sinan Ağacan [Sat, 8 Dec 2018 04:23:10 +0000 (23:23 -0500)] 
Fix StgLint bound id check, generalize StgLint

StgLint was incorrectly using isLocalId for bound id check to see
whether an id is imported (in which case we don't expect it to be bound)
or local.  The problem with isLocalId is that its semantics changes
after Core, as explained in the note: (last line)

    Note [GlobalId/LocalId]
    A GlobalId is
      * always a constant (top-level)
      * imported, or data constructor, or primop, or record selector
      * has a Unique that is globally unique across the whole
        GHC invocation (a single invocation may compile multiple
      * never treated as a candidate by the free-variable finder;
            it's a constant!

    A LocalId is
      * bound within an expression (lambda, case, local let(rec))
      * or defined at top level in the module being compiled
      * always treated as a candidate by the free-variable finder

    After CoreTidy, top-level LocalIds are turned into GlobalIds

We now pass current module as a parameter to StgLint, which uses it to
see if an id should be bound (defined in the current module) or not

Other changes:

- Generalized StgLint to make it work on both StgTopBinding and
- Bring all top-level binders into scope before linting top-level
  bindings to allow uses before definitions.

TODO: We should remove the binder from local vars when checking RHSs of
non-recursive bindings.

Test Plan: This validates.

Reviewers: simonpj, bgamari, sgraf

Reviewed By: simonpj, sgraf

Subscribers: rwbarton, carter

Differential Revision:

10 months agoFix #15369: GHCi doesn't honor :set +c when loading for a second time
Roland Senn [Sat, 8 Dec 2018 04:22:40 +0000 (23:22 -0500)] 
Fix #15369: GHCi doesn't honor :set +c when loading for a second time

The decision to (re)collect the type info for a (re)loaded module is
now taken only by comparing the file timestamps of the .hs file of the
module. (Or form the .o file if the .hs file is missing).
If the file timestamp changes, we (re)collect the type info.
The timestamp of the processing time of the last collect is no longer

Test Plan: make test TEST=T15369

Reviewers: alanz, hvr, monoidal, osa1, thomie, bgamari, tdammers

Reviewed By: tdammers

Subscribers: rwbarton, carter

GHC Trac Issues: #15369

Differential Revision:

10 months agoAdd haddock for Node in Digraph. [skip ci] [Sat, 8 Dec 2018 04:22:08 +0000 (23:22 -0500)] 
Add haddock for Node in Digraph. [skip ci]

Test Plan: make

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, carter

Differential Revision:

10 months agoRemove redundant include of Rts.h in EventLogWriter.h
Zejun Wu [Sat, 8 Dec 2018 04:21:00 +0000 (23:21 -0500)] 
Remove redundant include of Rts.h in EventLogWriter.h

`EventLogWriter.h` doesn't use anything from `Rts.h`, the include is
redundant. This include is ignored when we include

Rts.h -> RtsAPI.h -> rts/EventLogWriter.h -> Rts.h

but can can cause problem when we include `RtsApi.h` directly with
errors like

In file included from /usr/lib/ghc-8.6.2/include/RtsAPI.h:20:
In file included from
In file included from /usr/lib/ghc-8.6.2/include/Rts.h:185:
/usr/lib/ghc-8.6.2/include/rts/storage/GC.h:187:29: error: unknown type
name 'Capability'
StgPtr  allocate          ( Capability *cap, W_ n );

Test Plan: ./validate

Reviewers: simonmar, bgamari, afarmer, erikd, alexbiehl

Reviewed By: bgamari, alexbiehl

Subscribers: rwbarton, carter

Differential Revision:

10 months agoRename "changed" to "no-change" in HscMain
Ömer Sinan Ağacan [Sat, 8 Dec 2018 04:20:42 +0000 (23:20 -0500)] 
Rename "changed" to "no-change" in HscMain

hscSimpleIface is returning a bool for whether there were _no changes_
in the iface file. The same bool is called "no_change_at_all" in
mkIface_, and "no_change" in hscWriteIface and other functions. However
it is called "changed" in HscMain.finish and hscMaybeWriteIface, which
is confusing because "changed" and "no_change" have opposite meanings.
This patch renames "changed" to "no_change" to fix this.

Reviewers: simonpj, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, carter

Differential Revision:

10 months agoHadrian: fix dynamicGhcPrograms value for the quickest flavour
Alp Mestanogullari [Sat, 8 Dec 2018 04:20:23 +0000 (23:20 -0500)] 
Hadrian: fix dynamicGhcPrograms value for the quickest flavour

Quickest does not build anything in a dynamic way, so that
flavour should default to not building "ghc programs" dynamically.

I ran into this problem by building the 'docs' target with quickest,
which failed because at some point we run a haddock command in a
context whose Way is sensitive to dynamicGhcPrograms, and it
started looking for dyn interface files when it shouldn't have.

Test Plan: hadrian/ --flavour=quickest docs

Reviewers: snowleopard, bgamari

Reviewed By: snowleopard

Subscribers: rwbarton, carter

Differential Revision:

10 months agoMark SRT_1/SRT_2 as CONSTR_1_0/CONSTR_2_0
Ömer Sinan Ağacan [Sat, 8 Dec 2018 04:20:10 +0000 (23:20 -0500)] 
Mark SRT_1/SRT_2 as CONSTR_1_0/CONSTR_2_0

Test Plan:
Validated locally, but skipped perf tests as there's a
framework-related error

Reviewers: simonmar, bgamari, erikd

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision:

10 months agohadrian: eliminate most of the remaining big rule enumerations
Alp Mestanogullari [Sat, 8 Dec 2018 04:19:36 +0000 (23:19 -0500)] 
hadrian: eliminate most of the remaining big rule enumerations

Following what was done to Rules.Library some time ago and to
Rules.Compile recently (D5412), this patch moves more rules away from
the "enumerate a lot of contexts and generate one rule for each" style
and instead uses the "parse data from file path to recover context"
approach. In fact, the only rules left to convert seem to be the ones
from Rules.Generate.

This effectively decreases the pauses described in #15938 further as
well as the amount of allocations and GC that we do, unsurprisingly.
Nowhere as drastically as D5412, though.

Test Plan: perform full build and generate docs

Reviewers: snowleopard, bgamari

Reviewed By: snowleopard

Subscribers: rwbarton, carter

GHC Trac Issues: #15938

Differential Revision:

10 months agoRequire 'libdw' for '--enable-dwarf-unwind'
Alec Theriault [Sat, 8 Dec 2018 04:18:15 +0000 (23:18 -0500)] 
Require 'libdw' for '--enable-dwarf-unwind'

This causes './configure --enable-dwarf-unwind' to exit with a helpful
error message when 'libdw' cannot be found (compared to the previous
behaviour of silently pretending the user hadn't requested DWARF support
at all).

Test Plan: ./configure --enable-dwarf-unwind # on systems with/without

Reviewers: bgamari, nh2

Reviewed By: nh2

Subscribers: nh2, rwbarton, erikd, carter

GHC Trac Issues: #15968

Differential Revision:

10 months agoMark broken tests on powerpc64le and skip ghci-ext
Peter Trommler [Sat, 8 Dec 2018 04:17:51 +0000 (23:17 -0500)] 
Mark broken tests on powerpc64le and skip ghci-ext

Mark tests with DWARF as broken
Test way `ghci-ext` only where available

Test Plan: validate

Reviewers: bgamari, hvr, simonmar, erikd, Phyx

Reviewed By: bgamari, Phyx

Subscribers: Phyx, rwbarton, carter

Differential Revision:

10 months agotestsuite: Fix tests expecting 64-bit word size
Ben Gamari [Fri, 7 Dec 2018 17:46:02 +0000 (12:46 -0500)] 
testsuite: Fix tests expecting 64-bit word size

These were added in 75a8349b2a7d0142d3d687837caf5a95bbb4368d.

10 months agoAdd missing space in report_summary output
Adam Sandberg Eriksson [Wed, 5 Dec 2018 21:53:37 +0000 (21:53 +0000)] 
Add missing space in report_summary output

10 months agoFixed plugin example to work
abc [Sun, 25 Nov 2018 05:16:00 +0000 (14:16 +0900)] 
Fixed plugin example to work

10 months agoFix typo in Foldable docs
Simon Jakobi [Sat, 24 Nov 2018 17:40:17 +0000 (18:40 +0100)] 
Fix typo in Foldable docs

10 months agoAdd some complexities to Data.List documentation (#15003)
Sven Tennie [Sun, 2 Dec 2018 17:02:18 +0000 (18:02 +0100)] 
Add some complexities to Data.List documentation (#15003)

Namely for:
- head
- uncons
- tail
- last
- init
- null

10 months agoCircleCI: Don't ignore gitlab/.* branches
Ben Gamari [Fri, 7 Dec 2018 16:24:07 +0000 (11:24 -0500)] 
CircleCI: Don't ignore gitlab/.* branches

This was added (for good reasons) in b9260e925e998f715865ae043bdb9f779ab5f849
but it seems this field isn't allowed in this context. Sadly there doesn't
appear to be an easy way to accomplish what we are after with CircleCI's rather
restrictive configuration language. Sigh.

10 months agotestsuite: Fix use of stats_num_field
Ben Gamari [Fri, 7 Dec 2018 15:14:25 +0000 (10:14 -0500)] 
testsuite: Fix use of stats_num_field

This is now collect_stats.

10 months agoFix #12102/#15872 by removing outdated users' guide prose
Ryan Scott [Fri, 7 Dec 2018 14:35:53 +0000 (09:35 -0500)] 
Fix #12102/#15872 by removing outdated users' guide prose

In the beginning, #12102 (and #15872, which is of a similar
ilk) were caused by a poor, confused user trying to use code that
looks like this (with a constraint in the kind of a data type):

type family IsTypeLit a where
  IsTypeLit Nat    = 'True
  IsTypeLit Symbol = 'True
  IsTypeLit a      = 'False

data T :: forall a. (IsTypeLit a ~ 'True) => a -> * where
  MkNat    :: T 42
  MkSymbol :: T "Don't panic!"

Many bizarre GHC quirks (documented in those tickets) arose from
this sort of construction. Ultimately, the use of constraints in
data type kinds like this has made a lot of people very confused and
been widely regarded as a bad move.

Commit 2257a86daa72db382eb927df12a718669d5491f8 finally put this
feature out of its misery, so now the code above simply errors with
`Illegal constraint in a kind`. As a result, the aforementioned
tickets are moot, so this patch wraps a bow on the whole thing by:

1. Removing the (now outdated) section on constraints in data type
   kinds from the users' guide, and
2. Adding a test case to test this code path.

Test Plan: make test TEST=T12102

Reviewers: goldfire, simonpj, bgamari, tdammers

Reviewed By: tdammers

Subscribers: tdammers, rwbarton, carter

GHC Trac Issues: #12102, #15872

Differential Revision:

10 months agoCareful tweaking to exprOkForSpeculation
Simon Peyton Jones [Fri, 7 Dec 2018 12:56:08 +0000 (12:56 +0000)] 
Careful tweaking to exprOkForSpeculation

This patch does several things:

* Make exprOkForSpeculation ignore evaluatedness of variables
  See the Note [exprOkForSpeculation and evaluated variables]
  This means that the binder-swap transformation no longer
  invaliates the let/app invariant.

* Make exprOkForSpeculation return False for
     DataToTagOp and SeqOp.
  See Note [exprOkForSpeculation and SeqOp/DataToTagOp]

* Remove the 'can_fail' property from dataToTag#; it was
  always a hack (described in the old Note [dataToTag#] in
  primops.txt.pp), and now its not necessary because of the
  fixes above.

* Make SetLevels use exprIsHNF, /not/ exprOkForSpeculation,
  when floating single-alternative cases.  See SetLevels
  Note [Floating single-alternative cases]

* Fix a buglet in FloatIn; probably never bites in practice
  See Note [Dead bindings]

Collectively, these changes finally fix Trac #15696.

10 months agoWibble to Taming the Kind Inference Monster
Simon Peyton Jones [Fri, 7 Dec 2018 14:25:30 +0000 (14:25 +0000)] 
Wibble to Taming the Kind Inference Monster

I had allowed rename/should_fail/T15828 (Trac #15828) to regress a bit.
The main payload of this patch is to fix that problem, at the cost of
more contortions in checkConsistentFamInst.  Oh well, at least they are
highly localised.

I also update the -ddump-types code in TcRnDriver to print out some
more expicit information about each type constructor, thus instead of

   DF{3} :: forall k. * -> k -> *

we get

   data family DF{3} :: forall k. * -> k -> *

Remember, this is debug-printing only.  This change is the reason
that so many .stderr files change.

10 months agohadrian: optimise Rules.Compile
Alp Mestanogullari [Fri, 7 Dec 2018 09:42:08 +0000 (10:42 +0100)] 
hadrian: optimise Rules.Compile

Previously, as reported in #15938, resuming a build "in the middle",
e.g when building _build/stage1/libraries/base/, hadrian would take up
to a whole minute to get started doing actual work, building code.

This was mostly due to a big enumeration that we do in Rules.hs, to
generate all the possible patterns for object files for 1) all ways, 2)
all packages and 3) all stages. Since rule enumeration is always
performed, whatever the target, we were always paying this cost, which
seemed to grow bigger the farther in the build we stopped and were
resuming from.

Instead, this patch borrows the approach that we took for Rules.Library
in, which exposes all the
relevant object files under as few catch-all rules as possible (8 here),
and parses all the information we need out of the object's path.

The concrete effect of this patch that I have observed is to reduce the
45-60 seconds pause to <5 seconds. Along with the Shake performance
improvements that Neil mentions in #15938, most of the pause should
effectively disappear.

Reviewers: snowleopard, bgamari, goldfire

Reviewed By: snowleopard

Subscribers: rwbarton, carter

GHC Trac Issues: #15938

Differential Revision:

10 months agoAdd fusion rules for the zipWith functions in base (#15263)
Tobias Decking [Thu, 6 Dec 2018 20:32:18 +0000 (15:32 -0500)] 
Add fusion rules for the zipWith functions in base (#15263)

This patch will allow `zip3` and `zipWith3` in `GHC.List` as well
as `zipWith4`, `zipWith5`, `zipWith6` and `zipWith7` in `Data.OldList` to fuse.

These rules are kept in a similar style as the rules for `zip` and `zipWith`.

Added a corresponding test case.

Test Plan: validate

Reviewers: hvr, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rockbmb, rwbarton, carter

GHC Trac Issues: #15263

Differential Revision:

10 months agoWindows: Use the "big" PE object format on amd64
Ben Gamari [Thu, 6 Dec 2018 20:28:47 +0000 (15:28 -0500)] 
Windows: Use the "big" PE object format on amd64

Test Plan: Do full build on Windows.

Reviewers: AndreasK, Phyx

Reviewed By: AndreasK

Subscribers: rwbarton, erikd, carter

GHC Trac Issues: #15934

Differential Revision:

10 months agoDon't use a generic apply thunk for known calls
Sebastian Graf [Thu, 6 Dec 2018 15:40:08 +0000 (16:40 +0100)] 
Don't use a generic apply thunk for known calls

Currently, an AP thunk like `sat = f a b c` will not have its own entry
point and info pointer and will instead reuse a generic apply thunk
like `stg_ap_4_upd`.

That's great from a code size perspective, but if `f` is a known
function, a specialised entry point with a plain call can be much faster
than figuring out the arity and doing dynamic dispatch.

This looks at `f`s arity to figure out if it is a known function and if so, it
will not lower it to a generic apply function.

Benchmark results are encouraging: No changes to allocation, but 0.2% less
counted instructions.

Test Plan: Validates locally

Reviewers: simonmar, osa1, simonpj, bgamari

Reviewed By: simonpj

Subscribers: rwbarton, carter

GHC Trac Issues: #16005

Differential Revision:

10 months agoRemove a tcTrace
Simon Peyton Jones [Thu, 6 Dec 2018 14:22:31 +0000 (14:22 +0000)] 
Remove a tcTrace

This tcTrace, in tcTyFamInstEqn, caused a knot-tying loop, because
it was printing a type after zonking-to-Type.  Easy solution: don't
do that.

10 months agoTests Trac #14847
Simon Peyton Jones [Thu, 6 Dec 2018 14:21:33 +0000 (14:21 +0000)] 
Tests Trac #14847

10 months agoRemove explicit recursion in retainer profiling (fixes #14758)
Alexander Vershilov [Wed, 5 Dec 2018 16:47:32 +0000 (19:47 +0300)] 
Remove explicit recursion in retainer profiling (fixes #14758)

Retainer profiling contained a recursion that under
certain circumstances could lead to the stack overflow
in C code.

The idea of the improvement is to keep an explicit stack for the
object, more precise to reuse existing stack, but allow new type of
objects to be stored there.

There is no reliable reproducer that is not a big program
but in some cases foldr (+) 0 [1..10000000] can work.

Reviewers: bgamari, simonmar, erikd, osa1

Reviewed By: bgamari, osa1

Subscribers: osa1, rwbarton, carter

GHC Trac Issues: #14758

Differential Revision:

10 months agoRemove duplicates in -ddump-minimial-imports
Simon Peyton Jones [Wed, 5 Dec 2018 10:12:09 +0000 (10:12 +0000)] 
Remove duplicates in -ddump-minimial-imports

This fixes Trac #15994.

Previously RdrName.gresToAvailInfo assumed that the input list
of GREs had no duplicates. I accidentally broke this precondition
in this refactoring:

    commit 6353efc7694ba8ec86c091918e02595662169ae2
    Date:   Thu Nov 22 14:48:05 2018 -0500

    Fix unused-import warnings

    This patch fixes a fairly long-standing bug (dating back to 2015) in
    RdrName.bestImport, namely

(There was an ASSERT, but it's usually switched off in stage2.  It
tripped when I switched stage2 assertions on.)

The fix is straightforward: account for dups in gresToAvailInfo.

10 months agolinker: store entire link map and use it.
Tamar Christina [Tue, 4 Dec 2018 00:29:08 +0000 (00:29 +0000)] 
linker: store entire link map and use it.

This fixes a corner case in which we have seen the symbol multiple times in
different static libraries, but due to a depencency we end up loading the
symbol from a library other than the first one.

Previously the runtime linker would only track symbols from the first
library and did not store the full link map.  In this case it was unable
to find the address for the symbols in the second library during delay

This change stores the address of all symbols seen so a full link map
is generated, such that when we make a different decision later than what
was expected we're able to still correctly load the library.

Test Plan: ./validate, new testcase T15894

Reviewers: angerman, bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15894

Differential Revision:

10 months agoHadrian: include 'findPtr' via find-ptr cabal flag
Alec Theriault [Tue, 4 Dec 2018 00:21:48 +0000 (00:21 +0000)] 
Hadrian: include 'findPtr' via find-ptr cabal flag

This is the latest in the 'findPtr' saga. See

  * 900c47f88784b91517c00be3e1087322e62f698e
  * 561748cb507505bd5b7bd76bdc57796d896b62a2

for the previous attempts. The problem with re-using the 'debug'
cabal flag for the purpose of forcing inclusion of 'findPtr' occurs
when 'debug' is one of the RTS ways, but RTS is not being compiled
with '-DDEBUG':

  * the 'debug' flag gets passed to cabal, signalling to build
    'rts' with the debug flavour, but also forcing inclusion of
    the 'findPtr'/'_findPtr' symbol

  * since '-DDEBUG' isn't enabled, that symbol doesn't show up in
    the libraries, so executable that depend on 'rts' (everything)
    will end up always requiring 'findPtr'/'_findPtr' but 'rts' won'y
    provide it!

The fix is simple: create a a new 'find-ptr' cabal-flag whose only
purpose is forcing '-Wl,-u,findPtr'/'-Wl,-u,_findPtr'. Then, enable that
flag when the RTS is being compiled with '-DDEBUG'

Test Plan: ./hadrian/ -c # on mac

Reviewers: alpmestan, snowleopard, bgamari, erikd, simonmar, Phyx

Reviewed By: alpmestan, snowleopard, Phyx

Subscribers: Phyx, rwbarton, carter

GHC Trac Issues: #15956

Differential Revision:

10 months agoImprove test T14452 for Windows
Roland Senn [Tue, 4 Dec 2018 00:17:47 +0000 (00:17 +0000)] 
Improve test T14452 for Windows

Summary: Under Windows all parameters to gcc are enclosed in quotes, opposite to
Linux, where the quotes are missing. Therefore in the test, we remove all
quotes in the stdout file with sed.

Test Plan: make test TEST=T14452

Reviewers: osa1, hvr, bgamari, monoidal, Phyx, simonpj

Reviewed By: Phyx

Subscribers: rwbarton, carter

GHC Trac Issues: #14452

Differential Revision:

10 months agoBump nofib submodule [Mon, 3 Dec 2018 18:59:09 +0000 (19:59 +0100)] 
Bump nofib submodule

Test Plan: run nofib

Reviewers: bgamari, tdammers

Reviewed By: tdammers

Subscribers: rwbarton, carter

Differential Revision:

10 months agoFix link name to a note
Arnaud Spiwack [Mon, 3 Dec 2018 18:54:19 +0000 (19:54 +0100)] 
Fix link name to a note

Reviewers: goldfire, bgamari, tdammers

Reviewed By: tdammers

Subscribers: rwbarton, carter

Differential Revision: