summaryrefslogtreecommitdiff
path: root/ghc/driver
Commit message (Collapse)AuthorAgeFilesLines
* Darwin/x86: Implement object splittingwolfgang.thaller@gmx.net2006-03-061-7/+9
|
* Darwin/x86 Mangler: Make sure each imported symbol stub gets a separate chunk.wolfgang.thaller@gmx.net2006-02-051-0/+7
|
* Darwin/x86: Handle IMPORT sections in manglerwolfgang.thaller@gmx.net2006-02-031-1/+2
|
* x86_64: include .type and .size directives in the output, for valgrindSimon Marlow2006-02-271-1/+1
|
* [project @ 2006-01-17 02:13:16 by wolfgang]wolfgang2006-01-171-10/+0
| | | | | | Linux/PPC64: remove some dead code that accidentally slipped in. MERGE TO STABLE
* [project @ 2006-01-09 14:25:44 by simonmar]simonmar2006-01-091-1/+1
|
* [project @ 2005-11-18 14:01:33 by simonmar]simonmar2005-11-181-14/+18
| | | | | | | | Discard various ways in which gcc zeroes stack slots in the prologue. So far in my investigations these have always been unnecessary, they appear to be the result of missed optimisations by gcc, so cross fingers and discard them. New variants have just shown up because I started compiling the RTS with -optc-O2.
* [project @ 2005-10-31 11:31:10 by simonmar]simonmar2005-10-311-1/+2
| | | | clean up more junk generated by gcc
* [project @ 2005-10-31 11:17:53 by simonmar]simonmar2005-10-311-0/+12
| | | | | | | | | | | x86_64: catch and fix one kind of crappy code generated by gcc # movq -4(%rbp), %rax # jmp *%rax ==> # jmp *-4(%rbp)
* [project @ 2005-09-16 14:02:22 by simonmar]simonmar2005-09-161-2/+2
| | | | | Update for Sparc/Solaris from Christian Meader. This might fix GHCi on Sparc.
* [project @ 2005-06-13 02:03:42 by wolfgang]wolfgang2005-06-131-3/+5
| | | | | Darwin/x86: Instead of aligning all literals at 16 bytes, reuse the hack from x86-64.
* [project @ 2005-06-13 00:15:58 by wolfgang]wolfgang2005-06-131-1/+11
| | | | | | | | | Darwin/x86: Fix two causes for crashes: *) align literals to 16 bytes, because Apple's GCC likes to use SSE instructions which require this alignment. *) In print_doctored, recognize global jumps that masquerade as local jumps by going via Lfoo$stub or Lfoo$non_lazy_ptr.
* [project @ 2005-06-09 05:55:40 by wolfgang]wolfgang2005-06-091-13/+72
| | | | | | | | Registerised support for Darwin/x86, both NCG and mangled. *) -fPIC doesn't work yet with -fvia-C. *) Apple officially requires the stack to be 16-byte-aligned, GHC ignores this for now.
* [project @ 2005-06-03 10:20:34 by simonmar]simonmar2005-06-031-1/+1
| | | | | Allow calls to __alloca in the prologue on mingw32 (previously only allowed for cygwin32, I guess it hasn't happened for a while).
* [project @ 2005-06-03 10:08:55 by simonmar]simonmar2005-06-031-0/+6
| | | | Check for reserved stack space blown.
* [project @ 2005-05-10 10:41:00 by simonmar]simonmar2005-05-101-2/+2
| | | | | | Mangler support for GNU/Hurd. From: Thomas Schwinge
* [project @ 2005-05-05 00:58:38 by sof]sof2005-05-053-5/+15
| | | | | | | | | | | | | | | [mingw only] Provide (unsatisfying) workaround for pesky Ctrl-C issue, whereby a cygwin-based bash will terminate the 'ghci.exe' wrapper without the wrapper process getting a chance to respond (and shut down its child, if nothing else.) The result instead being that the child (ghc.exe) ends up lingering in the background. To steer users away from such badness, the wrapper checks to see whether it is running in a *nix-like shell, and if it is, issue a warning that it would be better to invoke GHCi using the 'ghcii.sh' shell script instead. Merge to STABLE.
* [project @ 2005-04-30 15:45:58 by wolfgang]wolfgang2005-04-301-5/+6
| | | | | | More Mac OS X Tiger / GCC 4.0 fixes. MERGE TO STABLE
* [project @ 2005-04-29 22:15:36 by wolfgang]wolfgang2005-04-291-13/+15
| | | | | | Mac OS X (Tiger): Fix the Mangler for (Apple's version of) GCC 4.0 MERGE TO STABLE
* [project @ 2005-04-22 21:54:08 by simonmar]simonmar2005-04-221-0/+39
| | | | splitting support on x86_64
* [project @ 2005-04-22 17:15:51 by sof]sof2005-04-221-72/+80
| | | | | | | | | | | | | | Switch away from using _spawnv() to CreateProcess(); the former has the annoying 'feature' that it quits upon Ctrl-C, leaving its child in the background. Use CreateProcess() instead and avoid the Ctrl-C issue by having the wrapper let go of its console before waiting for the sub-process running GHCi to exit. This still doesn't fix the issue of Ctrl-C handling when the 'ghci' wrapper is invoked from a cygwin-based bash. cmd.exe users will hopefully see an improvement in behaviour though. Merge to STABLE.
* [project @ 2005-04-15 05:29:48 by wolfgang]wolfgang2005-04-151-0/+12
| | | | | | Initialise foreign exports from GNU C __attribute__((constructor)) functions in the stub C file, rather than from __stginit_ functions. For non-profiling ways, leave out __stginit_ alltogether.
* [project @ 2005-03-08 13:32:06 by simonmar]simonmar2005-03-081-1/+19
| | | | | | | | | | | HACK HACK HACK on x86_64 we need 16-byte aligned constants on this platform sometimes. Don't just 16-byte align everything, but try to detect 16-byte constants and align just those. All the codegen tests now go through on registerised x86_64, I'm building a stage2 GHC now.
* [project @ 2005-03-08 11:04:11 by simonmar]simonmar2005-03-081-0/+8
| | | | | | x86_64: the assembler doesn't like generating 8-byte relative relocations between text and rodata symbols. Hack around this by putting SRTs in the text segment for now.
* [project @ 2005-03-03 10:37:57 by simonmar]simonmar2005-03-031-1/+1
| | | | | Sparc: allow whitespace before .section directive. Should fix linking problems on sparc/solaris.
* [project @ 2005-03-02 09:49:11 by simonmar]simonmar2005-03-021-2/+2
| | | | Clean a bit better
* [project @ 2005-02-18 09:32:50 by simonmar]simonmar2005-02-181-5/+5
| | | | Mac OS X: fixes to the splitter (rev. 1.24.6.1 on the branch)
* [project @ 2005-02-10 07:01:45 by wolfgang]wolfgang2005-02-101-1/+1
| | | | Fix previous commit. Got distracted, thought I had already tested.
* [project @ 2005-02-10 05:46:46 by wolfgang]wolfgang2005-02-101-7/+8
| | | | | | Fix Mac OS X-specific breakage introduced by rev. 1.67 of ghc/includes/Stg.h. Adding the used attribute to static functions caused gcc to emit Apple-specific .no_dead_strip directives, which messed things up.
* [project @ 2005-02-10 03:08:26 by wolfgang]wolfgang2005-02-101-1/+1
| | | | PowerPC: mangler trouble again
* [project @ 2005-02-09 15:25:12 by simonmar]simonmar2005-02-091-2/+17
| | | | | Keep .type/.size directives for _entry symbols, but rename them to _info. This helps cachegrind to find where my instructions are going.
* [project @ 2005-02-01 15:55:00 by simonmar]simonmar2005-02-011-3/+11
| | | | Generate some sensible code when presented with the output from gcc -O2
* [project @ 2005-01-23 20:34:17 by wolfgang]wolfgang2005-01-231-6/+16
| | | | | | | Distinguish between rodata and relrodata (relocatable read-only data) in the mangler. By default, use $T_HDR_rodata if $T_HDR_relrodata is not defined for a particular platform.
* [project @ 2005-01-23 06:10:15 by wolfgang]wolfgang2005-01-231-1/+6
| | | | | | | | | | | | | | | | | | | | | | | Add support for the dead code stripping feature of recent Apple linkers. If your code is compiled using the NCG, you can now specify -optl-W,-dead_strip on the GHC command line when linking. It will have basically the same effect as using split-objs to build the libraries. Advantages over split-objs: * No evil perl script involved * Requires no special handling when building libraries Disadvantages: * The current version of Apple's linker is slow when given the -dead_strip flag. _REALLY_ slow. * Mac OS X only. This works by making the NCG emit the .subsections_via_symbols directive. Additionally, we have to add an extra label at the top of every info table, and make sure that the entry code references it (otherwise the info table will be considered part of the preceding entry code). The mangler just removes the .subsections_via_symbols directive.
* [project @ 2005-01-17 16:46:58 by simonmar]simonmar2005-01-171-1/+1
| | | | | | sparc-.*linux: slight modification to rev. 1.107, the whitespace before .section should be \s+, not \t. Fixes problems with even more recent gcc versions on sparc64.
* [project @ 2005-01-12 05:53:07 by wolfgang]wolfgang2005-01-121-8/+14
| | | | | | Move _srtd and _closure_tbl to read-only data instead of text (these things contain pointers to other symbols, so they can't go into .text for position-independent code).
* [project @ 2005-01-09 00:29:05 by desrt]desrt2005-01-091-1/+67
| | | | | | | | | | | Modified the mangler for powerpc64. This is the last missing piece for supporting registerised builds on PPC64. The current state of the mangler is temporary. We're discussing a better way to take advantage of the PPC64 ABI's unique features to provide a better way of storing info tables. I don't think I've changed anything that affects other platforms.
* [project @ 2004-10-18 12:40:37 by desrt]desrt2004-10-181-5/+39
| | | | the splitter now supports linux/powerpc
* [project @ 2004-10-07 15:54:03 by wolfgang]wolfgang2004-10-071-7/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [project @ 2004-09-24 16:29:33 by wolfgang]wolfgang2004-09-241-2/+2
| | | | | | | | | PowerPC/Mac OS X: Improve epilogue mangling. This became necesssary because the new CG may "fall through" for cases in a switch that are known to never happen, so GCC generates the epilogue code again. With the previous CG, GCC never generated any epilog code, because every function ended with an unconditional tail jump.
* [project @ 2004-09-16 08:13:02 by stolz]stolz2004-09-161-9/+16
| | | | | | | | | | Collect unknown chunks in new chkcat 'unknown' which gets treated like 'misc', but isn't mangled on sparc-*-solaris2 because of function definitions in C-headers like <pwd.h>. This shouldn't affect any other platform since this was already a border-case. Closes SF Bug 1012521 "getUserEntryForID dies". Please merge.
* [project @ 2004-09-13 09:56:12 by simonmar]simonmar2004-09-131-0/+1
| | | | There was a missing $T_HDR_info setting for solaris2/openbsd.
* [project @ 2004-09-02 03:22:39 by dons]dons2004-09-021-1/+1
| | | | $T_PRE_APP char now appears to be a '#' on OpenBSD/x86.
* [project @ 2004-09-01 13:14:12 by simonmar]simonmar2004-09-011-6/+2
| | | | Better fix for previous from Ian Lynagh.
* [project @ 2004-09-01 10:01:48 by simonmar]simonmar2004-09-011-0/+5
| | | | | | | | | | Apply the fix from [ 1015205 ] ghc-split fails to quote path when used as regex namely escape backslashes in the pathname $Tmp_prefix before using it as a regex. The fix doesn't look like it solves the general case, but it'll do for now.
* [project @ 2004-08-20 11:20:16 by simonmar]simonmar2004-08-201-2/+2
| | | | | Give literal string labels a _str suffix, to make it less likely that they'll clash with a symbol in scope in a C file.
* [project @ 2004-08-13 13:04:50 by simonmar]simonmar2004-08-131-104/+39
| | | | Merge backend-hacking-branch onto HEAD. Yay!
* [project @ 2004-05-21 09:25:03 by geoffw]geoffw2004-05-211-2/+2
| | | | mingw/msys fix: keep .lcomm directives
* [project @ 2004-04-18 09:36:51 by dons]dons2004-04-181-1/+1
| | | | Add OpenBSD/amd64 to the known x86_64's
* [project @ 2004-04-16 02:02:44 by igloo]igloo2004-04-161-1/+1
| | | | | | Change the mangler to allow a tab before .section on sparc. Fixes a problem which shows up as symbols not being made global so not being defined when compiling with gcc >= 3.something.