summaryrefslogtreecommitdiff
path: root/compiler/ghci/Linker.lhs
Commit message (Collapse)AuthorAgeFilesLines
* Convert GHCi sources from .lhs to .hsRodlogic2014-10-291-1317/+0
| | | | | | | | | | | | | | Summary: Signed-off-by: Rodlogic <admin@rodlogic.net> Test Plan: Does it compile? Reviewers: hvr, austin Reviewed By: austin Subscribers: thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D319
* `M-x delete-trailing-whitespace` & `M-x untabify`Herbert Valerio Riedel2014-09-241-1/+1
|
* Change linker message verbosity to `-v2` (re #7863)Herbert Valerio Riedel2014-09-201-1/+1
| | | | | | | | | | | | | | | | With this change, the linker status logging output such as Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. is suppressed unless verbosity level is `-v2` or higher. This is done to reduce the compiler message noise when TH is involved, which can reduce the visibiliy of compile warnings. Reviewed By: ekmett, austin Differential Revision: https://phabricator.haskell.org/D232
* Add the ability to :set -l{foo} in ghci, fix #1407.archblob2014-09-161-9/+20
| | | | | | | | | | | | | | | | | | Summary: The dynamic linking code was already there but it was not called on flag changes in ghci. Test Plan: validate Reviewers: hvr, simonmar, austin Reviewed By: austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D194 GHC Trac Issues: #1407
* Fix validation error in Linker arising from package rep changesDuncan Coutts2014-08-291-1/+1
|
* Fix long lines and trailing whitespaceDuncan Coutts2014-08-291-3/+7
| | | | in the previous patches in this series
* Use ghc-local types for packages, rather than Cabal typesDuncan Coutts2014-08-291-5/+3
| | | | | | | | Also start using the new package db file format properly, by using the ghc-specific section. This is the main patch in the series for removing the compiler's dep on the Cabal lib.
* build: require GHC 7.6 for bootstrappingAustin Seipp2014-08-191-4/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: Per the usual standards, a build of GHC is only compileable by the last two releases (e.g. 7.8 only by 7.4 and 7.6). To make sure we don't get suckered into supporting older compilers, let's remove this support now. Signed-off-by: Austin Seipp <austin@well-typed.com> Test Plan: Try to bootstrap with GHC 7.4, watch it fail. Bootstrap with 7.6 or better, and everything works. Reviewers: hvr Reviewed By: hvr Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D167
* Make PackageState an abstract type.Edward Z. Yang2014-08-051-7/+2
| | | | | | | | | | | | Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D107
* Package keys (for linking/type equality) separated from package IDs.Edward Z. Yang2014-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set makes us no longer assume that a package key is a human readable string, leaving Cabal free to "do whatever it wants" to allocate keys; we'll look up the PackageId in the database to display to the user. This also means we have a new level of qualifier decisions to make at the package level, and rewriting some Safe Haskell error reporting code to DTRT. Additionally, we adjust the build system to use a new ghc-cabal output Make variable PACKAGE_KEY to determine library names and other things, rather than concatenating PACKAGE/VERSION as before. Adds a new `-this-package-key` flag to subsume the old, erroneously named `-package-name` flag, and `-package-key` to select packages by package key. RFC: The md5 hashes are pretty tough on the eye, as far as the file system is concerned :( ToDo: safePkg01 test had its output updated, but the fix is not really right: the rest of the dependencies are truncated due to the fact the we're only grepping a single line, but ghc-pkg is wrapping its output. ToDo: In a later commit, update all submodules to stop using -package-name and use -this-package-key. For now, we don't do it to avoid submodule explosion. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D80
* Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.Edward Z. Yang2014-07-211-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, both Cabal and GHC defined the type PackageId, and we expected them to be roughly equivalent (but represented differently). This refactoring separates these two notions. A package ID is a user-visible identifier; it's the thing you write in a Cabal file, e.g. containers-0.9. The components of this ID are semantically meaningful, and decompose into a package name and a package vrsion. A package key is an opaque identifier used by GHC to generate linking symbols. Presently, it just consists of a package name and a package version, but pursuant to #9265 we are planning to extend it to record other information. Within a single executable, it uniquely identifies a package. It is *not* an InstalledPackageId, as the choice of a package key affects the ABI of a package (whereas an InstalledPackageId is computed after compilation.) Cabal computes a package key for the package and passes it to GHC using -package-name (now *extremely* misnamed). As an added bonus, we don't have to worry about shadowing anymore. As a follow on, we should introduce -current-package-key having the same role as -package-name, and deprecate the old flag. This commit is just renaming. The haddock submodule needed to be updated. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D79 Conflicts: compiler/main/HscTypes.lhs compiler/main/Packages.lhs utils/haddock
* add support for x86_64-solaris2 platformKarel Gardas2014-07-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Summary: this set of patches adds support for x86_64-solaris2 platform Solaris is multi-lib platform which means it provides 32bit user-land together with 32bit and 64bit libraries. The 32bit libraries are located in <somewhere>/lib directories while 64bit libraries are located in <somewhere>/lib/64 directories. This is why GHCi required the fix since otherwise it'll attempt to load /usr/lib/libgmp.so which is 32bit library into 64bit binary process space (GHCi). This of course fails with wrong ELFCLASS32 error message. Another issue was that by default GNU C distributed with Solaris compiles into 32bit binary. We need to enforce compilation to 64bit binary by adding appropriate -m64 option. Test Plan: already built on x86_64-solaris2 Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D68
* Revert "Fix obscure problem with using the system linker (#8935)"Austin Seipp2014-06-301-49/+23
| | | | | | This reverts commit 2f8b4c9330b455d4cb31c186c747a7db12a69251. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix obscure problem with using the system linker (#8935)Simon Marlow2014-06-081-23/+49
| | | | See Note [RTLD_LOCAL] for a summary of the problem and solution, and
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-3/+4
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Fix #8770Austin Seipp2014-02-171-1/+10
| | | | | | | | | As usual, Mac OS X is extremely annoying (or the software is, anyway), because not only does it load dynamic libraries with the .dylib extension, but also the .so extension. For whatever reason. At least it's easy to fix. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Re-work the naming story for the GHCi prompt (Trac #8649)Simon Peyton Jones2014-01-091-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The basic idea here is simple, and described in Note [The interactive package] in HscTypes, which starts thus: Note [The interactive package] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Type and class declarations at the command prompt are treated as if they were defined in modules interactive:Ghci1 interactive:Ghci2 ...etc... with each bunch of declarations using a new module, all sharing a common package 'interactive' (see Module.interactivePackageId, and PrelNames.mkInteractiveModule). This scheme deals well with shadowing. For example: ghci> data T = A ghci> data T = B ghci> :i A data Ghci1.T = A -- Defined at <interactive>:2:10 Here we must display info about constructor A, but its type T has been shadowed by the second declaration. But it has a respectable qualified name (Ghci1.T), and its source location says where it was defined. So the main invariant continues to hold, that in any session an original name M.T only refers to oe unique thing. (In a previous iteration both the T's above were called :Interactive.T, albeit with different uniques, which gave rise to all sorts of trouble.) This scheme deals nicely with the original problem. It allows us to eliminate a couple of grotseque hacks - Note [Outputable Orig RdrName] in HscTypes - Note [interactive name cache] in IfaceEnv (both these comments have gone, because the hacks they describe are no longer necessary). I was also able to simplify Outputable.QueryQualifyName, so that it takes a Module/OccName as args rather than a Name. However, matters are never simple, and this change took me an unreasonably long time to get right. There are some details in Note [The interactive package] in HscTypes.
* Use dynamic linking only if the GHC package is compiled with -dynamic (#8376)Simon Marlow2013-10-111-7/+7
|
* Restructure compilation pipeline to allow hooksAustin Seipp2013-09-221-1/+1
| | | | | | | | | | | | | | | | This commit exposes GHC's internal compiler pipeline through a `Hooks` module in the GHC API. It currently allows you to hook: * Foreign import/exports declarations * The frontend up to type checking * The one shot compilation mode * Core compilation, and the module iface * Linking and the phases in DriverPhases.hs * Quasiquotation Authored-by: Luite Stegeman <stegeman@gmail.com> Authored-by: Edsko de Vries <edsko@well-typed.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add a better implementation of dropTail, and use itSimon Peyton Jones2013-08-191-1/+1
|
* Don't run the system linker unncessarily.Patrick Palka2013-08-141-1/+5
| | | | | | | | | This wastes time when evaluating expressions in GHCi. We also disable object unloading when using the dynamic linker, too. Fixes #7382. Fixes #7326. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Allow the GHCi messages to be overridden via the GHC API; fixes #7456Ian Lynagh2013-06-231-4/+5
| | | | | | | They now go through log_action. The existing severities all used printDoc, which always adds a trailing newline, which we don't want for the GHCi messages. I therefore added a new severity SevInteractive, which doesn't add a newline.
* Fix many ASSERT uses under Clang.Austin Seipp2013-06-181-2/+2
| | | | | | Clang doesn't like whitespace between macro and arguments. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Handle -opt<blah> options more consistently (#7909)Simon Marlow2013-05-211-5/+4
| | | | | Now these are always added by the run<blah> functions in SysTools, so we never miss any out. Several cleanups resulted.
* Fix ghci on Windows when GHC is dynamically linkedIan Lynagh2013-05-141-1/+1
| | | | | | On Windows, we need to prepend "lib" to Haskell DLLs. (maybe we should be naming the DLLs without the prefix instead? But this works for now).
* Fix searching for object files when doing THIan Lynagh2013-03-161-35/+31
| | | | We were finding vanilla object files when TH needed dynamic object files.
* A little polishingIan Lynagh2013-03-161-1/+1
|
* By default, use the dynamic way for programs in the GHC treeIan Lynagh2013-03-151-17/+11
| | | | | In particular, this means that GHCi will use DLLs, rather than loading object files itself.
* Add OSiOS, and define and use platformUsesFrameworks; part of #7720Ian Lynagh2013-03-021-16/+15
|
* Use throwGhcExceptionIO rather than throwGhcException in ghci/Linker.lhsIan Lynagh2013-01-301-13/+13
|
* Replace all uses of ghcError with throwGhcException and purge ghcError.Erik de Castro Lopo2012-11-301-13/+13
|
* typoGabor Greif2012-10-241-2/+2
|
* Set the way when loading dynamic objects for GHCiIan Lynagh2012-10-191-0/+5
| | | | | This fixes using TH when building profiled libraries when dynamic-by-default is enabled.
* Some alpha renamingIan Lynagh2012-10-161-1/+1
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* When dynamic-by-default, don't use the GHCi linkerIan Lynagh2012-10-131-16/+47
| | | | We instead link objects into a temporary DLL and dlopen that
* Make adjust_ul handle BCOsIan Lynagh2012-10-051-1/+3
| | | | | | | We never ran into this before, because replace_osuf was almost always False (i.e. we were almost always using the vanilla way when using bytecode, so adjust_ul wasn't needed). Now that we can have the dynamic way on by default many tests were failing because of it.
* Load the right object files in ghciIan Lynagh2012-10-041-29/+44
| | | | When we have a dynamic ghc, we need to load the dynamic object files
* Fix the recompilation check for dynamic librariesIan Lynagh2012-10-031-7/+0
| | | | | I've put mkSOName in HscTypes for now; I'm not sure what the best place for it is.
* typoGabor Greif2012-09-171-1/+1
|
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-9/+11
|
* Move ldInputs into DynFlagsIan Lynagh2012-09-031-3/+2
|
* Remove some CPP from compiler/ghci/Linker.lhsIan Lynagh2012-08-281-2/+3
|
* Remove Util.{isDarwinTarget,isWindowsTarget}Ian Lynagh2012-08-281-26/+36
|
* Add a Note, copying text from #2437Simon Marlow2012-07-021-1/+27
|
* Pass DynFlags down to showSDocIan Lynagh2012-06-121-9/+9
|
* Pass DynFlags to the LogActionIan Lynagh2012-06-111-2/+2
| | | | | | | A side-effect is that we can no longer use the LogAction in defaultErrorHandler, as we don't have DynFlags at that point. But all that defaultErrorHandler did is to print Strings as SevFatal, so now it takes a 'FatalMessager' instead.
* avoid name clashSimon Marlow2012-06-041-0/+4
|
* Remove some more stdout/stderr usesIan Lynagh2012-05-291-4/+5
|
* Replace printDump with a new SeverityIan Lynagh2012-05-291-3/+4
| | | | | | We now use log_action with severity SevDump, rather than calling printDump. This means that what happens to dumped info is now under the control of the GHC API user, rather than always going to stdout.
* Whitespace fixes in ghci/Linker.lhsIan Lynagh2012-03-201-328/+321
|