summaryrefslogtreecommitdiff
path: root/mk
Commit message (Collapse)AuthorAgeFilesLines
* Bump Windows toolchainBen Gamari2023-02-031-1/+1
| | | | Updates to LLVM 14, hopefully fixing #21964.
* Drop mk/{build,install,config}.mk.inBen Gamari2022-08-253-1140/+0
|
* Drop mkdirhierBen Gamari2022-08-251-2/+0
| | | | This is only used by nofib's dead `dist` target
* Drop make build systemBen Gamari2022-08-2527-773/+0
| | | | | | | | | | | Here we at long last remove the `make`-based build system, it having been replaced with the Shake-based Hadrian build system. Users are encouraged to refer to the documentation in `hadrian/doc` and this [1] blog post for details on using Hadrian. Closes #17527. [1] https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html
* compiler: Drop --build-id=none hackBen Gamari2022-08-181-4/+0
| | | | | | | | | Since 2011 the object-joining implementation has had a hack to pass `--build-id=none` to `ld` when supported, seemingly to work around a linker bug. This hack is now unnecessary and may break downstream users who expect objects to have valid build-ids. Remove it. Closes #22060.
* hadrian: Fix bindist installation on DarwinBen Gamari2022-08-091-0/+34
| | | | | | | It turns out that `cp -P` on Darwin does not always copy a symlink as a symlink. In order to get these semantics one must pass `-RP`. It's not entirely clear whether this is valid under POSIX, but it is nevertheless what Apple does.
* Introduce package to capture dependency on C++ stdlibBen Gamari2022-05-171-0/+13
| | | | | | | | Here we introduce a new "virtual" package into the initial package database, `system-cxx-std-lib`. This gives users a convenient, platform agnostic way to link against C++ libraries, addressing #20010. Fixes #20010.
* driver: Introduce pgmcxxBen Gamari2022-05-171-1/+2
| | | | | | | | | | Here we introduce proper support for compilation of C++ objects. This includes: * logic in `configure` to detect the C++ toolchain and propagating this information into the `settings` file * logic in the driver to use the C++ toolchain when compiling C++ sources
* Enable eventlog support in all ways by defaultBen Gamari2022-04-272-50/+22
| | | | | | | | | | | | | | | | | Here we deprecate the eventlogging RTS ways and instead enable eventlog support in the remaining ways. This simplifies packaging and reduces GHC compilation times (as we can eliminate two whole compilations of the RTS) while simplifying the end-user story. The trade-off is a small increase in binary sizes in the case that the user does not want eventlogging support, but we think that this is a fine trade-off. This also revealed a latent RTS bug: some files which included `Cmm.h` also assumed that it defined various macros which were in fact defined by `Config.h`, which `Cmm.h` did not include. Fixing this in turn revealed that `StgMiscClosures.cmm` failed to import various spinlock statistics counters, as evidenced by the failed unregisterised build. Closes #18948.
* Drop remaining vestiges of libtoolBen Gamari2022-04-251-1/+0
| | | | | | | | | | | | | Drop libtool logic from gen-dll, allowing us to drop the remaining logic from the `configure` script. Strangely, this appears to reliably reduce compiler allocations of T16875 on Windows. Closes #18826. Metric Decrease: T16875
* get-win32-tarballs: Drop i686 architectureBen Gamari2022-04-221-2/+2
| | | | | | As of #18487 we no longer support 32-bit Windows. Fixes #21372.
* Windows/Clang: Build system adaptationBen Gamari2022-04-062-11/+3
| | | | | | | | | | * Bump win32-tarballs to 0.7 * Move Windows toolchain autoconf logic into separate file * Use clang and LLVM utilities as described in #21019 * Disable object merging as lld doesn't support -r * Drop --oformat=pe-bigobj-x86-64 arguments from ld flags as LLD detects that the output is large on its own. * Drop gcc wrapper since Clang finds its root fine on its own.
* Build ar archives with -L when "joining" objectsBen Gamari2022-04-061-0/+1
| | | | Since there may be .o files which are in fact archives.
* Don't try to build stage1 with -eventlog if stage0 doesn't provide itPHO2022-02-081-0/+3
| | | | Like -threaded, stage0 isn't guaranteed to have an event-logging RTS.
* Fix a few Note inconsistenciesBen Gamari2022-02-012-5/+6
|
* Rip out remaining SPARC supportBen Gamari2022-01-291-1/+1
|
* Propagate PythonCmd to make build systemBen Gamari2022-01-291-0/+5
|
* hadrian: Fully implement source distributions (#19317)Zubin Duggal2022-01-111-2/+11
| | | | | | We use `git ls-files` to get the list of files to include in the source distribution. Also implements the `-testsuite` and `-extra-tarballs` distributions.
* hadrian: Don't rely on realpath in bindist MakefileBen Gamari2021-12-021-0/+53
| | | | | | | | As noted in #19963, `realpath` is not specified by POSIX and therefore cannot be assumed to be available. Here we provide a POSIX shell implementation of `realpath`, due to Julian Ospald and others. Closes #19963.
* Make ambient MinGW support a proper settingsJohn Ericson2021-11-272-1/+1
| | | | | | | Get rid of `USE_INPLACE_MINGW_TOOLCHAIN` and use a settings file entry instead. The CPP setting was originally introduced in f065b6b012.
* Make: Get rid of GHC_INCLUDE_DIRSJohn Ericson2021-11-151-1/+0
| | | | | | These dirs should not be included in all stages. Instead make the per-stage `BUILD_*_INCLUDE_DIR` "plural" to insert `rts/include` in the right place.
* Make: Install RTS headers in `$libdir/rts/include` not `$libdir/include`John Ericson2021-11-121-1/+1
| | | | | | | Before we were violating the convention of every other package. This fixes that. It matches the changes made in d5de970dafd5876ef30601697576167f56b9c132 to the location of the files in the repo.
* Make build system: Put make generated include's in RTS distdirsJohn Ericson2021-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are best thought of as being part of the RTS. - After !6791, `ghcautoconf.h` won't be used by the compiler inappropriately. - `ghcversion.h` is only used once outside the RTS, which is `compiler/cbits/genSym.c`. Except we *do* mean the RTS GHC is built against there, so it's better if we always get get the installed version. - `ghcplatform.h` alone is used extensively outside the RTS, but since we no longer have a target platform it is perfectly safe/correct to get the info from the previous RTS. All 3 are exported from the RTS currently and in the bootstrap window. This commit just swaps directories around, such that the new headers may continue to be used in stage 0 despite the reasoning above, but the idea is that we can subsequently make more interesting changes doubling down on the reasoning above. In particular, in !6803 we'll start "morally" moving `ghcautonconf.h` over, introducing an RTS configure script and temporary header of its `AC_DEFINE`s until the top-level configure script doesn't define any more. Progress towards #17191
* Remove stray reference to `dist-ghcconstants`John Ericson2021-10-251-1/+1
| | | | | I think this hasn't been a thing since 86054b4ab5125a8b71887b06786d0a428539fb9c, almost 10 years ago!
* Link with libm dynamically (#19877)Sylvain Henry2021-09-221-0/+1
| | | | The compiler should be independent of the target.
* Move `/includes` to `/rts/include`, sort per package betterJohn Ericson2021-08-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make the packages in this repo "reinstallable", we need to associate source code with a specific packages. Having a top level `/includes` dir that mixes concerns (which packages' includes?) gets in the way of this. To start, I have moved everything to `rts/`, which is mostly correct. There are a few things however that really don't belong in the rts (like the generated constants haskell type, `CodeGen.Platform.h`). Those needed to be manually adjusted. Things of note: - No symlinking for sake of windows, so we hard-link at configure time. - `CodeGen.Platform.h` no longer as `.hs` extension (in addition to being moved to `compiler/`) so as not to confuse anyone, since it is next to Haskell files. - Blanket `-Iincludes` is gone in both build systems, include paths now more strictly respect per-package dependencies. - `deriveConstants` has been taught to not require a `--target-os` flag when generating the platform-agnostic Haskell type. Make takes advantage of this, but Hadrian has yet to.
* rts: Break up adjustor logicBen Gamari2021-07-271-10/+2
|
* Adds AArch64 Native Code GeneratorMoritz Angermann2021-06-051-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In which we add a new code generator to the Glasgow Haskell Compiler. This codegen supports ELF and Mach-O targets, thus covering Linux, macOS, and BSDs in principle. It was tested only on macOS and Linux. The NCG follows a similar structure as the other native code generators we already have, and should therfore be realtively easy to follow. It supports most of the features required for a proper native code generator, but does not claim to be perfect or fully optimised. There are still opportunities for optimisations. Metric Decrease: ManyAlternatives ManyConstructors MultiLayerModules PmSeriesG PmSeriesS PmSeriesT PmSeriesV T10421 T10421a T10858 T11195 T11276 T11303b T11374 T11822 T12227 T12545 T12707 T13035 T13253 T13253-spj T13379 T13701 T13719 T14683 T14697 T15164 T15630 T16577 T17096 T17516 T17836 T17836b T17977 T17977b T18140 T18282 T18304 T18478 T18698a T18698b T18923 T1969 T3064 T5030 T5321FD T5321Fun T5631 T5642 T5837 T783 T9198 T9233 T9630 T9872d T9961 WWRec Metric Increase: T4801
* [bindist] inject xattr -c -r . into the darwin install phaseMoritz Angermann2021-05-251-0/+7
| | | | This is so awful, but at least it might get the job done.
* Remove dynamic-by-default (#16782)Sylvain Henry2021-04-077-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dynamic-by-default was a mechanism to automatically select the -dynamic way for some targets. It was implemented in a convoluted way: it was defined as a flavour option, hence it couldn't be passed as a global settings (which are produced by `configure` before considering flavours), so a build system rule was used to pass -DDYNAMIC_BY_DEFAULT to the C compiler so that deriveConstants could infer it. * Make build system has it disabled for 8 years (951e28c0625ece7e0db6ac9d4a1e61e2737b10de) * It has never been implemented in Hadrian * Last time someone tried to enable it 1 year ago it didn't work (!2436) * Having this as a global constant impedes making GHC multi-target (see !5427) This commit fully removes support for dynamic-by-default. If someone wants to reimplement something like this, it would probably need to move the logic in the compiler. (Doing this would probably need some refactoring of the way the compiler handles DynFlags: DynFlags are used to store and to pass enabled ways to many parts of the compiler. It can be set by command-line flags, GHC API, global settings. In multi-target GHC, we will use DynFlags to load the target platform and its constants: but at this point with the current DynFlags implementation we can't easily update the existing DynFlags with target-specific options such as dynamic-by-default without overriding ways previously set by the user.)
* Implement riscv64 LLVM backendAndreas Schwab2021-03-051-1/+1
| | | | This enables a registerised build for the riscv64 architecture.
* Bump win32-tarballs version to 0.3Ben Gamari2020-10-091-1/+1
| | | | This should fix #18774.
* Enable TICKY_TICKY for debug builds when building with makefiles.David Himmelstrup2020-09-111-2/+2
|
* [macOS] improved runpath handlingMoritz Angermann2020-09-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In b592bd98ff25730bbe3c13d6f62a427df8c78e28 we started using -dead_strip_dylib on macOS when lining dynamic libraries and binaries. The underlying reason being the Load Command Size Limit in macOS Sierra (10.14) and later. GHC will produce @rpath/libHS... dependency entries together with a corresponding RPATH entry pointing to the location of the libHS... library. Thus for every library we produce two Load Commands. One to specify the dependent library, and one with the path where to find it. This makes relocating libraries and binaries easier, as we just need to update the RPATH entry with the install_name_tool. The dynamic linker will then subsitute each @rpath with the RPATH entries it finds in the libraries load commands or the environement, when looking up @rpath relative libraries. -dead_strip_dylibs intructs the linker to drop unused libraries. This in turn help us reduce the number of referenced libraries, and subsequently the size of the load commands. This however does not remove the RPATH entries. Subsequently we can end up (in extreme cases) with only a single @rpath/libHS... entry, but 100s or more RPATH entries in the Load Commands. This patch rectifies this (slighly unorthodox) by passing *no* -rpath arguments to the linker at link time, but -headerpad 8000. The headerpad argument is in hexadecimal and the maxium 32k of the load command size. This tells the linker to pad the load command section enough for us to inject the RPATHs later. We then proceed to link the library or binary with -dead_strip_dylibs, and *after* the linking inspect the library to find the left over (non-dead-stripped) dependencies (using otool). We find the corresponding RPATHs for each @rpath relative dependency, and inject them into the library or binary using the install_name_tool. Thus achieving a deadstripped dylib (and rpaths) build product. We can not do this in GHC, without starting to reimplement a dynamic linker as we do not know which symbols and subsequently libraries are necessary. Commissioned-by: Mercury Technologies, Inc. (mercury.com)
* configure: Avoid hard-coded ld path on WindowsGHC GitLab CI2020-09-041-0/+10
| | | | | | | The fix to #17962 ended up regressing on Windows as it failed to replicate the logic responsible for overriding the toolchain paths on Windows. This resulted in a hard-coded path to a directory that likely doesn't exist on the user's system (#18550).
* document how build system find toolchains on WindowsTamar Christina2020-08-281-0/+1
|
* Fix use distro toolchianTamar Christina2020-08-281-2/+3
|
* Refactor handling of object mergingBen Gamari2020-08-051-1/+2
| | | | | | | | | Previously to merge a set of object files we would invoke the linker as usual, adding -r to the command-line. However, this can result in non-sensical command-lines which causes lld to balk (#17962). To avoid this we introduce a new tool setting into GHC, -pgmlm, which is the linker which we use to merge object files.
* Replace ghcWithNativeCodeGen with a proper Backend datatypeSylvain Henry2020-07-221-13/+0
| | | | | | | | | | | | | | | | * Represent backends with a `Backend` datatype in GHC.Driver.Backend * Don't detect the default backend to use for the target platform at compile time in Hadrian/make but at runtime. It makes "Settings" simpler and it is a step toward making GHC multi-target. * The latter change also fixes hadrian which has not been updated to take into account that the NCG now supports AIX and PPC64 (cf df26b95559fd467abc0a3a4151127c95cb5011b9 and d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984) * Also we don't treat iOS specifically anymore (cf cb4878ffd18a3c70f98bdbb413cd3c4d1f054e1f)
* get-win32-tarballs: Fix detection of missing tarballsBen Gamari2020-07-221-1/+3
| | | | | This fixes the error message given by configure when the user attempts to configure without first download the win32 tarballs.
* hadrian/make: Detect makeindexBen Gamari2020-06-251-0/+1
| | | | | | Previously we would simply assume that makeindex was available. Now we correctly detect it in `configure` and respect this conclusion in hadrian and make.
* Update `make` based build systemSylvain Henry2020-06-178-10/+10
| | | | * replace integer-* package selection with ghc-bignum backend selection
* Clean up file paths for new module hierarchyTakenobu Tani2020-06-011-3/+3
| | | | | | | | | This updates comments only. This patch replaces file references according to new module hierarchy. See also: * https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular * https://gitlab.haskell.org/ghc/ghc/issues/13009
* Windows: Bump Windows toolchain to 0.2Ben Gamari2020-05-301-1/+1
|
* Build a threaded stage 1 if the bootstrapping GHC supports it.Travis Whitaker2020-05-291-0/+3
|
* get-win32-tarballs: Improve diagnostics outputBen Gamari2020-05-131-2/+8
|
* get-win32-tarballs: Fix base URLBen Gamari2020-05-131-1/+0
| | | | Revert a change previously made for testing purposes.
* Kill wORDS_BIGENDIAN and replace it with platformByteOrder (#17957)Sylvain Henry2020-04-011-0/+1
| | | | | | Metric Decrease: T13035 T1969
* Modules: Driver (#13009)Sylvain Henry2020-02-211-1/+1
| | | | submodule updates: nofib, haddock
* Rework handling of win32 toolchain tarballsBen Gamari2020-02-142-326/+59
|