summaryrefslogtreecommitdiff
path: root/ghc/compiler/main
Commit message (Collapse)AuthorAgeFilesLines
...
* [project @ 2005-01-31 16:59:37 by simonpj]simonpj2005-01-312-48/+50
| | | | Tidy up stop-phase passing; fix bug in -o handling for ghc -E X.hs -o X.pp
* [project @ 2005-01-31 05:27:14 by wolfgang]wolfgang2005-01-312-12/+25
| | | | | | | | | | Reorganise handling of -fPIC flags passed to C compiler. The flags expected by gcc differ only slightly per platform (basically depending whether you are on a Mac or not), we don't need separate cases for every processor. TODO: Display an error message for platforms where -fPIC -fvia-C is not supported.
* [project @ 2005-01-28 18:50:25 by ross]ross2005-01-281-4/+4
| | | | add missing underscores
* [project @ 2005-01-28 14:27:00 by simonmar]simonmar2005-01-281-3/+6
| | | | | add an INCLUDE pragma, as a compiler-independent alternative to -#include.
* [project @ 2005-01-28 14:21:12 by simonmar]simonmar2005-01-281-4/+4
| | | | Fix -no-recomp
* [project @ 2005-01-28 12:55:17 by simonmar]simonmar2005-01-2810-50/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationalise the BUILD,HOST,TARGET defines. Recall that: - build is the platform we're building on - host is the platform we're running on - target is the platform we're generating code for The change is that now we take these definitions as applying from the point of view of the particular source code being built, rather than the point of view of the whole build tree. For example, in RTS and library code, we were previously testing the TARGET platform. But under the new rule, the platform on which this code is going to run is the HOST platform. TARGET only makes sense in the compiler sources. In practical terms, this means that the values of BUILD, HOST & TARGET may vary depending on which part of the build tree we are in. Actual changes: - new file: includes/ghcplatform.h contains platform defines for the RTS and library code. - new file: includes/ghcautoconf.h contains the autoconf settings only (HAVE_BLAH). This is so that we can get hold of these settings independently of the platform defines when necessary (eg. in GHC). - ghcconfig.h now #includes both ghcplatform.h and ghcautoconf.h. - MachRegs.h, which is included into both the compiler and the RTS, now has to cope with the fact that it might need to test either _TARGET_ or _HOST_ depending on the context. - the compiler's Makefile now generates stage{1,2,3}/ghc_boot_platform.h which contains platform defines for the compiler. These differ depending on the stage, of course: in stage2, the HOST is the TARGET of stage1. This was wrong before. - The compiler doesn't get platform info from Config.hs any more. Previously it did (sometimes), but unless we want to generate a new Config.hs for each stage we can't do this. - GHC now helpfully defines *_{BUILD,HOST}_{OS,ARCH} automatically in CPP'd Haskell source. - ghcplatform.h defines *_TARGET_* for backwards compatibility (ghcplatform.h is included by ghcconfig.h, which is included by config.h, so code which still #includes config.h will get the TARGET settings as before). - The Users's Guide is updated to mention *_HOST_* rather than *_TARGET_*. - coding-style.html in the commentary now contains a section on platform defines. There are further doc updates to come. Thanks to Wolfgang Thaller for pointing me in the right direction.
* [project @ 2005-01-27 15:55:38 by simonpj]simonpj2005-01-274-49/+59
| | | | Make -no-recomp a dynamic flag
* [project @ 2005-01-27 14:38:29 by simonmar]simonmar2005-01-271-6/+7
| | | | Fix explicit layout
* [project @ 2005-01-27 11:50:58 by simonpj]simonpj2005-01-271-18/+5
| | | | | | | | Make sure that the interactive context can see home-package instances; I forgot to do this when making tcRnModule find the appropriate intances (TcRnDriver rev 1.91) This was causing SourceForge [ghc-Bugs-1106171].
* [project @ 2005-01-27 10:44:00 by simonpj]simonpj2005-01-2713-821/+1115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------------------------------------------- Replace hi-boot files with hs-boot files -------------------------------------------- This major commit completely re-organises the way that recursive modules are dealt with. * It should have NO EFFECT if you do not use recursive modules * It is a BREAKING CHANGE if you do ====== Warning: .hi-file format has changed, so if you are ====== updating into an existing HEAD build, you'll ====== need to make clean and re-make The details: [documentation still to be done] * Recursive loops are now broken with Foo.hs-boot (or Foo.lhs-boot), not Foo.hi-boot * An hs-boot files is a proper source file. It is compiled just like a regular Haskell source file: ghc Foo.hs generates Foo.hi, Foo.o ghc Foo.hs-boot generates Foo.hi-boot, Foo.o-boot * hs-boot files are precisely a subset of Haskell. In particular: - they have the same import, export, and scoping rules - errors (such as kind errors) in hs-boot files are checked You do *not* need to mention the "original" name of something in an hs-boot file, any more than you do in any other Haskell module. * The Foo.hi-boot file generated by compiling Foo.hs-boot is a machine- generated interface file, in precisely the same format as Foo.hi * When compiling Foo.hs, its exports are checked for compatibility with Foo.hi-boot (previously generated by compiling Foo.hs-boot) * The dependency analyser (ghc -M) knows about Foo.hs-boot files, and generates appropriate dependencies. For regular source files it generates Foo.o : Foo.hs Foo.o : Baz.hi -- Foo.hs imports Baz Foo.o : Bog.hi-boot -- Foo.hs source-imports Bog For a hs-boot file it generates similar dependencies Bog.o-boot : Bog.hs-boot Bog.o-boot : Nib.hi -- Bog.hs-boto imports Nib * ghc -M is also enhanced to use the compilation manager dependency chasing, so that ghc -M Main will usually do the job. No need to enumerate all the source files. * The -c flag is no longer a "compiler mode". It simply means "omit the link step", and synonymous with -no-link.
* [project @ 2005-01-20 14:22:19 by simonmar]simonmar2005-01-202-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fill in the haddock-interfaces and haddock-html fields in the package.conf files. To do this I had to make some changes: - haddock-interfaces requires the value of $(datadir). We can't just plug this in, because $(datadir) might change at install-time (eg. a Windows installer can be placed anywhere, as can a Unix binary .tar.gz distribution). The current trick is for the compiler to splice in the value of $libdir in package.conf at runtime. So we could extend this mechanism and tell the compiler the value of $datadir via a command-line option, but that seems ugly. On Windows, $datadir==$libdir, so we don't need any changes: package.conf still uses $libdir, and a Windows installation is independent of its absolute location. Even 'make install' on Windows should have this property. On Unix: - for 'make install' and in-place execution, we just use absolute paths in package.conf - for a binary dist, we generate a package.conf that refers to $libdir and $datadir, and splice in the values at install-time (distrib/Makefile-bin.in). - Also, I renamed $libdir to $topdir to more closely reflect its actual meaning. This is somewhat malicious in that it will flush out all those clients using $libdir when they really shouldn't be :-)
* [project @ 2005-01-18 13:51:28 by simonmar]simonmar2005-01-181-3/+4
| | | | Update a comment
* [project @ 2005-01-18 12:18:11 by simonpj]simonpj2005-01-188-41/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------ Reorganisation of hi-boot files ------------------------ The main point of this commit is to arrange that in the Compilation Manager's dependendency graph, hi-boot files are proper nodes. This is important to make sure that we compile everything in the right order. It's a step towards hs-boot files. * The fundamental change is that CompManager.ModSummary has a new field, ms_boot :: IsBootInterface I also tided up CompManager a bit. No change to the Basic Plan. ModSummary is now exported abstractly from CompManager (was concrete) * Hi-boot files now have import declarations. The idea is they are compulsory, so that the dependency analyser can find them * I changed an invariant: the Compilation Manager used to ensure that hscMain was given a HomePackageTable only for the modules 'below' the one being compiled. This was really only important for instances and rules, and it was a bit inconvenient. So I moved the filter to the compiler itself: see HscTypes.hptInstances and hptRules. * Module Packages.hs now defines data PackageIdH = HomePackage -- The "home" package is the package -- curently being compiled | ExtPackage PackageId -- An "external" package is any other package It was just a Maybe type before, so this makes it a bit clearer. * I tried to add a bit better location info to the IfM monad, so that errors in interfaces come with a slightly more helpful error message. See the if_loc field in TcRnTypes --- and follow-on consequences * Changed Either to Maybes.MaybeErr in a couple of places (more perspicuous)
* [project @ 2005-01-14 17:57:41 by simonmar]simonmar2005-01-145-122/+75
| | | | | | | | | | | | | | HEADS UP! You now need to use an up to date Happy from CVS to build GHC. Happy version 1.15 will be released shortly. Replace the slow hacked up String-based GetImports with one based on the real Haskell parser. This requires a new addition to Happy to support parsing partial files. We now avoid reading each source file off the disk twice: once to get its module name and imports, and again to parse it. Instead we just slurp it once, and cache the StringBuffer. This should result in improved startup times for ghc --make, especially when there are lots of source files.
* [project @ 2005-01-14 08:01:26 by wolfgang]wolfgang2005-01-142-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dynamic Linking, Part 2: Hack the Makefiles to build dynamic libraries. This allows you to actually use dynamic libraries to greatly reduce binary sizes on Darwin/PowerPC and on powerpc64-linux (for now). To use this, add the following to your build.mk SplitObjs=NO GhcBuildDylibs=YES GhcStage2HcOpts=-dynamic GhcLibHcOpts+=-fPIC -dynamic GhcRtsHcOpts+=-fPIC -dynamic GHC_CC_OPTS+=-fPIC (You can leave out the last three lines on powerpc64-linux). Then, to compile a program using dynamic libraries, pass the -dynamic option to GHC. To make GHCi use the dynamic libraries instead of .o files, just delete the HS*.o files. The dynamic library files are named libHSfoo_dyn.dylib or libHSfoo_dyn.so. Note that the dynamic and static libraries are build from the same .o files, but we really want to build the static libraries with SplitObjs and without -fPIC -dynamic to achieve better code size and performance. ghc/compiler/ghci/Linker.lhs: When looking for a library, look for HSfoo.o first (as before), then look for libHSfoo_dyn.[so/dylib] before looking for libHSfoo.[so/dylib]. ghc/compiler/main/DriverPipeline.hs: Main.dll_o and PrelMain.dll_o are dead, at least for now. ghc/compiler/main/Packages.lhs: When -dynamic is specified, add "_dyn" to all libraries specified in hs-libraries (not to the extra-libs). ghc/lib/compat/Makefile: Never build libghccompat as a dynamic lib. mk/package.mk: if GhcBuildDylibs is set to YES, build dynamic libraries. mk/target.mk: When installing .dylibs (Darwin only), update the install_name to point to the final location. (Somebody please read Apple's documentation on what install_names are, and then comment on whether this is a useful feature or whether it should be done the "normal" unix way).
* [project @ 2005-01-12 13:36:30 by simonmar]simonmar2005-01-122-8/+9
| | | | Restore splitting at ':' for the -i option, which I broke recently.
* [project @ 2005-01-11 16:21:53 by simonmar]simonmar2005-01-111-7/+12
| | | | ignore OPTIONS_anything_else when looking for OPTIONS_GHC/OPTIONS pragmas.
* [project @ 2005-01-11 15:59:39 by simonmar]simonmar2005-01-111-6/+14
| | | | Make GHC accept OPTIONS_GHC. OPTIONS is also accepted, for now.
* [project @ 2005-01-11 15:22:04 by simonmar]simonmar2005-01-111-1/+3
| | | | | fix for parsing OPTIONS pragmas: OPTIONS should be followed by a non-identifier character.
* [project @ 2004-12-30 22:14:59 by simonpj]simonpj2004-12-301-1/+0
| | | | | | | | Fix to the pre-Xmas simplifier changes, which should make everything work again. I'd forgotten to attend to this corner. Still not properly tested I fear. Also remove dead code from SimplEnv, and simplify the remainder (hooray).
* [project @ 2004-12-22 16:58:34 by simonpj]simonpj2004-12-223-2/+3
| | | | | | | | | | | | | | | | | ---------------------------------------- Add more scoped type variables ---------------------------------------- Now the top-level forall'd variables of a type signature scope over the right hand side of that function. f :: a -> a f x = .... The type variable 'a' is in scope in the RHS, and in f's patterns. It's implied by -fglasgow-exts, but can also be switched off independently using -fscoped-type-variables (and the -fno variant)
* [project @ 2004-12-22 12:06:13 by simonpj]simonpj2004-12-221-7/+6
| | | | | | | | | | | | | | | | | | | ---------------------------------------- New Core invariant: keep case alternatives in sorted order ---------------------------------------- We now keep the alternatives of a Case in the Core language in sorted order. Sorted, that is, by constructor tag for DataAlt by literal for LitAlt The main reason is that it makes matching and equality testing more robust. But in fact some lines of code vanished from SimplUtils.mkAlts. WARNING: no change to interface file formats, but you'll need to recompile your libraries so that they generate interface files that respect the invariant.
* [project @ 2004-12-22 12:04:14 by simonpj]simonpj2004-12-222-1/+4
| | | | | | | | | | | | | -------------------------- Add -fwarn-orphans flag -------------------------- This gives a decent report for modules that contain 'orphan' instance and rule declarations. These are to be avoided, because GHC has to proactively read the interface file every single time, just in case the instance/rule is needed. The flag just gives a convenient way of identifying the culprits.
* [project @ 2004-12-02 17:18:15 by simonpj]simonpj2004-12-022-7/+6
| | | | | | | | | | | | Sorry for the fact that there are overlapping three commits in here... 1. Make -fno-monomorphism-restriction and -fno-implicit-prelude reversible, like other flags 2. Fix a wibble in the new ImportAvails story, in RnNames.mkExportAvails 3. Fix a Template Haskell bug that meant that top-level names created with newName were not made properly unique.
* [project @ 2004-12-02 17:17:28 by simonpj]simonpj2004-12-021-14/+2
| | | | Trim imports
* [project @ 2004-12-02 16:55:02 by simonpj]simonpj2004-12-021-2/+4
| | | | Missing include
* [project @ 2004-12-02 16:33:16 by simonpj]simonpj2004-12-021-0/+5
| | | | Missing import on Windows
* [project @ 2004-11-30 16:07:01 by simonmar]simonmar2004-11-301-1/+1
| | | | Data.Version --> Distribution.Version
* [project @ 2004-11-30 16:05:15 by simonmar]simonmar2004-11-301-1/+1
| | | | Data.Version -> Distribution.Version
* [project @ 2004-11-30 15:31:56 by simonmar]simonmar2004-11-301-1/+3
| | | | | Allow -ignore-package P when P doesn't exist (thanks to George Russell for the report).
* [project @ 2004-11-30 10:46:58 by simonmar]simonmar2004-11-301-1/+1
| | | | Add space to error message
* [project @ 2004-11-29 23:21:43 by wolfgang]wolfgang2004-11-291-4/+7
| | | | | Fix -dynamic compilation - don't use nameModule on names that might be local.
* [project @ 2004-11-29 11:32:38 by simonmar]simonmar2004-11-291-8/+9
| | | | | Look for package modules before home modules. This fixes the build in ghc/lib when bootstrapping with the HEAD.
* [project @ 2004-11-26 16:32:44 by simonmar]simonmar2004-11-261-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Further integration with the new package story. GHC now supports pretty much everything in the package proposal. - GHC now works in terms of PackageIds (<pkg>-<version>) rather than just package names. You can still specify package names without versions on the command line, as long as the name is unambiguous. - GHC understands hidden/exposed modules in a package, and will refuse to import a hidden module. Also, the hidden/eposed status of packages is taken into account. - I had to remove the old package syntax from ghc-pkg, backwards compatibility isn't really practical. - All the package.conf.in files have been rewritten in the new syntax, and contain a complete list of modules in the package. I've set all the versions to 1.0 for now - please check your package(s) and fix the version number & other info appropriately. - New options: -hide-package P sets the expose flag on package P to False -ignore-package P unregisters P for this compilation For comparison, -package P sets the expose flag on package P to True, and also causes P to be linked in eagerly. -package-name is no longer officially supported. Unofficially, it's a synonym for -ignore-package, which has more or less the same effect as -package-name used to. Note that a package may be hidden and yet still be linked into the program, by virtue of being a dependency of some other package. To completely remove a package from the compiler's internal database, use -ignore-package. The compiler will complain if any two packages in the transitive closure of exposed packages contain the same module. You *must* use -ignore-package P when compiling modules for package P, if package P (or an older version of P) is already registered. The compiler will helpfully complain if you don't. The fptools build system does this. - Note: the Cabal library won't work yet. It still thinks GHC uses the old package config syntax. Internal changes/cleanups: - The ModuleName type has gone away. Modules are now just (a newtype of) FastStrings, and don't contain any package information. All the package-related knowledge is in DynFlags, which is passed down to where it is needed. - DynFlags manipulation has been cleaned up somewhat: there are no global variables holding DynFlags any more, instead the DynFlags are passed around properly. - There are a few less global variables in GHC. Lots more are scheduled for removal. - -i is now a dynamic flag, as are all the package-related flags (but using them in {-# OPTIONS #-} is Officially Not Recommended). - make -j now appears to work under fptools/libraries/. Probably wouldn't take much to get it working for a whole build.
* [project @ 2004-11-26 16:30:12 by simonmar]simonmar2004-11-262-0/+5
| | | | Add missing .hi-boot files
* [project @ 2004-11-26 16:19:45 by simonmar]simonmar2004-11-2614-870/+1167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Further integration with the new package story. GHC now supports pretty much everything in the package proposal. - GHC now works in terms of PackageIds (<pkg>-<version>) rather than just package names. You can still specify package names without versions on the command line, as long as the name is unambiguous. - GHC understands hidden/exposed modules in a package, and will refuse to import a hidden module. Also, the hidden/eposed status of packages is taken into account. - I had to remove the old package syntax from ghc-pkg, backwards compatibility isn't really practical. - All the package.conf.in files have been rewritten in the new syntax, and contain a complete list of modules in the package. I've set all the versions to 1.0 for now - please check your package(s) and fix the version number & other info appropriately. - New options: -hide-package P sets the expose flag on package P to False -ignore-package P unregisters P for this compilation For comparison, -package P sets the expose flag on package P to True, and also causes P to be linked in eagerly. -package-name is no longer officially supported. Unofficially, it's a synonym for -ignore-package, which has more or less the same effect as -package-name used to. Note that a package may be hidden and yet still be linked into the program, by virtue of being a dependency of some other package. To completely remove a package from the compiler's internal database, use -ignore-package. The compiler will complain if any two packages in the transitive closure of exposed packages contain the same module. You *must* use -ignore-package P when compiling modules for package P, if package P (or an older version of P) is already registered. The compiler will helpfully complain if you don't. The fptools build system does this. - Note: the Cabal library won't work yet. It still thinks GHC uses the old package config syntax. Internal changes/cleanups: - The ModuleName type has gone away. Modules are now just (a newtype of) FastStrings, and don't contain any package information. All the package-related knowledge is in DynFlags, which is passed down to where it is needed. - DynFlags manipulation has been cleaned up somewhat: there are no global variables holding DynFlags any more, instead the DynFlags are passed around properly. - There are a few less global variables in GHC. Lots more are scheduled for removal. - -i is now a dynamic flag, as are all the package-related flags (but using them in {-# OPTIONS #-} is Officially Not Recommended). - make -j now appears to work under fptools/libraries/. Probably wouldn't take much to get it working for a whole build.
* [project @ 2004-11-25 11:36:34 by simonpj]simonpj2004-11-251-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------ Keep-alive set and Template Haskell quotes ------------------------------------------ a) Template Haskell quotes should be able to mention top-leve things without resorting to lifting. Example module Foo( foo ) where f x = x foo = [| f 4 |] Here the reference to 'f' is ok; no need to 'lift' it. The relevant changes are in TcExpr.tcId b) However, we must take care not to discard the binding for f, so we add it to the 'keep-alive' set for the module. I've now made this into (another) mutable bucket, tcg_keep, in the TcGblEnv c) That in turn led me to look at the handling of orphan rules; as a result I made IdCoreRule into its own data type, which has simle but non-local ramifications
* [project @ 2004-11-12 15:06:36 by simonmar]simonmar2004-11-121-1/+1
| | | | darwin-only fix
* [project @ 2004-11-12 13:35:55 by simonpj]simonpj2004-11-121-1/+1
| | | | Update to new InstalledPackageInfo
* [project @ 2004-11-11 16:07:40 by simonmar]simonmar2004-11-116-76/+119
| | | | Compiler changes for the new package.conf format.
* [project @ 2004-11-11 09:46:54 by simonmar]simonmar2004-11-111-14/+2
| | | | Get rawSystem from Compat.RawSystem in libghccompat.
* [project @ 2004-11-10 01:56:00 by wolfgang]wolfgang2004-11-101-0/+6
| | | | | | Fix pretty-printing of integer constants on 64-bit platforms. If sizeof(int) == 4 on a 64-bit platform, we have to add an 'L' suffix to integer constants.
* [project @ 2004-11-09 16:59:31 by simonmar]simonmar2004-11-091-13/+15
| | | | | getOptionsFromSource: fix a bug which caused a file containing just an OPTIONS pragma to have the pragma ignored.
* [project @ 2004-10-25 09:23:08 by simonmar]simonmar2004-10-251-38/+50
| | | | Minor changes for VS/Haskell
* [project @ 2004-10-20 14:25:34 by simonmar]simonmar2004-10-201-0/+9
| | | | | | | compile: temporarily add the directory containing the .hs file to the include path. This matches what compiling in one-shot mode does, and fixes a bug whereby the _stub.h file couldn't be found when compiling with --make.
* [project @ 2004-10-18 18:27:36 by igloo]igloo2004-10-181-2/+2
| | | | | | Remove -static flags for alpha and hppa. Turns out mips(el) on Linux is more complicated than first appeared, so leaving it be for now.
* [project @ 2004-10-18 18:24:59 by igloo]igloo2004-10-182-0/+2
| | | | Implement -fwarn-incomplete-record-updates
* [project @ 2004-10-15 15:28:48 by simonmar]simonmar2004-10-151-11/+6
| | | | Add a SrcSpan to the DataCon in a ConPatOut.
* [project @ 2004-10-08 12:16:04 by simonmar]simonmar2004-10-081-1/+2
| | | | FreeBSD needs -optl-pthread for the threaded way
* [project @ 2004-10-07 15:54:03 by wolfgang]wolfgang2004-10-072-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Position Independent Code and Dynamic Linking Support, Part 1 This commit allows generation of position independent code (PIC) that fully supports dynamic linking on Mac OS X and PowerPC Linux. Other platforms are not yet supported, and there is no support for actually linking or using dynamic libraries - so if you use the -fPIC or -dynamic code generation flags, you have to type your (platform-specific) linker command lines yourself. nativeGen/PositionIndependentCode.hs: New file. Look here for some more comments on how this works. cmm/CLabel.hs: Add support for DynamicLinkerLabels and PIC base labels - for use inside the NCG. needsCDecl: Case alternative labels now need C decls, see the codeGen/CgInfoTbls.hs below for details cmm/Cmm.hs: Add CmmPicBaseReg (used in NCG), and CmmLabelDiffOff (used in NCG and for offsets in info tables) cmm/CmmParse.y: support offsets in info tables cmm/PprC.hs: support CmmLabelDiffOff Case alternative labels now need C decls (see the codeGen/CgInfoTbls.hs for details), so we need to pprDataExterns for info tables. cmm/PprCmm.hs: support CmmLabelDiffOff codeGen/CgInfoTbls.hs: no longer store absolute addresses in info tables, instead, we store offsets. Also, for vectored return points, emit the alternatives _after_ the vector table. This is to work around a limitation in Apple's as, which refuses to handle label differences where one label is at the end of a section. Emitting alternatives after vector info tables makes sure this never happens in GHC generated code. Case alternatives now require prototypes in hc code, though (see changes in PprC.hs, CLabel.hs). main/CmdLineOpts.lhs: Add a new option, -fPIC. main/DriverFlags.hs: Pass the correct options for PIC to gcc, depending on the platform. Only for powerpc for now. nativeGen/AsmCodeGen.hs: Many changes... Mac OS X-specific management of import stubs is no longer, it's now part of a general mechanism to handle such things for all platforms that need it (Darwin [both ppc and x86], Linux on ppc, and some platforms we don't support). Move cmmToCmm into its own monad which can accumulate a list of imported symbols. Make it call cmmMakeDynamicReference at the right places. nativeGen/MachCodeGen.hs: nativeGen/MachInstrs.hs: nativeGen/MachRegs.lhs: nativeGen/PprMach.hs: nativeGen/RegAllocInfo.hs: Too many changes to enumerate here, PowerPC specific. nativeGen/NCGMonad.hs: NatM still tracks imported symbols, as more labels can be created during code generation (float literals, jump tables; on some platforms all data access has to go through the dynamic linking mechanism). driver/mangler/ghc-asm.lprl: Mangle absolute addresses in info tables to offsets. Correctly pass through GCC-generated PIC for Mac OS X and powerpc linux. includes/Cmm.h: includes/InfoTables.h: includes/Storage.h: includes/mkDerivedConstants.c: rts/GC.c: rts/GCCompact.c: rts/HeapStackCheck.cmm: rts/Printer.c: rts/RetainerProfile.c: rts/Sanity.c: Adapt to the fact that info tables now contain offsets. rts/Linker.c: Mac-specific: change machoInitSymbolsWithoutUnderscore to support PIC.