1. 06 Dec, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Tweak use of AC_USE_SYSTEM_EXTENSIONS · 8b422142
      Herbert Valerio Riedel authored
      This makes sure that `AC_USE_SYSTEM_EXTENSIONS` (which
      implies `AC_PROG_CC`) is called after the
      `AC_ARG_WITH([cc],,)` invocation, so that the proper
      CC setting is in scope. Otherwise this can break cross-compilation.
      This also needs to pull in a submodule update for `unix`
      This is a follow-up commit to
      which hopefully fixes #11168
  2. 04 Dec, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Use Autoconf's AC_USE_SYSTEM_EXTENSIONS · 7af29da0
      Herbert Valerio Riedel authored
      This takes care of setting feature test macros (i.e. let Autoconf decide when
      those can be set safely) to allow subsequent Autoconf tests to better detect
      available OS features.
      This also includes a submodule update of unix which enables the use of
      `AC_USE_SYSTEM_EXTENSIONS` in there as well.
      Specifically, this takes care of setting `_GNU_SOURCE` (which allows to remove
      two occurences where it's set manually) and `_ALL_SOURCE` (which fixes issues
      on AIX).
      See also
      for details.
      At some point we may want to reconsider the purpose of "rts/PosixSource.h" and
      rely more on Autoconf instead.
  3. 23 Nov, 2015 1 commit
  4. 19 Nov, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Make `derivedConstants` more crosscompile-friendly · 65d7ff06
      Herbert Valerio Riedel authored
      `derivedConstants` currently uses `System.Info.os` for decisions (which
      doesn't necessarily reflect the build-target), as well as hardcoding
      "/usr/bin/objdump" for openbsd.
      This patch auto-detects `objdump` similiar to how `nm` is detected via
      Autoconf as well as passing the target-os into `derivedConstants` via
      Reviewers: austin, kgardas, erikd, bgamari
      Reviewed By: kgardas, erikd, bgamari
      Subscribers: kgardas, thomie, erikd
      Differential Revision: https://phabricator.haskell.org/D1499
  5. 18 Nov, 2015 1 commit
  6. 01 Nov, 2015 2 commits
  7. 31 Oct, 2015 2 commits
    • kgardas's avatar
      disable large address space on OpenBSD · bc7cc256
      kgardas authored
      This patch disables large address space on OpenBSD. The motivation
      for this is that OpenBSD does not support MAP_NORESERVE. The flag is supported
      only for source code compatibility reasons but is otherwise completely ignored
      by the OS and its mmap syscall.
      Reviewers: austin, bgamari
      Subscribers: thomie, erikd
      Differential Revision: https://phabricator.haskell.org/D1411
    • Tamar Christina's avatar
      Fix documentation build on windows · 6bef55c6
      Tamar Christina authored
      Fix building new Sphinx documenation on Windows in msys2 using Awson's patch on #11021.
      Install Sphinx using `pacman -S mingw-w64-$(uname -m)-python2-sphinx`
      Test Plan: Apply patch and ./validate
      Reviewers: thomie, bgamari, austin
      Reviewed By: thomie, bgamari
      Subscribers: erikd
      Differential Revision: https://phabricator.haskell.org/D1408
      GHC Trac Issues: #11021
  8. 30 Oct, 2015 1 commit
  9. 24 Oct, 2015 2 commits
    • Erik de Castro Lopo's avatar
      configure.ac: Fix autotool warnings · 798d2e2b
      Erik de Castro Lopo authored
      Test Plan: perl boot and check for warnings
      Reviewers: niteria, austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1364
    • niteria's avatar
      Support more sphinx-build versions in configure script · 4e403403
      niteria authored
      `sphinx-build` on CentOS
      (`python-sphinx10-doc-1.0.8-1.el6.centos.noarch`) responds with this on
      $ sphinx-1.0-build --version
      Sphinx v1.0.8
      Usage: /usr/bin/sphinx-1.0-build [options] sourcedir outdir
      Options: -b <builder> -- builder to use; default is html
               -a        -- write all files; default is to only write new and
      changed files
      * without -a and without filenames, write new and changed files.
      * with -a, write all files.
      * with filenames, write these.
      This should make it work for the old and the new format.
      Test Plan:
      $ echo "Sphinx (sphinx-build) 1.0.1" | sed 's/Sphinx\(
      (sphinx-build)\)\? v\?\([0-9]\.[0-9]\.[0-9]\)/\2/'
      $ echo "Sphinx v1.0.1" | sed 's/Sphinx\( (sphinx-build)\)\?
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie, erikd
      Differential Revision: https://phabricator.haskell.org/D1361
  10. 23 Oct, 2015 1 commit
    • Ben Gamari's avatar
      Verify minimum required version of sphinx-build · 7dae0743
      Ben Gamari authored
      CentOS 6.6 includes sphinx-build 0.6.6 which is woefully inadequate to
      build the users guide. In particular it fails as it lacks
      `sphinx.ext.extlinks`, which was introduced in 1.0.0. Looking at the
      changelog it appears that 1.0.0 ought to work.
  11. 17 Oct, 2015 1 commit
    • Ben Gamari's avatar
      Libdw: Add libdw-based stack unwinding · a6a3dabc
      Ben Gamari authored
      This adds basic support to the RTS for DWARF-assisted unwinding of the
      Haskell and C stack via libdw. This only adds the infrastructure;
      consumers of this functionality will be introduced in future diffs.
      Currently we are carrying the initial register collection code in
      Libdw.c but this will eventually make its way upstream to libdw.
      Test Plan: See future patches
      Reviewers: Tarrasch, scpmw, austin, simonmar
      Reviewed By: austin, simonmar
      Subscribers: simonmar, thomie, erikd
      Differential Revision: https://phabricator.haskell.org/D1196
      GHC Trac Issues: #10656
  12. 15 Oct, 2015 1 commit
  13. 13 Oct, 2015 1 commit
    • Erik de Castro Lopo's avatar
      Switch to LLVM version 3.7 · 29310b62
      Erik de Castro Lopo authored
      Before this commit, GHC only supported LLVM 3.6. Now it only supports
      LLVM 3.7 which was released in August 2015. LLVM version 3.6 and earlier
      do not work on AArch64/Arm64, but 3.7 does.
      * Add CC_Ghc constructor to LlvmCallConvention.
      * Replace `maxSupportLlvmVersion`/`minSupportLlvmVersion` with
        a single `supportedLlvmVersion` variable.
      * Get `supportedLlvmVersion` from version specified in configure.ac.
      * Drop llvmVersion field from DynFlags (no longer needed because only
        one version is supported).
      Test Plan: Validate on x86_64 and arm
      Reviewers: bgamari, austin
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1320
      GHC Trac Issues: #10953
  14. 09 Oct, 2015 2 commits
  15. 03 Oct, 2015 2 commits
  16. 08 Sep, 2015 2 commits
    • thomie's avatar
      Build system: check for inconsistent settings (#10157) · 1b8eca18
      thomie authored
      `configure` currently detects when the docbook and hscolour tools aren't
      available, and instead of failing outright (as it does for missing alex
      and happy), sets some variables in mk/config.mk to tell `make` not to
      build the documentation.
      Sometimes, however, you want to really make sure all documentation gets
      built, fully colourized. For example when making a release. To do so,
      you can override the mentioned variables from mk/config.mk in
      mk/build.mk (e.g. set HSCOLOUR_SRCS=YES).
      This patch adds some error checking to make sure that doing so will not
      result in weird build failures when those tools are still missing.
      Test Plan: ran `make` a couple of times, with different mk/config.mk settings.
      Reviewed by: austin
      Differential Revision: https://phabricator.haskell.org/D1232
    • thomie's avatar
      Build system: remove hack for Mac OSX in configure.ac (#10476) · 864a9c4f
      thomie authored
      Cross-compilation on Mac OSX currently doesn't work. While building
      stage 1, the build system uses the `ar` for the target architecture
      instead of the `ar` for build/host architecture.
      The cause is a hack added in 24746fe7
      (2010), to supporting bootstrap compilers built with older versions of
      Xcode. Xcode 4.3 started installing command line tools in a different
      location. Assuming this all behind us now, and the paths didn't change
      again (you never now), we can delete the hack.
      Deleting the hack fixes the cross compilation issue. Tested by Trac user
      Reviewed by: austin
      Differential Revision: https://phabricator.haskell.org/D1231
  17. 25 Aug, 2015 1 commit
    • Erik de Castro Lopo's avatar
      configure.ac: Allow disabling of large-address-space · fba724cc
      Erik de Castro Lopo authored
      Recent changes (commit 0d1a8d09) for 64 bit platforms allowed GHC
      to mmap one huge (currently 1 terrabyte) memory region from which to
      do its own allocations. This is enabled by default, but it would be
      nice (even just from the point of view of testing) to be able to
      disable this at configure time.
      Test Plan: configure and grep mk/config.h for USE_LARGE_ADDRESS_SPACE
      Reviewers: austin, ezyang, bgamari, rwbarton
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1170
      GHC Trac Issues: #10791
  18. 12 Aug, 2015 2 commits
    • Ben Gamari's avatar
      Update mingw tarball location · e415369e
      Ben Gamari authored
    • Tamar Christina's avatar
      Upgrade GCC to 5.2.0 for Windows x86 and x86_64 · 7b211b4e
      Tamar Christina authored
      This patch does a few things
      - Moved GHC x86 to MinGW-w64 (Using Awson's patch)
      - Moves Both GHCs to MSYS2 toolchains
      - Completely removes the dependencies on the git tarball repo
        - Downloads only the required tarball for the architecture for
          which we are building
        - Downloads the perl tarball is missing as well
        - Fixed a few bugs in the linker to fix tests on Windows
      The links currently point to repo.msys2.org and GitHub, it might be
      more desirable to mirror them on
      http://downloads.haskell.org/~ghc/mingw/ as with the previous patch
      For more details on what the MSYS2 packages I include see #10726
      (Awson's comment). but it should contain all we need
      and no python or fortran, which makes the uncompressed tar a 1-2
      hundreds mb smaller.
      The `GCC 5.2.0` in the package supports `libgcc` as a shared library,
      this is a problem since
      when compiling with -shared the produced dll now has a dependency on
      To solve this the flag `-static-libgcc` is now being used for all GCC
      calls on windows.
      Test Plan:
      ./validate was ran both on x86 and x86_64 windows and compared against
      the baseline.
      A few test were failing due to Ld no longer being noisy. These were
      The changes to the configure script *should* be validated by the build
      bots for the other platforms before landing
      Reviewers: simonmar, awson, bgamari, austin, thomie
      Reviewed By: thomie
      Subscribers: #ghc_windows_task_force, thomie, awson
      Differential Revision: https://phabricator.haskell.org/D1123
      GHC Trac Issues: #10726, #9014, #9218, #10435
  19. 31 Jul, 2015 1 commit
  20. 30 Jul, 2015 1 commit
    • Tamar Christina's avatar
      Make configure error out on missing ghc-tarballs on Windows · 9f7cdfee
      Tamar Christina authored
      Currently checking out the source on windows requires two git
      checkouts. One for the GHC sources and one for the GHC-tarballs.
      This patch will make configure issue an error if compiling under
      windows and the GHC-tarballs folder is missing.
      On failure the user is told which command they need to run to get the
      tarballs or if they want configure to handle it for them configure
      provide the `--enable-tarballs-autodownload` flag.
      Test Plan:
      1. make sure ghc-tarballs folder is not present
      2. run ./configure which should fail giving an error that tarballs is
      missing and how to get it
      3. run ./configure --enable-tarballs-autodownload and the tarballs
      should be downloaded and configure finishes
      4. rerun the command in 3, no new download should be done.
      5. run configure without --enable-tarballs-autodownload, configure
      should finish correctly.
      Reviewers: bgamari, austin, thomie
      Reviewed By: thomie
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D1108
      GHC Trac Issues: #10705
  21. 22 Jul, 2015 1 commit
    • gcampax's avatar
      Two step allocator for 64-bit systems · 0d1a8d09
      gcampax authored
      The current OS memory allocator conflates the concepts of allocating
      address space and allocating memory, which makes the HEAP_ALLOCED()
      implementation excessively complicated (as the only thing it cares
      about is address space layout) and slow. Instead, what we want
      is to allocate a single insanely large contiguous block of address
      space (to make HEAP_ALLOCED() checks fast), and then commit subportions
      of that in 1MB blocks as we did before.
      This is currently behind a flag, USE_LARGE_ADDRESS_SPACE, that is only enabled for
      certain OSes.
      Test Plan: validate
      Reviewers: simonmar, ezyang, austin
      Subscribers: thomie, carter
      Differential Revision: https://phabricator.haskell.org/D524
      GHC Trac Issues: #9706
  22. 21 Jul, 2015 1 commit
  23. 03 Jul, 2015 1 commit
    • Peter Trommler's avatar
      Implement PowerPC 64-bit native code backend for Linux · d3c1dda6
      Peter Trommler authored
      Extend the PowerPC 32-bit native code generator for "64-bit
      PowerPC ELF Application Binary Interface Supplement 1.9" by
      Ian Lance Taylor and "Power Architecture 64-Bit ELF V2 ABI Specification --
      OpenPOWER ABI for Linux Supplement" by IBM.
      The latter ABI is mainly used on POWER7/7+ and POWER8
      Linux systems running in little-endian mode. The code generator
      supports both static and dynamic linking. PowerPC 64-bit
      code for ELF ABI 1.9 and 2 is mostly position independent
      anyway, and thus so is all the code emitted by the code
      generator. In other words, -fPIC does not make a difference.
      rts/stg/SMP.h support is implemented.
      Following the spirit of the introductory comment in
      PPC/CodeGen.hs, the rest of the code is a straightforward
      extension of the 32-bit implementation.
      * Code is generated only in the medium code model, which
        is also gcc's default
      * Local symbols are not accessed directly, which seems to
        also be the case for 32-bit
      * LLVM does not work, but this does not work on 32-bit either
      * Must use the system runtime linker in GHCi, because the
        GHC linker for "static" object files (rts/Linker.c) for
        PPC 64-bit is not implemented. The system runtime
        (dynamic) linker works.
      * The handling of the system stack (register 1) is not ELF-
        compliant so stack traces break. Instead of allocating a new
        stack frame, spill code should use the "official" spill area
        in the current stack frame and deallocation code should restore
        the back chain
      * DWARF support is missing
      Fixes #9863
      Test Plan: validate (on powerpc, too)
      Reviewers: simonmar, trofi, erikd, austin
      Reviewed By: trofi
      Subscribers: bgamari, arnons1, kgardas, thomie
      Differential Revision: https://phabricator.haskell.org/D629
      GHC Trac Issues: #9863
  24. 10 Apr, 2015 1 commit
  25. 23 Mar, 2015 1 commit
    • Erik de Castro Lopo's avatar
      Do version specific detection of LLVM tools (#10170). · 42448e37
      Erik de Castro Lopo authored
      The LLVM developers seem to make breaking changes in the LLVM IR
      language between major releases. As a consumer of the LLVM tools
      GHC now needs to be locked more tightly to a single version of
      the LLVM tools.
      GHC HEAD currently only supports LLVM version 3.6. This commit
      changes the configure script to look for `llc-3.6` and `opt-3.6`
      before looking for `llc` and `opt`. If the former are not found,
      but the later are, check that they actually are version 3.6.
      At the same time, when detecting known problems with the LLVM
      tools (ie #9439) test for it using the versions of the LLVM tools
      retrieved from the bootstrap compiler's settings file.
      Test Plan: Manual testing.
      Reviewers: thomie, rwbarton, nomeata, austin
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D745
      GHC Trac Issues: #10170
  26. 12 Mar, 2015 1 commit
    • Erik de Castro Lopo's avatar
      Use the gold linker for linux/ARM and android/ARM targets. · 71fcc4c0
      Erik de Castro Lopo authored
      Fixes #8976 and #9873 by making use of the Binutils ld.gold
      linker explicit whenever the target is linux/ARM or android/ARM.
      This does not affect iOS where Apple provides its own linker.
      In order to achieve this, we need to add `-fuse-ld=gold` to
      the SettingsCCompilerLinkFlags setting and set
      SettingsLdCommand to `ld.gold` (or `${target}-ld.gold` when
      cross-compiling). In addition, simplifying the use of
      This patch was tested by ensuring that the following worked
      as expected:
        * Native builds on linux/x86_64 (nothing changed).
        * Native builds on linux/arm (and uses the gold linker).
        * Linux to linux/arm cross compiles (and uses the cross
          gold linker).
      Contributions by Ben Gamari, Joachim Breitner and Reid Barton.
      Reviewers: nomeata, bgamari, austin, rwbarton
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D715
      GHC Trac Issues: #8976 #9873
  27. 02 Mar, 2015 1 commit
    • thomie's avatar
      Fix detection of llvm-x.x · 1dfab7a8
      thomie authored
      Four bug fixes and a little refactoring.
      * `find -perm \mode` should be `find -perm /mode` (#9697)
      * `find -regex '$3' should be `find -regex "$3"` (#7661)
      From `man sh` on my system (Ubuntu 14.04):
      "Enclosing characters in single quotes preserves the literal meaning of all
      the characters ..."
      * LlcCmd and OptCmd should be passed to ghc, using `-pgmlo` and `-pgmlc`, for
        detection of #9439.
      * -pgmlo and -pgmlc were undocumented because of an xml tag misplacement.
      Test Plan:
      The aclocal.m4 macro has seen about 10 iterations since its inception. Without a
      testsuite, I can't guarantee this version is bug free either. It's all pretty
      Reviewers: bgamari, austin
      Reviewed By: austin
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D683
      GHC Trac Issues: #9697, #7661, #9439
  28. 23 Feb, 2015 1 commit
    • PHO's avatar
      Make top-level "configure" accept and propagate --with-curses-{includes,libraries} to libraries · bbb57a6b
      PHO authored
      If curses is installed into some non-standard path, we currently have
      to say something like the following in mk/build.mk:
        libraries/terminfo_CONFIGURE_OPTS += \
            --configure-option=--with-curses-includes=/somewhere/include \
      This is because the top-level configure does not accept nor propagate
      --with-curses-{includes,libraries} to libraries while it does so for
      iconv, gmp and libffi. It would be nice if curses were handled in the
      same manner.
      Test Plan: Install curses into some non-standard path. Then run the top-level "configure" script with options "--with-curses-includes=/path/to/curses/include" and "--with-curses-libraries=/path/to/curses/lib".
      Reviewers: austin
      Reviewed By: austin
      Subscribers: thomie, PHO
      Differential Revision: https://phabricator.haskell.org/D665
      GHC Trac Issues: #10096
  29. 17 Feb, 2015 1 commit
  30. 12 Jan, 2015 1 commit
    • rwbarton's avatar
      Move libffi configuration after basic toolchain setup · a5bc2579
      rwbarton authored
      The relevant aspect is that the libffi configuration's AC_CHECK_LIB
      and AC_CHECK_HEADERS are moved after FIND_GCC. There are two reasons
      to do this:
      1. We should detect the presence of libffi using the C compiler
      that we are eventually going to use to build GHC.
      2. Running AC_CHECK_HEADERS before FIND_GCC pollutes the CPP variable
      with "gcc -E" (wrong when cross-compiling), and CPP is not reset
      by FIND_GCC. Thus this patch fixes x86_64 -> i386 cross-compilation
      of integer-gmp2.
      Test Plan: Local x86_64 -> i386 cross-compiling validate; Harbormaster
      Reviewers: austin
      Reviewed By: austin
      Subscribers: erikd, carter, thomie
      Differential Revision: https://phabricator.haskell.org/D597
  31. 22 Dec, 2014 3 commits