1. 11 Jul, 2017 9 commits
    • Moritz Angermann's avatar
      Always allow -staticlib · b8f33bc6
      Moritz Angermann authored
      the `-staticlib` flag is currently only supported on apple platforms,
      due to the avaiablity of libtool (the apple version, which is unlike the
      gnu version).  This however prevents the use of -staticlib in cases
      where it would be beneficial as well.  The functionality that
      `-staticlib` uses from `libtool` can be stubbed with a small script like
      the following:
      # This script pretends to be libtool.  And supports
      # only a limited set of flags.
      # It is supposed to be a stand in for libtool -static, whic
      # creates a static archive.  This is done by locating all -l<lib>
      # libs in the provied -L<lib path> library paths, and building an
      # MRI script to create the final archive from all the libraries, and
      # other provided inputs.
      set -e
      # find_lib <name> path path path path
      function find_lib () {
              lib=$1; shift 1;
              for dir in $@; do
                      if [ -f "$dir/$lib" ]; then
                              echo "$dir/$lib"
      while [ "$#" -gt 0 ]; do
              case "$1" in
                      -v|--verbose) verbose=1; shift 1;;
                      -o) output="$2"; shift 2;;
                      -L*) ldflags_L+=("${1:2:${#1}-2}"); shift 1;;
                      -l*) ldflags_l+=("lib${1:2:${#1}-2}.a"); shift 1;;
                      -static) mode=$STATIC; shift 1;;
                      -dynamic) mode=$DYNAMIC; shift 1;;
                      -Wl,*) ldflags+=("${1#*,}"); shift 1;;
                      -*) echo "unknown option: $1" >&2; exit 1;;
                      *) inputs+=("$1"); shift 1;;
      if [ ! $mode == $STATIC ]; then
              echo "-dynamic not supported!" >&2; exit 1;
      MRI="create ${output}\n"
      for input in "${ldflags_l[@]}"; do
              lib=$(find_lib $input ${ldflags_L[@]})
              if [ -z $lib ]; then
                      echo "Failed to find lib $input" >&2
                      exit 1
                      MRI+="addlib $lib\n"
      for input in "${inputs[@]}"; do
              MRI+="addmod $input\n"
      echo -e "$MRI" | $target-ar -M
      $target-ranlib $output
      if `ar` supports MRI scripts.
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3706
    • Andreas Klebinger's avatar
      Sort list of failed tests for easier comparison between runs · cb8db9bc
      Andreas Klebinger authored
      Test Plan: Running the testsuite.
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13922
      Differential Revision: https://phabricator.haskell.org/D3705
    • Ryan Scott's avatar
      Suppress unused warnings for selectors for some derived classes · 15fcd9ad
      Ryan Scott authored
      Although derived `Read`, `Show`, and `Generic` instances technically
      don't //use// the record selectors of the data type for which an
      instance is being derived, the derived code is affected by the
      //presence// of record selectors. As a result, we should suppress
      `-Wunused-binds` for those record selectors when deriving these classes.
      This is accomplished by threading through more information from
      Test Plan: make test TEST=T13919
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13919
      Differential Revision: https://phabricator.haskell.org/D3704
    • Douglas Wilson's avatar
      Add testcase for T13818 · 6cff2cad
      Douglas Wilson authored
      Annotations currently fail to type check if they annotation cannot
      be loaded into ghci, such as when built with -fno-code.
      Test Plan: ./validate
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13818
      Differential Revision: https://phabricator.haskell.org/D3701
    • Ben Gamari's avatar
      Improve Wmissing-home-modules warning under Cabal · b0c9f34a
      Ben Gamari authored
      Reviewers: hvr, alanz, austin
      Reviewed By: alanz
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13899
      Differential Revision: https://phabricator.haskell.org/D3686
    • Douglas Wilson's avatar
      Fix Work Balance computation in RTS stats · 7c9e356d
      Douglas Wilson authored
      An additional stat is tracked per gc: par_balanced_copied This is the
      the number of bytes copied by each gc thread under the balanced lmit,
      which is simply (copied_bytes / num_gc_threads).  The stat is added to
      all the appropriate GC structures, so is visible in the eventlog and in
      A note is added explaining how work balance is computed.
      Remove some end of line whitespace
      Test Plan:
      experiment with the program attached to the ticket
      examine code changes carefully
      Reviewers: simonmar, austin, hvr, bgamari, erikd
      Reviewed By: simonmar
      Subscribers: Phyx, rwbarton, thomie
      GHC Trac Issues: #13830
      Differential Revision: https://phabricator.haskell.org/D3658
    • patrickdoc's avatar
      Make ':info Coercible' display an arbitrary string (fixes #12390) · 905dc8bc
      patrickdoc authored
      This change enables the addition of an arbitrary string to the output of
      GHCi's ':info'. It was made for Coercible in particular but could be
      extended if desired.
      Updates haddock submodule.
      Test Plan: Modified test 'ghci059' to match new output.
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: goldfire, rwbarton, thomie
      GHC Trac Issues: #12390
      Differential Revision: https://phabricator.haskell.org/D3634
    • Ben Gamari's avatar
      user-guide: Various fixes to FFI section · 31ceaba3
      Ben Gamari authored
    • Ben Gamari's avatar
      testsuite: Decrease T13701 allocations · 4f690133
      Ben Gamari authored
  2. 10 Jul, 2017 1 commit
  3. 08 Jul, 2017 3 commits
    • Tamar Christina's avatar
      Big-obj support for the Windows runtime linker · 81377e9e
      Tamar Christina authored
      The normal object file on Windows has a limit of `2^16`
      sections that can be in an object-file.
      The `big-obj` format raises this to `2^32` sections.
      The implementation is made difficult because we now need to support
      two header formats and two section formats that differ only by a single
      element size within each. The element that's different is in the middle
      of the structs and since the structs are used to map regions of memory
      directly, it means we need to know which struct it is when we do the
      mapping or pointer arithmetics.
      This is the final Object-Code format which Windows compilers can generate
      which we do not support yet in GHCI. All other major compilers on the platforms
      can produce it and all linkers consume it (bfd and lld).
      See http://tinyurl.com/bigobj
      This patch abstracts away retrieving the fields to functions which all take
      an struct which describes which object format is currently being parsed.
      These functions are always in-lined as they're small but would looks messy
      being copy-pasted everywhere.
      Test Plan:
      ./validate and new test `big-obj`
      Tamar@Rage MINGW64 /r
      $ gcc -c -Wa,-mbig-obj foo.c -o foo.o
      Tamar@Rage MINGW64 /r
      $ objdump -h foo.o
      foo.o:     file format pe-bigobj-x86-64
      Idx Name          Size      VMA               LMA               File off  Algn
        0 .text         00000010  0000000000000000  0000000000000000  00000128  2**4
                        CONTENTS, ALLOC, LOAD, READONLY, CODE
        1 .data         00000000  0000000000000000  0000000000000000  00000000  2**4
                        ALLOC, LOAD, DATA
        2 .bss          00000000  0000000000000000  0000000000000000  00000000  2**4
        3 .xdata        00000008  0000000000000000  0000000000000000  00000138  2**2
                        CONTENTS, ALLOC, LOAD, READONLY, DATA
        4 .pdata        0000000c  0000000000000000  0000000000000000  00000140  2**2
                        CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
        5 .rdata$zzz    00000030  0000000000000000  0000000000000000  0000014c  2**4
                        CONTENTS, ALLOC, LOAD, READONLY, DATA
      Tamar@Rage MINGW64 /r
      $ echo main | ~/ghc/inplace/bin/ghc-stage2.exe --interactive bar.hs foo.o
      GHCi, version 8.3.20170430: http://www.haskell.org/ghc/  :? for help
      [1 of 1] Compiling Main             ( bar.hs, interpreted )
      Ok, modules loaded: Main.
      *Main> 17
      *Main> Leaving GHCi.
      Reviewers: austin, bgamari, erikd, simonmar
      Subscribers: awson, rwbarton, thomie, #ghc_windows_task_force
      GHC Trac Issues: #13815
      Differential Revision: https://phabricator.haskell.org/D3523
    • Ömer Sinan Ağacan's avatar
      Fix typos in Bag.hs [ci skip] · e1146ed5
      Ömer Sinan Ağacan authored
    • Sergei Trofimovich's avatar
      aclocal.m4: allow arbitrary <vendor> string in toolchain triplets · c2303dff
      Sergei Trofimovich authored
      Canonical triplets have a form of
      Checking for vendor is almost never correct as it's an
      arbitrary string.
      It's useful to have multiple "vendors" to denote
      otherwise the same (WRT <arch>, <os>, <abi>) target:
      Do not fail unknown vendors. Only emit a warning.
      Ideally configure checks should never use "vendor".
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
  4. 07 Jul, 2017 1 commit
    • Tamar Christina's avatar
      Implement split-sections support for windows. · bd4fdc6a
      Tamar Christina authored
      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
  5. 06 Jul, 2017 2 commits
  6. 05 Jul, 2017 5 commits
  7. 03 Jul, 2017 16 commits
  8. 02 Jul, 2017 1 commit
  9. 29 Jun, 2017 2 commits