1. 11 Nov, 2015 4 commits
  2. 09 Nov, 2015 1 commit
  3. 08 Nov, 2015 1 commit
    • Tamar Christina's avatar
      Fix sporadic failing ghci/Linker/Dyn tests · f4056324
      Tamar Christina authored
      Summary:
      Multiple tests use the same source C file.
      GHC was previously writing the resulting .o files
      in the same folder as the source. When these tests
      are run in parallel, sometimes one of the calls would
      use the partial .o file and throw an error.
      
      The .o files are moved into different folders with this
      change.
      
      Test Plan: make test -C testsuite/tests/ghci/linking/dyn
      
      Reviewers: thomie, austin, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1449
      f4056324
  4. 07 Nov, 2015 11 commits
    • kgardas's avatar
      Add OpenBSD specific RTS symbols · 2b7d9c2b
      kgardas authored
      This patch adds OpenBSD specific RTS symbols.  The patch is taken from
      the OpenBSD ports tree, provided by the OpenBSD community.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1445
      2b7d9c2b
    • Ben Gamari's avatar
      Quote file paths in linker scripts · 0e40c01d
      Ben Gamari authored
      Reviewers: bgamari, austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1442
      
      GHC Trac Issues: #11063
      0e40c01d
    • Bartosz Nitka's avatar
      Add pprSTrace for debugging with call stacks · 80d7ce80
      Bartosz Nitka authored
      I've spent quite a bit of time giving unique labels to my `pprTrace`
      calls and then trying to intuit where the function is called from.
      Thanks to the new implicit parameter CallStack functionality I don't
      have to do that anymore.
      
      Test Plan: harbormaster
      
      Reviewers: austin, simonmar, bgamari
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1440
      80d7ce80
    • Bartosz Nitka's avatar
      Replace freeVarsOf scrut with scrut_fvs to avoid repetition · 932d5036
      Bartosz Nitka authored
      Test Plan: harbormaster
      
      Reviewers: bgamari, simonmar, austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1439
      932d5036
    • Ömer Sinan Ağacan's avatar
      minor: use unless instead of (when . not) · bd69f6f4
      Ömer Sinan Ağacan authored
      Reviewers: bgamari, austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1438
      bd69f6f4
    • thomie's avatar
      Parser: allow empty multi-line deprecation warnings · 8262c954
      thomie authored
      This should work,
      
          {-# DEPRECATED someFunction [] #-}
      
      Test Plan: parser/should_compile/T3303
      
      Reviewers: bgamari, austin
      
      Reviewed By: austin
      
      Subscribers: mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1433
      
      GHC Trac Issues: #11044
      8262c954
    • thomie's avatar
      Build system: use stage0 to build dll-split · d9c1450a
      thomie authored
      When cross-compiling ghc itself, this prevents:
      
        "dll-split: cannot execute binary file: Exec format error"
      
      Test Plan:
         * ./configure --target=arm-linux-gnueabihf
         * DYNAMIC_GHC_PROGRAMS=YES
         * Stage1Only=NO
      
      Reviewers: rwbarton, bgamari, austin
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D1430
      d9c1450a
    • Matthew Pickering's avatar
      Remove PatSynBuilderId · 22080113
      Matthew Pickering authored
      Summary:
      It was only used to pass field labels between the typechecker and
      desugarer. Instead we add an extra field the RecordCon to carry this
      information.
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1443
      
      GHC Trac Issues: #11057
      22080113
    • johnleo's avatar
      fix #10734 by adding braces to pretty-printing of let inside do · be885857
      johnleo authored
      Test Plan: validate
      
      Reviewers: bgamari, austin, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1448
      
      GHC Trac Issues: #10734
      be885857
    • Tamar Christina's avatar
      Allow the GHCi Linker to resolve related dependencies when loading DLLs · 6e6438e1
      Tamar Christina authored
      Summary:
      GHCi does not correctly tell the Windows Loader how to handle dependencies to DLL's
      that are not on the standard Windows load path:
      
      1. The directory from which the application loaded.
      2. The current directory.
      3. The system directory. Use the GetSystemDirectory function to get the path of this directory.
      4. The 16-bit system directory. There is no function that obtains the path of this directory,
         but it is searched.
      5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
      6. The directories that are listed in the PATH environment variable.
         Note that this does not include the per-application path specified by the
         AppPaths registry key. The App Paths key is not used when computing the DLL search path.
      
      So what this means is given two DLLs `A` and `B` and `B` depending on `A`.
      If we put both DLLs into a new folder bin and then call GHC with:
      
      `ghc -L$(PWD)/bin -lB`
      
      the loading will fail as the Windows loader will try to load the dependency of `B` and fail
      since it cannot find `A`.
      
      *IMPORTANT* this patch drops XP Support.
      The  APIs being used were natively added to Windows 8+ and backported to Windows 7 and Vista
      via a mandatory security patch (in 2011). This means that there is a chance that KB2533623 has
      not been installed on certain machines. For those machines I display a warning and
      temporarily expand the `PATH` to allow it to load.
      
      This patch will make sure that paths provided by the user with `-L` *and* the folder in which a
      DLL is found are added to the search path. It does so using one of two methods depending upon how
      new of a Windows version we are running on:
      
      - If the APIs are available it will use `addDllDirectory` and `removeDllDirectory`.
         The order of which these directories are searched is nondeterministic.
      - If the APIs are not available it means that we're running on a pretty old unpatched machine.
        But if it's being used in an environment with no internet access it may be the case.
        So if the APIs are not available we temporarily extend the `PATH` with the directories.
        A warning is also displayed to the user informing them that the linking may fail,
        and if it does, install the needed patch. The `PATH` variable has limitations.
      
      Test Plan:
      ./validate
      
      Added two new test T10955 and T10955dyn
      
      Reviewers: erikd, bgamari, thomie, hvr, austin
      
      Reviewed By: erikd, thomie
      
      Subscribers: #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D1340
      
      GHC Trac Issues: #10955
      6e6438e1
    • Simon Marlow's avatar
      Make GHCi & TH work when the compiler is built with -prof · ce1f1607
      Simon Marlow authored
      Summary:
      Amazingly, there were zero changes to the byte code generator and very
      few changes to the interpreter - mainly because we've used good
      abstractions that hide the differences between profiling and
      non-profiling.  So that bit was pleasantly straightforward, but there
      were a pile of other wibbles to get the whole test suite through.
      
      Note that a compiler built with -prof is now like one built with
      -dynamic, in that to use TH you have to build the code the same way.
      For dynamic, we automatically enable -dynamic-too when TH is required,
      but we don't have anything equivalent for profiling, so you have to
      explicitly use -prof when building code that uses TH with a profiled
      compiler.  For this reason Cabal won't work with TH.  We don't expect
      to ship a profiled compiler, so I think that's OK.
      
      Test Plan: validate with GhcProfiled=YES in validate.mk
      
      Reviewers: goldfire, bgamari, rwbarton, austin, hvr, erikd, ezyang
      
      Reviewed By: ezyang
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1407
      
      GHC Trac Issues: #4837, #545
      ce1f1607
  5. 06 Nov, 2015 1 commit
    • Joachim Breitner's avatar
      Call Arity: In "e x", the result of "x" is not shared · a58eeb7f
      Joachim Breitner authored
      in contrast to "e (f x)", where CorePrep will turn it into "let y = f x
      in e x". So in
        let f = ...
        in e (f x)
      we know that f is called at most once, but in
        let f = ...
        in e f
      we do not know that.
      
      Previously Call Arity would assume that in "e x", "x" is evaluated at
      most once. This rarely would make a difference (the argument "x" is
      analized with an incoming arity of 0, so no eta-expansion would be done
      anyways), but of course this should still be fixed.
      
      This fixes #11064.
      
      Note the corresponding code dmdTransformThunkDmd in DmdAnal.
      a58eeb7f
  6. 04 Nov, 2015 2 commits
  7. 03 Nov, 2015 6 commits
  8. 02 Nov, 2015 6 commits
  9. 01 Nov, 2015 8 commits
    • Ben Gamari's avatar
      rts: Produce stack trace on fatal error · 9fe5497e
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: austin, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: simonmar, thomie, scpmw
      
      Differential Revision: https://phabricator.haskell.org/D1418
      9fe5497e
    • Ben Gamari's avatar
      EventLog: Loop fwrite if necessary during flush · f46f32b9
      Ben Gamari authored
      Previously the eventlog flush code would fail if `fwrite` wrote less
      than the requested amount. Like all Unix stream I/O operations, however,
      `fwrite` isn't guaranteed to write the entire buffer. Here we loop as
      long as `fwrite` succeeds in writing anything.
      
      Fixes #11041.
      
      Test Plan: Validate with eventlog
      
      Reviewers: austin, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1415
      
      GHC Trac Issues: #11041
      f46f32b9
    • Tamar Christina's avatar
      Change sphinx for documentation building on windows to the python3 version · 65f3c4c0
      Tamar Christina authored
      Summary:
      Python 3 seems to have fixed the long standing codepage issue with
      python on Windows. To be able to reliably build the documentation
      we should use the Python 3 version of Sphinx.
      
      See `https://docs.python.org/dev/whatsnew/3.3.html#codecs` and
      `https://bugs.python.org/issue13216`. Sphinx also supports Python 3.
      
      Oddly enough `python3-sphinx` is registered as `sphinx-build.exe`
      instead of `sphinx-build3.exe`, so the changes in `configure.ac` can
      be reverted.
      
      install with `pacman -S mingw-w64-$(uname -m)-python3-sphinx`
      
      Test Plan: ./validate
      
      Reviewers: austin, thomie, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: erikd
      
      Differential Revision: https://phabricator.haskell.org/D1417
      
      GHC Trac Issues: #11021
      65f3c4c0
    • Ömer Sinan Ağacan's avatar
      Minor simplification in unariser pass: · e9bfb3fd
      Ömer Sinan Ağacan authored
      We don't need to update StgCase's AltType, because it's already set
      correctly in `CoreToStg.mkStgAltType`, so we can just remove extra
      argument passing and return values.
      
      (I think this is a useful refactoring because it makes it clear that we
      don't need to update AltTypes)
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1403
      e9bfb3fd
    • Ben Gamari's avatar
      Libdw: Fix symbol naming · 52c6e3d6
      Ben Gamari authored
      RTS convention is to use camel-case.
      52c6e3d6
    • Ben Gamari's avatar
      Dwarf.Constants: Introduce Haddock sections · b8df8583
      Ben Gamari authored
      b8df8583
    • Ben Gamari's avatar
      Libdw: Remove special treatment for stg_stop_thread · bb446b26
      Ben Gamari authored
      This is no longer necessary since this symbol can be unwound through
      with its DWARF information.
      bb446b26
    • Ben Gamari's avatar
      StgStartup: Setup unwinding for stg_stop_thread · d9f88628
      Ben Gamari authored
      This is a bit ugly as we need to assume the structure of the C stack as
      left by StgRun. Nevertheless, it allows us to unwind all the way back to
      `_start` on my machine.
      
      ```
      Stack trace:
          set_initial_registers (rts/Libdw.c:272.0)
          dwfl_thread_getframes
      
          dwfl_getthreads
          dwfl_getthread_frames
          libdw_get_backtrace (rts/Libdw.c:243.0)
          base_GHCziExecutionStack_getStackTrace1_info
      (libraries/base/GHC/ExecutionStack.hs:43.1)
          base_GHCziExecutionStack_showStackTrace1_info
      (libraries/base/GHC/ExecutionStack.hs:47.1)
          base_GHCziBase_bindIO1_info (libraries/base/GHC/Base.hs:1085.1)
          base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1)
          base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1)
          base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1)
          base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1)
          base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1)
          stg_catch_frame_info (rts/Exception.cmm:370.1)
          stg_stop_thread_info (rts/StgStartup.cmm:42.1)
          scheduleWaitThread (rts/Schedule.c:465.0)
          hs_main (rts/RtsMain.c:65.0)
      
          __libc_start_main (/tmp/buildd/glibc-2.19/csu/libc-start.c:321.0)
          _start
      ```
      d9f88628