summaryrefslogtreecommitdiff
path: root/compiler/utils/Platform.hs
Commit message (Collapse)AuthorAgeFilesLines
* Move 'Platform' to ghc-bootJohn Ericson2019-06-191-190/+0
| | | | | | | ghc-pkg needs to be aware of platforms so it can figure out which subdire within the user package db to use. This is admittedly roundabout, but maybe Cabal could use the same notion of a platform as GHC to good affect too.
* Break up `Settings` into smaller structsJohn Ericson2019-05-291-0/+28
| | | | | | | | | | | | | | | | | As far as I can tell, the fields within `Settings` aren't *intrinsicly* related. They just happen to be initialized the same way (in particular prior to the rest of `DynFlags`), and that is why they are grouped together. Within `Settings`, however, there are groups of settings that clearly do share something in common, regardless of how they anything is initialized. In the spirit of GHC being a library, where the end cosumer may choose to initialize this configuration in arbitrary ways, I made some new data types for thoses groups internal to `Settings`, and used them to define `Settings` instead. Hopefully this is a baby step towards a general decoupling of the stateful and stateless parts of GHC.
* aclocal.m4: add OSHurd (debian patch)Sergei Trofimovich2018-03-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | ghc treats OSUnknown (and GNU/Hurd) as non-ELF target. This causes panic in native codegenerator when trying to build PIC code: ``` ... -- all other platforms howToAccessLabel dflags _ _ _ _ _ | not (positionIndependent dflags) = AccessDirectly | otherwise = panic "howToAccessLabel: PIC not defined for this platform" ``` This change declares new 'OSHurd' and marks it as an ELF target. Fixes building ghc-stage2 on i686-unknown-gnu0.9. Patch provided by "Pino" via Samuel Thibault and taken from debian. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* compiler: introduce custom "GhcPrelude" PreludeHerbert Valerio Riedel2017-09-191-0/+2
| | | | | | | | | | | | | | | | | | This switches the compiler/ component to get compiled with -XNoImplicitPrelude and a `import GhcPrelude` is inserted in all modules. This is motivated by the upcoming "Prelude" re-export of `Semigroup((<>))` which would cause lots of name clashes in every modulewhich imports also `Outputable` Reviewers: austin, goldfire, bgamari, alanz, simonmar Reviewed By: bgamari Subscribers: goldfire, rwbarton, thomie, mpickering, bgamari Differential Revision: https://phabricator.haskell.org/D3989
* Drop special handling of iOS and AndroidMoritz Angermann2017-09-071-7/+0
| | | | | | | | | | | | | | | As far as GHC is concerned, iOS **is** Darwin, and Android **is** Linux. Depends on D3352 Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: Ericson2314, ryantrinkle, rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D3579
* Drop special handling of iOSMoritz Angermann2017-04-121-8/+1
| | | | | | | | | | | | | | | | | | | | iOS at least since iOS8 (we are currently at iOS10.3), allows for dynamic libaries, hence any artificail restriction on dyanmic libraries should be lifted. Please ping me with any iOS related issues that should potentially resurface. The iOS toolchain has considerably changed over the years, and I'm willing to drop work arounds in good faith. Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13559, #7722 Differential Revision: https://phabricator.haskell.org/D3451
* Enable subsections via symbols on iOSDemi Obenour2017-01-101-0/+6
| | | | | | | | | | | | | | Test Plan: GHC CI Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2915 GHC Trac Issues: #11040, #13049
* Scrap DEC OSF/1 supportHerbert Valerio Riedel2016-03-281-3/+0
| | | | | | | | | | | | | DEC OSF/1 (aka Tru64 UNIX) has been discontinued a few years ago already[1]. This removes the undoubtedly bitrotten support for `OSOsf3 :: OS` from GHC's code-base. Support for `ArchAlpha :: Arch` may be removed at some later point, as there may still be users out there running a more or less recent Linux/alpha distribution on their more-than-a-decade old Alpha hardware... [1]: https://en.wikipedia.org/wiki/Tru64_UNIX
* Add sparc64 a known architecture (Ticket #11211)John Paul Adrian Glaubitz2015-12-191-0/+1
| | | | | | | | | | | | Explicitly pass "--no-relax" on ArchSPARC64 (as ArchSPARC does) where gcc's default specs set "-mrelax" which conflicts with "-Wl,-r". Known architecture will also help extending sparc NCG support 64-bit ABI. Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Make GHC aware of OSAIX and AixLDHerbert Valerio Riedel2015-11-191-0/+2
| | | | | | | | | | | | | | GHC needs to be aware of targetting AIX because AIX requires some special handling for the toolchain (similiar to Solaris) Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1501
* Implement PowerPC 64-bit native code backend for LinuxPeter Trommler2015-07-031-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Limitations: * 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
* LlvmCodeGen cross-compiling fixes (#9895)Erik de Castro Lopo2014-12-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: * Throw an error when cross-compiling without a target definition. When cross compiling via LLVM, a target 'datalayout' and 'triple' must be defined or LLVM will generate code for the compile host instead of the compile target. * Add aarch64-unknown-linux-gnu target. The datalayout and triple lines were found by using clang to compile a small C program and -emit-llvm to get the LLVM IR output. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com> Test Plan: validate Reviewers: rwbarton, carter, hvr, bgamari, austin Reviewed By: austin Subscribers: carter, thomie, garious Differential Revision: https://phabricator.haskell.org/D585 GHC Trac Issues: #9895
* arm64: 64bit iOS and SMP support (#7942)Luke Iannini2014-11-191-0/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* ghc: initial AArch64 patchesColin Watson2014-04-211-0/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix inplace dynamic linking on OS X (#8266)Christiaan Baaj2014-01-281-0/+6
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add basic support for GHCJSAustin Seipp2013-09-061-0/+1
| | | | | | | | | | | | | | | | | | | This patch encompasses most of the basic infrastructure for GHCJS. It includes: * A new extension, -XJavaScriptFFI * A new architecture, ArchJavaScript * Parser and lexer support for 'foreign import javascript', only available under -XJavaScriptFFI, using ArchJavaScript. * As a knock-on, there is also a new 'WayCustom' constructor in DynFlags, so clients of the GHC API can add custom 'tags' to their built files. This should be useful for other users as well. The remaining changes are really just the resulting fallout, making sure all the cases are handled appropriately for DynFlags and Platform. Authored-by: Luite Stegeman <stegeman@gmail.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Don't use getPackageLinkOpts on iOS; fixes #7720.Ian Lynagh2013-04-271-0/+8
| | | | | On iOS, binaries are really static libraries, so we don't want to use flags like -lm when linking them.
* Fix stage2 build on ARM.Austin Seipp2013-03-181-0/+4
| | | | | | LLVM supports PIC on ARM from what I can see. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Add OSiOS, and define and use platformUsesFrameworks; part of #7720Ian Lynagh2013-03-021-1/+12
|
* Added support to cross-compile to androidNathan2013-01-241-0/+2
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Add support for nto-qnx (BlackBerry 10)Simon Marlow2013-01-231-0/+2
| | | | Submitted by: Stephen Paul Weber <singpolyma@singpolyma.net>
* Tell the compiler about alpha, mipseb and mipsel again; fixes #7339Ian Lynagh2012-11-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts the compiler parts of commit 7b594a5d7ac29972db39228e9c8b7f384313f39b Author: David Terei <davidterei@gmail.com> Date: Mon Nov 21 12:05:18 2011 -0800 Remove registerised code for dead architectures: mips, ia64, alpha, hppa1, m68k In particular, we want to know whether bewareLoadStoreAlignment should return True or False for them. It also reverts commit 3fc68b5c356b39b2b52a86d953367d0021c13262 Author: Simon Marlow <marlowsd@gmail.com> Date: Wed Jan 4 11:44:02 2012 +0000 Remove missing archs (mipseb, mipsel, alpha) (#5734) It doesn't hurt to map these to ArchUnknown since we don't need to know anything specific about them, and adding them would be a pain (there are a bunch of places where we have to case-match on all the arches to avoid warnings).
* Remove some more CPPIan Lynagh2012-09-101-0/+4
|
* Add "Unregisterised" as a field in the settings fileIan Lynagh2012-08-071-0/+1
| | | | | | To explicitly choose whether you want an unregisterised build you now need to use the "--enable-unregisterised"/"--disable-unregisterised" configure flags.
* Add a comment about the units of platformWordSizeIan Lynagh2012-07-241-0/+2
|
* add support for ARM hard-float ABI (fixes #5914)Karel Gardas2012-04-271-2/+10
| | | | | | | This patch enhances Platform's ArchARM to include ARM ABI value. It also tweaks configure machinery to detect hard-float ABI and to set it wherever needed. Finally when hard-float ABI is in use, pass appropriate compiler option to the LLVM's llc. Fixes #5914.
* Add Haiku platform (#5828)Paolo Capriotti2012-03-071-0/+2
|
* Add dragonfly support; based on a patch from Goetz IsenmannIan Lynagh2012-02-111-9/+11
|
* KFreeBSD is also an ELF binaryJoachim Breitner2012-01-041-0/+2
| | | | Fixes: #5733
* osElfTarget should default to False (#5733)Simon Marlow2012-01-041-4/+5
| | | | | | | | | | | | Another portabilty regression: before Platform we used to use elf_OBJ_FORMAT: #if linux_TARGET_OS || freebsd_TARGET_OS || openbsd_TARGET_OS || solaris2_TARGET_OS #define elf_OBJ_FORMAT 1 #endif which defaults to undefined on unknown platforms. Defaulting to non-ELF is correct, it just means that we won't rely on ELF-specific functionality. I've added a comment to explain that.
* Store the word size as determined by configure, in the settings file (#5735)Simon Marlow2012-01-041-9/+2
| | | | | Now target32bit works for all targets without any manual intervention, as it should do. #5735 was a portability regression.
* Detect cases where as(1) doesn't recognise .ident directive (#5408)PHO2011-12-081-0/+1
| | | | .ident directives are usually ignored by as(1), and in some cases (like Darwin/PPC) they even raise an error.
* Fixes for NetBSDIan Lynagh2011-11-251-0/+2
| | | | | Based on a patch from Arnaud Degroote <degroote@NetBSD.org> in trac #5480.
* Remove registerised code for dead architectures: mips, ia64, alpha,David Terei2011-11-221-6/+0
| | | | hppa1, m68k
* A little more CPP removalIan Lynagh2011-10-191-0/+6
|
* Convert the HAVE_GNU_NONEXEC_STACK conditional into HaskellIan Lynagh2011-10-191-0/+1
|
* Add "have subsections via symbols" to the Platform typeIan Lynagh2011-10-191-3/+5
|
* Put the target platform in the settings fileIan Lynagh2011-10-191-77/+5
|
* Revert "Remove OSUnknown"Ian Lynagh2011-10-191-3/+6
| | | | | | | This reverts commit f75f26cc4eed3c3cfc256ebfb9e77b8e82a766fc. On second thoughts, this does make sense, for unregisterised via-C OSes at least.
* Revert "Remove ArchUnknown"Ian Lynagh2011-10-191-2/+4
| | | | | | | This reverts commit 2dea11a442e1d14d86fa661804de06a721943bf0. On second thoughts, this does make sense, for unregisterised via-C arches at least.
* Remove ArchUnknownIan Lynagh2011-10-181-4/+2
| | | | | | | It doesn't make sense. If platformArch is ArchUnknown then we don't know the answer to any questions about the arch. So now if we don't recognise the arch we just fail, and the new arch will need to be added to the datatype.
* Remove OSUnknownIan Lynagh2011-10-181-6/+3
| | | | | | It doesn't make sense. If platformOS is OSUnknown then we don't know the answer to any questions about the OS. So now if we don't recognise the OS we just fail, and the new OS will need to be added to the datatype.
* More CPP removal: pprDynamicLinkerAsmLabel in CLabelIan Lynagh2011-10-021-0/+1
| | | | And some knock-on changes
* enhance ArchARM with ISA and ISA extensionsKarel Gardas2011-08-211-2/+41
| | | | | | | This patch enhances ArchARM with ARM ISA and ISA extensions details as is suggested in the comment in Platform.hs file. The patch is needed by future patch which will use ARM ISA information in order to pass appropriate command-line option to the LLVM llc tool.
* Add a case for kfreebsdgnu in Platforms.hsIan Lynagh2011-08-071-0/+2
|
* Fix to use %note instead of @note as an ELF section note on ARM architectureKarel Gardas2011-06-271-0/+4
| | | | | | | | It looks like where x86 assembly is using '@' character, ARM assembly requires '%' character. This makes a problem in the patch 814edf44433801e37318ce79082ac6991dbc87dd 'Force re-linking if the options have changed (#4451)' which makes linking assembly file uncompilable on ARM. This patch fixes this.
* Fill out the osElfTarget definitionIan Lynagh2011-06-081-4/+7
| | | | | For now we panic in the OSUnknown case. It would probably be better to make the enumerations complete instead, though.
* Add a target32Bit function to PlatformIan Lynagh2011-06-081-0/+13
|
* Remove out-of-date commentIan Lynagh2011-06-081-1/+0
|
* Whitespace only in utils/Platform.hsIan Lynagh2011-06-081-46/+46
|