diff --git a/builder/comp-builder.nix b/builder/comp-builder.nix index dce42bb9ec..18959a8bcc 100644 --- a/builder/comp-builder.nix +++ b/builder/comp-builder.nix @@ -1,7 +1,7 @@ { stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, ghcForComponent, hsPkgs, runCommand, libffi, gmp, zlib, ncurses, nodejs }: lib.makeOverridable ( -let self = +let self = { componentId , component , package @@ -34,7 +34,10 @@ let self = , dontStrip ? component.dontStrip , enableStatic ? component.enableStatic -, enableShared ? component.enableShared && !haskellLib.isCrossHost +, enableShared ? ghc.enableShared && component.enableShared && !haskellLib.isCrossHost + # on x86 we'll use shared libraries, even with musl m( + # ghc's internal linker seems to be broken on x86. + && !(stdenv.hostPlatform.isMusl && !stdenv.hostPlatform.isx86) , enableDeadCodeElimination ? component.enableDeadCodeElimination # Options for Haddock generation @@ -52,8 +55,15 @@ let self = # Data , enableSeparateDataOutput ? component.enableSeparateDataOutput +# Prelinked ghci libraries; will make iserv faster; especially for static builds. +, enableLibraryForGhci ? true + # Debug , enableDebugRTS ? false +, enableDWARF ? false + +# LLVM +, useLLVM ? ghc.useLLVM }@drvArgs: let @@ -112,6 +122,7 @@ let (enableFeature enableExecutableProfiling "executable-profiling") (enableFeature enableStatic "static") (enableFeature enableShared "shared") + (enableFeature enableLibraryForGhci "library-for-ghci") ] ++ lib.optionals (stdenv.hostPlatform.isMusl && (haskellLib.isExecutableType componentId)) [ # These flags will make sure the resulting executable is statically linked. # If it uses other libraries it may be necessary for to add more @@ -120,9 +131,6 @@ let "--disable-executable-dynamic" "--ghc-option=-optl=-pthread" "--ghc-option=-optl=-static" - "--ghc-option=-optl=-L${gmp.override { withStatic = true; }}/lib" - "--ghc-option=-optl=-L${zlib.static}/lib" - "--ghc-option=-optl=-L${ncurses.override { enableStatic = true; }}/lib" ] ++ lib.optional enableSeparateDataOutput "--datadir=$data/share/${ghc.name}" ++ lib.optional doHaddock' "--docdir=${docdir "$doc"}" ++ lib.optional (enableLibraryProfiling || enableExecutableProfiling) "--profiling-detail=${profilingDetail}" @@ -133,6 +141,10 @@ let ++ configureFlags ++ (ghc.extraConfigureFlags or []) ++ lib.optional enableDebugRTS "--ghc-option=-debug" + ++ lib.optional enableDWARF "--ghc-option=-g" + ++ lib.optionals useLLVM [ + "--ghc-option=-fPIC" "--gcc-option=-fPIC" + ] ); setupGhcOptions = lib.optional (package.ghcOptions != null) '' --ghc-options="${package.ghcOptions}"''; diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index de752bdc51..c541e174a4 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -105,6 +105,11 @@ let '' + stdenv.lib.optionalString (!enableTerminfo) '' WITH_TERMINFO=NO '' + # musl doesn't have a system-linker. Only on x86, and on x86 we need it, as + # our elf linker for x86_64 is broken. + + stdenv.lib.optionalString (targetPlatform.isMusl && !targetPlatform.isx86) '' + compiler_CONFIGURE_OPTS += --flags=-dynamic-system-linker + '' # While split sections are now enabled by default in ghc 8.8 for windows, # the seem to lead to `too many sections` errors when building base for # profiling. @@ -332,6 +337,7 @@ in let configured-src = stdenv.mkDerivation (rec { inherit llvmPackages; inherit enableShared; + inherit useLLVM; # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; diff --git a/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global new file mode 100644 index 0000000000..3e0ad5609e --- /dev/null +++ b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global @@ -0,0 +1,1221 @@ +name: Cabal +version: 2.4.0.1 +id: Cabal-2.4.0.1 +key: Cabal-2.4.0.1 +license: BSD-3-Clause +copyright: 2003-2018, Cabal Development Team (see AUTHORS file) +maintainer: cabal-devel@haskell.org +author: Cabal Development Team +homepage: http://www.haskell.org/cabal/ +synopsis: A framework for packaging Haskell software +description: + The Haskell Common Architecture for Building Applications and + Libraries: a framework defining a common interface for authors to more + easily build their Haskell applications in a portable way. + . + The Haskell Cabal is part of a larger infrastructure for distributing, + organizing, and cataloging Haskell libraries and tools. +category: Distribution +exposed: True +exposed-modules: + Distribution.Backpack Distribution.Backpack.ComponentsGraph + Distribution.Backpack.Configure + Distribution.Backpack.ConfiguredComponent + Distribution.Backpack.DescribeUnitId + Distribution.Backpack.FullUnitId + Distribution.Backpack.LinkedComponent + Distribution.Backpack.ModSubst Distribution.Backpack.ModuleShape + Distribution.Backpack.PreModuleShape Distribution.CabalSpecVersion + Distribution.Compat.Binary Distribution.Compat.CharParsing + Distribution.Compat.CreatePipe Distribution.Compat.DList + Distribution.Compat.Directory Distribution.Compat.Environment + Distribution.Compat.Exception Distribution.Compat.Graph + Distribution.Compat.Internal.TempFile Distribution.Compat.Lens + Distribution.Compat.Newtype Distribution.Compat.Parsing + Distribution.Compat.Prelude.Internal Distribution.Compat.ReadP + Distribution.Compat.Semigroup Distribution.Compat.Stack + Distribution.Compat.Time Distribution.Compiler + Distribution.FieldGrammar Distribution.FieldGrammar.Class + Distribution.FieldGrammar.FieldDescrs + Distribution.FieldGrammar.Parsec Distribution.FieldGrammar.Pretty + Distribution.InstalledPackageInfo Distribution.License + Distribution.Make Distribution.ModuleName Distribution.Package + Distribution.PackageDescription + Distribution.PackageDescription.Check + Distribution.PackageDescription.Configuration + Distribution.PackageDescription.FieldGrammar + Distribution.PackageDescription.Parsec + Distribution.PackageDescription.PrettyPrint + Distribution.PackageDescription.Quirks + Distribution.PackageDescription.Utils Distribution.ParseUtils + Distribution.Parsec.Class Distribution.Parsec.Common + Distribution.Parsec.ConfVar Distribution.Parsec.Field + Distribution.Parsec.FieldLineStream Distribution.Parsec.Lexer + Distribution.Parsec.LexerMonad Distribution.Parsec.Newtypes + Distribution.Parsec.ParseResult Distribution.Parsec.Parser + Distribution.Pretty Distribution.PrettyUtils Distribution.ReadE + Distribution.SPDX Distribution.SPDX.License + Distribution.SPDX.LicenseExceptionId + Distribution.SPDX.LicenseExpression Distribution.SPDX.LicenseId + Distribution.SPDX.LicenseListVersion + Distribution.SPDX.LicenseReference Distribution.Simple + Distribution.Simple.Bench Distribution.Simple.Build + Distribution.Simple.Build.Macros + Distribution.Simple.Build.PathsModule + Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget + Distribution.Simple.BuildToolDepends Distribution.Simple.CCompiler + Distribution.Simple.Command Distribution.Simple.Compiler + Distribution.Simple.Configure Distribution.Simple.Doctest + Distribution.Simple.Flag Distribution.Simple.GHC + Distribution.Simple.GHCJS Distribution.Simple.Glob + Distribution.Simple.Haddock Distribution.Simple.HaskellSuite + Distribution.Simple.Hpc Distribution.Simple.Install + Distribution.Simple.InstallDirs Distribution.Simple.LocalBuildInfo + Distribution.Simple.PackageIndex Distribution.Simple.PreProcess + Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program + Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin + Distribution.Simple.Program.Db Distribution.Simple.Program.Find + Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg + Distribution.Simple.Program.Hpc + Distribution.Simple.Program.Internal Distribution.Simple.Program.Ld + Distribution.Simple.Program.ResponseFile + Distribution.Simple.Program.Run Distribution.Simple.Program.Script + Distribution.Simple.Program.Strip Distribution.Simple.Program.Types + Distribution.Simple.Register Distribution.Simple.Setup + Distribution.Simple.SrcDist Distribution.Simple.Test + Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09 + Distribution.Simple.Test.Log Distribution.Simple.UHC + Distribution.Simple.UserHooks Distribution.Simple.Utils + Distribution.System Distribution.TestSuite Distribution.Text + Distribution.Types.AbiDependency Distribution.Types.AbiHash + Distribution.Types.AnnotatedId Distribution.Types.Benchmark + Distribution.Types.Benchmark.Lens + Distribution.Types.BenchmarkInterface + Distribution.Types.BenchmarkType Distribution.Types.BuildInfo + Distribution.Types.BuildInfo.Lens Distribution.Types.BuildType + Distribution.Types.Component Distribution.Types.ComponentId + Distribution.Types.ComponentInclude + Distribution.Types.ComponentLocalBuildInfo + Distribution.Types.ComponentName + Distribution.Types.ComponentRequestedSpec + Distribution.Types.CondTree Distribution.Types.Condition + Distribution.Types.Dependency Distribution.Types.DependencyMap + Distribution.Types.ExeDependency Distribution.Types.Executable + Distribution.Types.Executable.Lens + Distribution.Types.ExecutableScope Distribution.Types.ExposedModule + Distribution.Types.ForeignLib Distribution.Types.ForeignLib.Lens + Distribution.Types.ForeignLibOption + Distribution.Types.ForeignLibType + Distribution.Types.GenericPackageDescription + Distribution.Types.GenericPackageDescription.Lens + Distribution.Types.HookedBuildInfo + Distribution.Types.IncludeRenaming + Distribution.Types.InstalledPackageInfo + Distribution.Types.InstalledPackageInfo.FieldGrammar + Distribution.Types.InstalledPackageInfo.Lens + Distribution.Types.LegacyExeDependency Distribution.Types.Lens + Distribution.Types.Library Distribution.Types.Library.Lens + Distribution.Types.LocalBuildInfo Distribution.Types.Mixin + Distribution.Types.Module Distribution.Types.ModuleReexport + Distribution.Types.ModuleRenaming + Distribution.Types.MungedPackageId + Distribution.Types.MungedPackageName + Distribution.Types.PackageDescription + Distribution.Types.PackageDescription.Lens + Distribution.Types.PackageId Distribution.Types.PackageId.Lens + Distribution.Types.PackageName + Distribution.Types.PkgconfigDependency + Distribution.Types.PkgconfigName Distribution.Types.SetupBuildInfo + Distribution.Types.SetupBuildInfo.Lens + Distribution.Types.SourceRepo Distribution.Types.SourceRepo.Lens + Distribution.Types.TargetInfo Distribution.Types.TestSuite + Distribution.Types.TestSuite.Lens + Distribution.Types.TestSuiteInterface Distribution.Types.TestType + Distribution.Types.UnitId Distribution.Types.UnqualComponentName + Distribution.Types.Version Distribution.Types.VersionInterval + Distribution.Types.VersionRange Distribution.Utils.Generic + Distribution.Utils.IOData Distribution.Utils.LogProgress + Distribution.Utils.MapAccum Distribution.Utils.NubList + Distribution.Utils.Progress Distribution.Utils.ShortText + Distribution.Verbosity Distribution.Version + Language.Haskell.Extension +hidden-modules: Distribution.Backpack.PreExistingComponent + Distribution.Backpack.ReadyComponent Distribution.Backpack.MixLink + Distribution.Backpack.ModuleScope Distribution.Backpack.UnifyM + Distribution.Backpack.Id Distribution.Utils.UnionFind + Distribution.Utils.Base62 Distribution.Compat.CopyFile + Distribution.Compat.GetShortPathName Distribution.Compat.MonadFail + Distribution.Compat.Prelude Distribution.Compat.SnocList + Distribution.GetOpt Distribution.Lex Distribution.Utils.String + Distribution.Simple.GHC.EnvironmentParser + Distribution.Simple.GHC.Internal Distribution.Simple.GHC.ImplInfo + Paths_Cabal +hs-libraries: HSCabal-2.4.0.1 +depends: + array-0.5.3.0 base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 + containers-0.6.0.1 deepseq-1.4.4.0 directory-1.3.3.0 + filepath-1.4.2.1 mtl-2.2.2 parsec-3.1.13.0 pretty-1.1.3.6 + process-1.6.5.0 text-1.2.3.1 time-1.8.0.2 transformers-0.5.6.2 + unix-2.7.2.2 +--- +name: array +version: 0.5.3.0 +id: array-0.5.3.0 +key: array-0.5.3.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Mutable and immutable arrays +description: + In addition to providing the "Data.Array" module + , + this package also defines the classes 'IArray' of + immutable arrays and 'MArray' of arrays mutable within appropriate + monads, as well as some instances of these classes. +category: Data Structures +exposed: True +exposed-modules: + Data.Array Data.Array.Base Data.Array.IArray Data.Array.IO + Data.Array.IO.Internals Data.Array.IO.Safe Data.Array.MArray + Data.Array.MArray.Safe Data.Array.ST Data.Array.ST.Safe + Data.Array.Storable Data.Array.Storable.Internals + Data.Array.Storable.Safe Data.Array.Unboxed Data.Array.Unsafe +hs-libraries: HSarray-0.5.3.0 +depends: + base-4.12.0.0 +--- +name: base +version: 4.12.0.0 +id: base-4.12.0.0 +key: base-4.12.0.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Basic libraries +description: + This package contains the Standard Haskell "Prelude" and its support libraries, + and a large collection of useful libraries ranging from data + structures to parsing combinators and debugging utilities. +category: Prelude +exposed: True +exposed-modules: + Control.Applicative Control.Arrow Control.Category + Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar + Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception + Control.Exception.Base Control.Monad Control.Monad.Fail + Control.Monad.Fix Control.Monad.IO.Class Control.Monad.Instances + Control.Monad.ST Control.Monad.ST.Lazy Control.Monad.ST.Lazy.Safe + Control.Monad.ST.Lazy.Unsafe Control.Monad.ST.Safe + Control.Monad.ST.Strict Control.Monad.ST.Unsafe Control.Monad.Zip + Data.Bifoldable Data.Bifunctor Data.Bitraversable Data.Bits + Data.Bool Data.Char Data.Coerce Data.Complex Data.Data Data.Dynamic + Data.Either Data.Eq Data.Fixed Data.Foldable Data.Function + Data.Functor Data.Functor.Classes Data.Functor.Compose + Data.Functor.Const Data.Functor.Contravariant Data.Functor.Identity + Data.Functor.Product Data.Functor.Sum Data.IORef Data.Int Data.Ix + Data.Kind Data.List Data.List.NonEmpty Data.Maybe Data.Monoid + Data.Ord Data.Proxy Data.Ratio Data.STRef Data.STRef.Lazy + Data.STRef.Strict Data.Semigroup Data.String Data.Traversable + Data.Tuple Data.Type.Bool Data.Type.Coercion Data.Type.Equality + Data.Typeable Data.Unique Data.Version Data.Void Data.Word + Debug.Trace Foreign Foreign.C Foreign.C.Error Foreign.C.String + Foreign.C.Types Foreign.Concurrent Foreign.ForeignPtr + Foreign.ForeignPtr.Safe Foreign.ForeignPtr.Unsafe Foreign.Marshal + Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error + Foreign.Marshal.Pool Foreign.Marshal.Safe Foreign.Marshal.Unsafe + Foreign.Marshal.Utils Foreign.Ptr Foreign.Safe Foreign.StablePtr + Foreign.Storable GHC.Arr GHC.Base GHC.ByteOrder GHC.Char GHC.Clock + GHC.Conc GHC.Conc.IO GHC.Conc.Signal GHC.Conc.Sync + GHC.ConsoleHandler GHC.Constants GHC.Desugar GHC.Enum + GHC.Environment GHC.Err GHC.Event GHC.Exception GHC.Exception.Type + GHC.ExecutionStack GHC.ExecutionStack.Internal GHC.Exts + GHC.Fingerprint GHC.Fingerprint.Type GHC.Float + GHC.Float.ConversionUtils GHC.Float.RealFracMethods GHC.Foreign + GHC.ForeignPtr GHC.GHCi GHC.Generics GHC.IO GHC.IO.Buffer + GHC.IO.BufferedIO GHC.IO.Device GHC.IO.Encoding + GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure + GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types + GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 + GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD + GHC.IO.Handle.Internals GHC.IO.Handle.Lock GHC.IO.Handle.Text + GHC.IO.Handle.Types GHC.IO.IOMode GHC.IO.Unsafe GHC.IOArray + GHC.IORef GHC.Int GHC.List GHC.MVar GHC.Maybe GHC.Natural GHC.Num + GHC.OldList GHC.OverloadedLabels GHC.Pack GHC.Profiling GHC.Ptr + GHC.RTS.Flags GHC.Read GHC.Real GHC.Records GHC.ResponseFile GHC.ST + GHC.STRef GHC.Show GHC.Stable GHC.StableName GHC.Stack + GHC.Stack.CCS GHC.Stack.Types GHC.StaticPtr GHC.Stats GHC.Storable + GHC.TopHandler GHC.TypeLits GHC.TypeNats GHC.Unicode GHC.Weak + GHC.Word Numeric Numeric.Natural Prelude System.CPUTime + System.Console.GetOpt System.Environment System.Environment.Blank + System.Exit System.IO System.IO.Error System.IO.Unsafe System.Info + System.Mem System.Mem.StableName System.Mem.Weak + System.Posix.Internals System.Posix.Types System.Timeout + Text.ParserCombinators.ReadP Text.ParserCombinators.ReadPrec + Text.Printf Text.Read Text.Read.Lex Text.Show Text.Show.Functions + Type.Reflection Type.Reflection.Unsafe Unsafe.Coerce +hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp + Data.Functor.Utils Data.OldList Data.Semigroup.Internal + Data.Typeable.Internal Foreign.ForeignPtr.Imp + GHC.StaticPtr.Internal System.Environment.ExecutablePath + System.CPUTime.Utils GHC.Event.Arr GHC.Event.Array + GHC.Event.Control GHC.Event.EPoll GHC.Event.IntTable + GHC.Event.Internal GHC.Event.KQueue GHC.Event.Manager GHC.Event.PSQ + GHC.Event.Poll GHC.Event.Thread GHC.Event.TimerManager + GHC.Event.Unique System.CPUTime.Posix.ClockGetTime + System.CPUTime.Posix.Times System.CPUTime.Posix.RUsage + System.CPUTime.Unsupported +hs-libraries: HSbase-4.12.0.0 +includes: + HsBase.h +depends: + ghc-prim-0.5.3 integer-gmp-1.0.2.0 rts +--- +name: binary +version: 0.8.6.0 +id: binary-0.8.6.0 +key: binary-0.8.6.0 +license: BSD-3-Clause +maintainer: Lennart Kolmodin, Don Stewart +author: Lennart Kolmodin +stability: provisional +homepage: https://github.com/kolmodin/binary +synopsis: Binary serialisation for Haskell values using lazy ByteStrings +description: + Efficient, pure binary serialisation using lazy ByteStrings. + Haskell values may be encoded to and from binary formats, + written to disk as binary, or sent over the network. + The format used can be automatically generated, or + you can choose to implement a custom format if needed. + Serialisation speeds of over 1 G\/sec have been observed, + so this library should be suitable for high performance + scenarios. +category: Data, Parsing +exposed: True +exposed-modules: + Data.Binary Data.Binary.Builder Data.Binary.Get + Data.Binary.Get.Internal Data.Binary.Put +hidden-modules: Data.Binary.Class Data.Binary.Internal + Data.Binary.Generic Data.Binary.FloatCast +hs-libraries: HSbinary-0.8.6.0 +depends: + array-0.5.3.0 base-4.12.0.0 bytestring-0.10.8.2 containers-0.6.0.1 +--- +name: bytestring +version: 0.10.8.2 +id: bytestring-0.10.8.2 +key: bytestring-0.10.8.2 +license: BSD-3-Clause +copyright: Copyright (c) Don Stewart 2005-2009, + (c) Duncan Coutts 2006-2015, + (c) David Roundy 2003-2005, + (c) Jasper Van der Jeugt 2010, + (c) Simon Meier 2010-2013. +maintainer: Duncan Coutts +author: Don Stewart, + Duncan Coutts +homepage: https://github.com/haskell/bytestring +synopsis: Fast, compact, strict and lazy byte strings with a list interface +description: + An efficient compact, immutable byte string type (both strict and lazy) + suitable for binary or 8-bit character data. + . + The 'ByteString' type represents sequences of bytes or 8-bit characters. + It is suitable for high performance use, both in terms of large data + quantities, or high speed requirements. The 'ByteString' functions follow + the same style as Haskell\'s ordinary lists, so it is easy to convert code + from using 'String' to 'ByteString'. + . + Two 'ByteString' variants are provided: + . + * Strict 'ByteString's keep the string as a single large array. This + makes them convenient for passing data between C and Haskell. + . + * Lazy 'ByteString's use a lazy list of strict chunks which makes it + suitable for I\/O streaming tasks. + . + The @Char8@ modules provide a character-based view of the same + underlying 'ByteString' types. This makes it convenient to handle mixed + binary and 8-bit character content (which is common in many file formats + and network protocols). + . + The 'Builder' module provides an efficient way to build up 'ByteString's + in an ad-hoc way by repeated concatenation. This is ideal for fast + serialisation or pretty printing. + . + There is also a 'ShortByteString' type which has a lower memory overhead + and can can be converted to or from a 'ByteString', but supports very few + other operations. It is suitable for keeping many short strings in memory. + . + 'ByteString's are not designed for Unicode. For Unicode strings you should + use the 'Text' type from the @text@ package. + . + These modules are intended to be imported qualified, to avoid name clashes + with "Prelude" functions, e.g. + . + > import qualified Data.ByteString as BS +category: Data +exposed: True +exposed-modules: + Data.ByteString Data.ByteString.Builder + Data.ByteString.Builder.Extra Data.ByteString.Builder.Internal + Data.ByteString.Builder.Prim Data.ByteString.Builder.Prim.Internal + Data.ByteString.Char8 Data.ByteString.Internal Data.ByteString.Lazy + Data.ByteString.Lazy.Builder Data.ByteString.Lazy.Builder.ASCII + Data.ByteString.Lazy.Builder.Extras Data.ByteString.Lazy.Char8 + Data.ByteString.Lazy.Internal Data.ByteString.Short + Data.ByteString.Short.Internal Data.ByteString.Unsafe +hidden-modules: Data.ByteString.Builder.ASCII + Data.ByteString.Builder.Prim.Binary + Data.ByteString.Builder.Prim.ASCII + Data.ByteString.Builder.Prim.Internal.Floating + Data.ByteString.Builder.Prim.Internal.UncheckedShifts + Data.ByteString.Builder.Prim.Internal.Base16 +hs-libraries: HSbytestring-0.10.8.2 +includes: + fpstring.h +depends: + base-4.12.0.0 deepseq-1.4.4.0 ghc-prim-0.5.3 integer-gmp-1.0.2.0 +--- +name: containers +version: 0.6.0.1 +id: containers-0.6.0.1 +key: containers-0.6.0.1 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Assorted concrete container types +description: + . + This package contains efficient general-purpose implementations + of various immutable container types including sets, maps, sequences, + trees, and graphs. + . + For a walkthrough of what this package provides with examples of common + operations see the [containers + introduction](https://haskell-containers.readthedocs.io). + . + The declared cost of each operation is either worst-case or amortized, but + remains valid even if structures are shared. +category: Data Structures +exposed: True +exposed-modules: + Data.Containers.ListUtils Data.Graph Data.IntMap + Data.IntMap.Internal Data.IntMap.Internal.Debug Data.IntMap.Lazy + Data.IntMap.Merge.Lazy Data.IntMap.Merge.Strict Data.IntMap.Strict + Data.IntSet Data.IntSet.Internal Data.Map Data.Map.Internal + Data.Map.Internal.Debug Data.Map.Lazy Data.Map.Merge.Lazy + Data.Map.Merge.Strict Data.Map.Strict Data.Map.Strict.Internal + Data.Sequence Data.Sequence.Internal Data.Sequence.Internal.Sorting + Data.Set Data.Set.Internal Data.Tree + Utils.Containers.Internal.BitQueue + Utils.Containers.Internal.BitUtil + Utils.Containers.Internal.StrictPair +hidden-modules: Utils.Containers.Internal.State + Utils.Containers.Internal.StrictMaybe + Utils.Containers.Internal.PtrEquality + Utils.Containers.Internal.Coercions + Utils.Containers.Internal.TypeError + Data.Map.Internal.DeprecatedShowTree + Data.IntMap.Internal.DeprecatedDebug +hs-libraries: HScontainers-0.6.0.1 +depends: + array-0.5.3.0 base-4.12.0.0 deepseq-1.4.4.0 ghc-prim-0.5.3 +--- +name: deepseq +version: 1.4.4.0 +id: deepseq-1.4.4.0 +key: deepseq-1.4.4.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Deep evaluation of data structures +description: + This package provides methods for fully evaluating data structures + (\"deep evaluation\"). Deep evaluation is often used for adding + strictness to a program, e.g. in order to force pending exceptions, + remove space leaks, or force lazy I/O to happen. It is also useful + in parallel programs, to ensure pending work does not migrate to the + wrong thread. + . + The primary use of this package is via the 'deepseq' function, a + \"deep\" version of 'seq'. It is implemented on top of an 'NFData' + typeclass (\"Normal Form Data\", data structures with no unevaluated + components) which defines strategies for fully evaluating different + data types. See module documentation in "Control.DeepSeq" for more + details. +category: Control +exposed: True +exposed-modules: + Control.DeepSeq +hidden-modules: Control.DeepSeq.BackDoor +hs-libraries: HSdeepseq-1.4.4.0 +depends: + array-0.5.3.0 base-4.12.0.0 +--- +name: directory +version: 1.3.3.0 +id: directory-1.3.3.0 +key: directory-1.3.3.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Platform-agnostic library for filesystem operations +description: + This library provides a basic set of operations for manipulating files and + directories in a portable way. +category: System +exposed: True +exposed-modules: + System.Directory System.Directory.Internal + System.Directory.Internal.Prelude +hidden-modules: System.Directory.Internal.C_utimensat + System.Directory.Internal.Common System.Directory.Internal.Config + System.Directory.Internal.Posix System.Directory.Internal.Windows +hs-libraries: HSdirectory-1.3.3.0 +depends: + base-4.12.0.0 filepath-1.4.2.1 time-1.8.0.2 unix-2.7.2.2 +--- +name: filepath +version: 1.4.2.1 +id: filepath-1.4.2.1 +key: filepath-1.4.2.1 +license: BSD-3-Clause +copyright: Neil Mitchell 2005-2018 +maintainer: Neil Mitchell +author: Neil Mitchell +homepage: https://github.com/haskell/filepath#readme +synopsis: Library for manipulating FilePaths in a cross platform way. +description: + This package provides functionality for manipulating @FilePath@ values, and is shipped with both and the . It provides three modules: + . + * "System.FilePath.Posix" manipulates POSIX\/Linux style @FilePath@ values (with @\/@ as the path separator). + . + * "System.FilePath.Windows" manipulates Windows style @FilePath@ values (with either @\\@ or @\/@ as the path separator, and deals with drives). + . + * "System.FilePath" is an alias for the module appropriate to your platform. + . + All three modules provide the same API, and the same documentation (calling out differences in the different variants). +category: System +exposed: True +exposed-modules: + System.FilePath System.FilePath.Posix System.FilePath.Windows +hs-libraries: HSfilepath-1.4.2.1 +depends: + base-4.12.0.0 +--- +name: ghc-boot +version: 8.6.5 +id: ghc-boot-8.6.5 +key: ghc-boot-8.6.5 +license: BSD-3-Clause +maintainer: ghc-devs@haskell.org +synopsis: Shared functionality between GHC and its boot libraries +description: + This library is shared between GHC, ghc-pkg, and other boot + libraries. + . + A note about "GHC.PackageDb": it only deals with the subset of + the package database that the compiler cares about: modules + paths etc and not package metadata like description, authors + etc. It is thus not a library interface to ghc-pkg and is *not* + suitable for modifying GHC package databases. + . + The package database format and this library are constructed in + such a way that while ghc-pkg depends on Cabal, the GHC library + and program do not have to depend on Cabal. +category: GHC +exposed: True +exposed-modules: + GHC.ForeignSrcLang GHC.HandleEncoding GHC.LanguageExtensions + GHC.PackageDb GHC.Serialized +hs-libraries: HSghc-boot-8.6.5 +depends: + base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 directory-1.3.3.0 + filepath-1.4.2.1 ghc-boot-th-8.6.5 +--- +name: ghc-boot-th +version: 8.6.5 +id: ghc-boot-th-8.6.5 +key: ghc-boot-th-8.6.5 +license: BSD-3-Clause +maintainer: ghc-devs@haskell.org +synopsis: Shared functionality between GHC and the @template-haskell@ + library +description: + This library contains various bits shared between the @ghc@ and + @template-haskell@ libraries. + . + This package exists to ensure that @template-haskell@ has a + minimal set of transitive dependencies, since it is intended to + be depended upon by user code. +category: GHC +exposed: True +exposed-modules: + GHC.ForeignSrcLang.Type GHC.LanguageExtensions.Type GHC.Lexeme +hs-libraries: HSghc-boot-th-8.6.5 +depends: + base-4.12.0.0 +--- +name: ghc-compact +version: 0.1.0.0 +id: ghc-compact-0.1.0.0 +key: ghc-compact-0.1.0.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: In memory storage of deeply evaluated data structure +description: + This package provides minimal functionality for working with + "compact regions", which hold a fully evaluated Haskell object graph. + These regions maintain the invariant that no pointers live inside the struct + that point outside it, which ensures efficient garbage collection without + ever reading the structure contents (effectively, it works as a manually + managed "oldest generation" which is never freed until the whole is + released). + Internally, the struct is stored a single contiguous block of memory, + which allows efficient serialization and deserialization of structs + for distributed computing. +category: Data +exposed: True +exposed-modules: + GHC.Compact GHC.Compact.Serialized +hs-libraries: HSghc-compact-0.1.0.0 +depends: + base-4.12.0.0 bytestring-0.10.8.2 ghc-prim-0.5.3 +--- +name: ghc-heap +version: 8.6.5 +id: ghc-heap-8.6.5 +key: ghc-heap-8.6.5 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Functions for walking GHC's heap +description: + This package provides functions for walking the GHC heap data structures + and retrieving information about those data structures. +category: GHC +exposed: True +exposed-modules: + GHC.Exts.Heap GHC.Exts.Heap.ClosureTypes GHC.Exts.Heap.Closures + GHC.Exts.Heap.Constants GHC.Exts.Heap.InfoTable + GHC.Exts.Heap.InfoTable.Types GHC.Exts.Heap.InfoTableProf + GHC.Exts.Heap.Utils +hs-libraries: HSghc-heap-8.6.5 +depends: + base-4.12.0.0 ghc-prim-0.5.3 rts +--- +name: ghc-prim +version: 0.5.3 +id: ghc-prim-0.5.3 +key: ghc-prim-0.5.3 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: GHC primitives +description: + This package contains the primitive types and operations supplied by GHC. +category: GHC +exposed: True +exposed-modules: + GHC.CString GHC.Classes GHC.Debug GHC.IntWord64 GHC.Magic + GHC.PrimopWrappers GHC.Tuple GHC.Types GHC.Prim +hs-libraries: HSghc-prim-0.5.3 +extra-libraries: + c m +depends: + rts +--- +name: ghci +version: 8.6.5 +id: ghci-8.6.5 +key: ghci-8.6.5 +license: BSD-3-Clause +maintainer: ghc-devs@haskell.org +synopsis: The library supporting GHC's interactive interpreter +description: + This library offers interfaces which mediate interactions between the + @ghci@ interactive shell and @iserv@, GHC's out-of-process interpreter + backend. +category: GHC +exposed: True +exposed-modules: + GHCi.BinaryArray GHCi.BreakArray GHCi.CreateBCO GHCi.FFI + GHCi.InfoTable GHCi.Message GHCi.ObjLink GHCi.RemoteTypes + GHCi.ResolvedBCO GHCi.Run GHCi.Signals GHCi.StaticPtrTable GHCi.TH + GHCi.TH.Binary SizedSeq +hs-libraries: HSghci-8.6.5 +depends: + array-0.5.3.0 base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 + containers-0.6.0.1 deepseq-1.4.4.0 filepath-1.4.2.1 ghc-boot-8.6.5 + ghc-boot-th-8.6.5 ghc-heap-8.6.5 template-haskell-2.14.0.0 + transformers-0.5.6.2 unix-2.7.2.2 +--- +name: haskeline +version: 0.7.4.3 +id: haskeline-0.7.4.3 +key: haskeline-0.7.4.3 +license: BSD-3-Clause +copyright: (c) Judah Jacobson +maintainer: Judah Jacobson +author: Judah Jacobson +stability: Stable +homepage: https://github.com/judah/haskeline +synopsis: A command-line interface for user input, written in Haskell. +description: + Haskeline provides a user interface for line input in command-line + programs. This library is similar in purpose to readline, but since + it is written in Haskell it is (hopefully) more easily used in other + Haskell programs. + . + Haskeline runs both on POSIX-compatible systems and on Windows. +category: User Interfaces +exposed: True +exposed-modules: + System.Console.Haskeline System.Console.Haskeline.Completion + System.Console.Haskeline.History System.Console.Haskeline.IO + System.Console.Haskeline.MonadException +hidden-modules: System.Console.Haskeline.Backend + System.Console.Haskeline.Backend.WCWidth + System.Console.Haskeline.Command + System.Console.Haskeline.Command.Completion + System.Console.Haskeline.Command.History + System.Console.Haskeline.Command.KillRing + System.Console.Haskeline.Directory System.Console.Haskeline.Emacs + System.Console.Haskeline.InputT System.Console.Haskeline.Key + System.Console.Haskeline.LineState System.Console.Haskeline.Monads + System.Console.Haskeline.Prefs System.Console.Haskeline.Recover + System.Console.Haskeline.RunCommand System.Console.Haskeline.Term + System.Console.Haskeline.Command.Undo System.Console.Haskeline.Vi + System.Console.Haskeline.Backend.Posix + System.Console.Haskeline.Backend.Posix.Encoder + System.Console.Haskeline.Backend.DumbTerm +hs-libraries: HShaskeline-0.7.4.3 +depends: + base-4.12.0.0 bytestring-0.10.8.2 containers-0.6.0.1 + directory-1.3.3.0 filepath-1.4.2.1 process-1.6.5.0 stm-2.5.0.0 + transformers-0.5.6.2 unix-2.7.2.2 +--- +name: hpc +version: 0.6.0.3 +id: hpc-0.6.0.3 +key: hpc-0.6.0.3 +license: BSD-3-Clause +maintainer: ghc-devs@haskell.org +author: Andy Gill +synopsis: Code Coverage Library for Haskell +description: + This package provides the code coverage library for Haskell. + . + See for more + information. +category: Control +exposed: True +exposed-modules: + Trace.Hpc.Mix Trace.Hpc.Reflect Trace.Hpc.Tix Trace.Hpc.Util +hs-libraries: HShpc-0.6.0.3 +depends: + base-4.12.0.0 containers-0.6.0.1 directory-1.3.3.0 filepath-1.4.2.1 + time-1.8.0.2 +--- +name: integer-gmp +version: 1.0.2.0 +id: integer-gmp-1.0.2.0 +key: integer-gmp-1.0.2.0 +license: BSD-3-Clause +maintainer: hvr@gnu.org +author: Herbert Valerio Riedel +synopsis: Integer library based on GMP +description: + This package provides the low-level implementation of the standard + 'Integer' type based on the + . + . + This package provides access to the internal representation of + 'Integer' as well as primitive operations with no proper error + handling, and should only be used directly with the utmost care. +category: Numeric, Algebra +exposed: True +exposed-modules: + GHC.Integer GHC.Integer.GMP.Internals GHC.Integer.Logarithms + GHC.Integer.Logarithms.Internals +hidden-modules: GHC.Integer.Type +hs-libraries: HSinteger-gmp-1.0.2.0 +extra-libraries: + gmp +depends: + ghc-prim-0.5.3 +--- +name: libiserv +version: 8.6.5 +id: libiserv-8.6.5 +key: libiserv-8.6.5 +license: BSD-3-Clause +copyright: XXX +maintainer: XXX +author: XXX +synopsis: Provides shared functionality between iserv and iserv-proxy +category: Development +exposed: True +exposed-modules: + GHCi.Utils Lib +hs-libraries: HSlibiserv-8.6.5 +depends: + base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 containers-0.6.0.1 + deepseq-1.4.4.0 ghci-8.6.5 unix-2.7.2.2 +--- +name: mtl +version: 2.2.2 +id: mtl-2.2.2 +key: mtl-2.2.2 +license: BSD-3-Clause +maintainer: Edward Kmett +author: Andy Gill +homepage: http://github.com/haskell/mtl +synopsis: Monad classes, using functional dependencies +description: + Monad classes using functional dependencies, with instances + for various monad transformers, inspired by the paper + /Functional Programming with Overloading and Higher-Order Polymorphism/, + by Mark P Jones, in /Advanced School of Functional Programming/, 1995 + (). +category: Control +exposed: True +exposed-modules: + Control.Monad.Cont Control.Monad.Cont.Class Control.Monad.Error + Control.Monad.Error.Class Control.Monad.Except + Control.Monad.Identity Control.Monad.List Control.Monad.RWS + Control.Monad.RWS.Class Control.Monad.RWS.Lazy + Control.Monad.RWS.Strict Control.Monad.Reader + Control.Monad.Reader.Class Control.Monad.State + Control.Monad.State.Class Control.Monad.State.Lazy + Control.Monad.State.Strict Control.Monad.Trans Control.Monad.Writer + Control.Monad.Writer.Class Control.Monad.Writer.Lazy + Control.Monad.Writer.Strict +hs-libraries: HSmtl-2.2.2 +depends: + base-4.12.0.0 transformers-0.5.6.2 +--- +name: parsec +version: 3.1.13.0 +id: parsec-3.1.13.0 +key: parsec-3.1.13.0 +license: BSD-3-Clause +maintainer: Herbert Valerio Riedel +author: Daan Leijen , Paolo Martini , Antoine Latter +homepage: https://github.com/haskell/parsec +synopsis: Monadic parser combinators +description: + Parsec is designed from scratch as an industrial-strength parser + library. It is simple, safe, well documented (on the package + homepage), has extensive libraries, good error messages, + and is fast. It is defined as a monad transformer that can be + stacked on arbitrary monads, and it is also parametric in the + input stream type. + . + The main entry point is the "Text.Parsec" module which provides + defaults for parsing 'Char'acter data. + . + The "Text.ParserCombinators.Parsec" module hierarchy contains + the legacy @parsec-2@ API and may be removed at some point in + the future. +category: Parsing +exposed: True +exposed-modules: + Text.Parsec Text.Parsec.ByteString Text.Parsec.ByteString.Lazy + Text.Parsec.Char Text.Parsec.Combinator Text.Parsec.Error + Text.Parsec.Expr Text.Parsec.Language Text.Parsec.Perm + Text.Parsec.Pos Text.Parsec.Prim Text.Parsec.String + Text.Parsec.Text Text.Parsec.Text.Lazy Text.Parsec.Token + Text.ParserCombinators.Parsec Text.ParserCombinators.Parsec.Char + Text.ParserCombinators.Parsec.Combinator + Text.ParserCombinators.Parsec.Error + Text.ParserCombinators.Parsec.Expr + Text.ParserCombinators.Parsec.Language + Text.ParserCombinators.Parsec.Perm + Text.ParserCombinators.Parsec.Pos + Text.ParserCombinators.Parsec.Prim + Text.ParserCombinators.Parsec.Token +hs-libraries: HSparsec-3.1.13.0 +depends: + base-4.12.0.0 bytestring-0.10.8.2 mtl-2.2.2 text-1.2.3.1 +--- +name: pretty +version: 1.1.3.6 +id: pretty-1.1.3.6 +key: pretty-1.1.3.6 +license: BSD-3-Clause +maintainer: David Terei +stability: Stable +homepage: http://github.com/haskell/pretty +synopsis: Pretty-printing library +description: + This package contains a pretty-printing library, a set of API's + that provides a way to easily print out text in a consistent + format of your choosing. This is useful for compilers and related + tools. + . + This library was originally designed by John Hughes's and has since + been heavily modified by Simon Peyton Jones. +category: Text +exposed: True +exposed-modules: + Text.PrettyPrint Text.PrettyPrint.Annotated + Text.PrettyPrint.Annotated.HughesPJ + Text.PrettyPrint.Annotated.HughesPJClass Text.PrettyPrint.HughesPJ + Text.PrettyPrint.HughesPJClass +hs-libraries: HSpretty-1.1.3.6 +depends: + base-4.12.0.0 deepseq-1.4.4.0 ghc-prim-0.5.3 +--- +name: process +version: 1.6.5.0 +id: process-1.6.5.0 +key: process-1.6.5.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Process libraries +description: + This package contains libraries for dealing with system processes. + . + The typed-process package is a more recent take on a process API, + which uses this package internally. It features better binary + support, easier concurrency, and a more composable API. You can + read more about it at + . +category: System +exposed: True +exposed-modules: + System.Cmd System.Process System.Process.Internals +hidden-modules: System.Process.Common System.Process.Posix +hs-libraries: HSprocess-1.6.5.0 +includes: + runProcess.h +depends: + base-4.12.0.0 deepseq-1.4.4.0 directory-1.3.3.0 filepath-1.4.2.1 + unix-2.7.2.2 +--- +name: rts +version: 1.0 +id: rts +key: rts +license: BSD-3-Clause +maintainer: glasgow-haskell-users@haskell.org +exposed: True +hs-libraries: HSrts +extra-libraries: + m rt dl ffi +includes: + Stg.h +ld-options: "-Wl,-u,base_GHCziTopHandler_runIO_closure" + "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" + "-Wl,-u,ghczmprim_GHCziTuple_Z0T_closure" + "-Wl,-u,ghczmprim_GHCziTypes_True_closure" + "-Wl,-u,ghczmprim_GHCziTypes_False_closure" + "-Wl,-u,base_GHCziPack_unpackCString_closure" + "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" + "-Wl,-u,base_GHCziIOziException_stackOverflow_closure" + "-Wl,-u,base_GHCziIOziException_heapOverflow_closure" + "-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" + "-Wl,-u,base_GHCziIOziException_cannotCompactFunction_closure" + "-Wl,-u,base_GHCziIOziException_cannotCompactPinned_closure" + "-Wl,-u,base_GHCziIOziException_cannotCompactMutable_closure" + "-Wl,-u,base_ControlziExceptionziBase_absentSumFieldError_closure" + "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" + "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" + "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure" + "-Wl,-u,base_GHCziConcziSync_runSparks_closure" + "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" + "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" + "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure" + "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" + "-Wl,-u,base_GHCziTopHandler_runMainIO_closure" + "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Wzh_con_info" + "-Wl,-u,base_GHCziPtr_Ptr_con_info" + "-Wl,-u,base_GHCziPtr_FunPtr_con_info" + "-Wl,-u,base_GHCziInt_I8zh_con_info" + "-Wl,-u,base_GHCziInt_I16zh_con_info" + "-Wl,-u,base_GHCziInt_I32zh_con_info" + "-Wl,-u,base_GHCziInt_I64zh_con_info" + "-Wl,-u,base_GHCziWord_W8zh_con_info" + "-Wl,-u,base_GHCziWord_W16zh_con_info" + "-Wl,-u,base_GHCziWord_W32zh_con_info" + "-Wl,-u,base_GHCziWord_W64zh_con_info" + "-Wl,-u,base_GHCziStable_StablePtr_con_info" + "-Wl,-u,hs_atomic_add8" "-Wl,-u,hs_atomic_add16" + "-Wl,-u,hs_atomic_add32" "-Wl,-u,hs_atomic_add64" + "-Wl,-u,hs_atomic_sub8" "-Wl,-u,hs_atomic_sub16" + "-Wl,-u,hs_atomic_sub32" "-Wl,-u,hs_atomic_sub64" + "-Wl,-u,hs_atomic_and8" "-Wl,-u,hs_atomic_and16" + "-Wl,-u,hs_atomic_and32" "-Wl,-u,hs_atomic_and64" + "-Wl,-u,hs_atomic_nand8" "-Wl,-u,hs_atomic_nand16" + "-Wl,-u,hs_atomic_nand32" "-Wl,-u,hs_atomic_nand64" + "-Wl,-u,hs_atomic_or8" "-Wl,-u,hs_atomic_or16" + "-Wl,-u,hs_atomic_or32" "-Wl,-u,hs_atomic_or64" + "-Wl,-u,hs_atomic_xor8" "-Wl,-u,hs_atomic_xor16" + "-Wl,-u,hs_atomic_xor32" "-Wl,-u,hs_atomic_xor64" + "-Wl,-u,hs_cmpxchg8" "-Wl,-u,hs_cmpxchg16" "-Wl,-u,hs_cmpxchg32" + "-Wl,-u,hs_cmpxchg64" "-Wl,-u,hs_atomicread8" + "-Wl,-u,hs_atomicread16" "-Wl,-u,hs_atomicread32" + "-Wl,-u,hs_atomicread64" "-Wl,-u,hs_atomicwrite8" + "-Wl,-u,hs_atomicwrite16" "-Wl,-u,hs_atomicwrite32" + "-Wl,-u,hs_atomicwrite64" +--- +name: stm +version: 2.5.0.0 +id: stm-2.5.0.0 +key: stm-2.5.0.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +homepage: https://wiki.haskell.org/Software_transactional_memory +synopsis: Software Transactional Memory +description: + Software Transactional Memory, or STM, is an abstraction for + concurrent communication. The main benefits of STM are + /composability/ and /modularity/. That is, using STM you can write + concurrent abstractions that can be easily composed with any other + abstraction built using STM, without exposing the details of how + your abstraction ensures safety. This is typically not the case + with other forms of concurrent communication, such as locks or + 'MVar's. +category: Concurrency +exposed: True +exposed-modules: + Control.Concurrent.STM Control.Concurrent.STM.TArray + Control.Concurrent.STM.TBQueue Control.Concurrent.STM.TChan + Control.Concurrent.STM.TMVar Control.Concurrent.STM.TQueue + Control.Concurrent.STM.TSem Control.Concurrent.STM.TVar + Control.Monad.STM +hidden-modules: Control.Sequential.STM +hs-libraries: HSstm-2.5.0.0 +depends: + array-0.5.3.0 base-4.12.0.0 +--- +name: template-haskell +version: 2.14.0.0 +id: template-haskell-2.14.0.0 +key: template-haskell-2.14.0.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Support library for Template Haskell +description: + This package provides modules containing facilities for manipulating + Haskell source code using Template Haskell. + . + See for more + information. +category: Template Haskell +exposed: True +exposed-modules: + Language.Haskell.TH Language.Haskell.TH.LanguageExtensions + Language.Haskell.TH.Lib Language.Haskell.TH.Lib.Internal + Language.Haskell.TH.Ppr Language.Haskell.TH.PprLib + Language.Haskell.TH.Quote Language.Haskell.TH.Syntax +hidden-modules: Language.Haskell.TH.Lib.Map +hs-libraries: HStemplate-haskell-2.14.0.0 +depends: + base-4.12.0.0 ghc-boot-th-8.6.5 pretty-1.1.3.6 +--- +name: text +version: 1.2.3.1 +id: text-1.2.3.1 +key: text-1.2.3.1 +license: BSD-2-Clause +copyright: 2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper +maintainer: Bryan O'Sullivan , Herbert Valerio Riedel +author: Bryan O'Sullivan +homepage: https://github.com/haskell/text +synopsis: An efficient packed Unicode text type. +description: + . + An efficient packed, immutable Unicode text type (both strict and + lazy), with a powerful loop fusion optimization framework. + . + The 'Text' type represents Unicode character strings, in a time and + space-efficient manner. This package provides text processing + capabilities that are optimized for performance critical use, both + in terms of large data quantities and high speed. + . + The 'Text' type provides character-encoding, type-safe case + conversion via whole-string case conversion functions (see "Data.Text"). + It also provides a range of functions for converting 'Text' values to + and from 'ByteStrings', using several standard encodings + (see "Data.Text.Encoding"). + . + Efficient locale-sensitive support for text IO is also supported + (see "Data.Text.IO"). + . + These modules are intended to be imported qualified, to avoid name + clashes with Prelude functions, e.g. + . + > import qualified Data.Text as T + . + To use an extended and very rich family of functions for working + with Unicode text (including normalization, regular expressions, + non-standard encodings, text breaking, and locales), see + the [text-icu package](https://hackage.haskell.org/package/text-icu) + based on the well-respected and liberally + licensed [ICU library](http://site.icu-project.org/). +category: Data, Text +exposed: True +exposed-modules: + Data.Text Data.Text.Array Data.Text.Encoding + Data.Text.Encoding.Error Data.Text.Foreign Data.Text.IO + Data.Text.Internal Data.Text.Internal.Builder + Data.Text.Internal.Builder.Functions + Data.Text.Internal.Builder.Int.Digits + Data.Text.Internal.Builder.RealFloat.Functions + Data.Text.Internal.Encoding.Fusion + Data.Text.Internal.Encoding.Fusion.Common + Data.Text.Internal.Encoding.Utf16 Data.Text.Internal.Encoding.Utf32 + Data.Text.Internal.Encoding.Utf8 Data.Text.Internal.Functions + Data.Text.Internal.Fusion Data.Text.Internal.Fusion.CaseMapping + Data.Text.Internal.Fusion.Common Data.Text.Internal.Fusion.Size + Data.Text.Internal.Fusion.Types Data.Text.Internal.IO + Data.Text.Internal.Lazy Data.Text.Internal.Lazy.Encoding.Fusion + Data.Text.Internal.Lazy.Fusion Data.Text.Internal.Lazy.Search + Data.Text.Internal.Private Data.Text.Internal.Read + Data.Text.Internal.Search Data.Text.Internal.Unsafe + Data.Text.Internal.Unsafe.Char Data.Text.Internal.Unsafe.Shift + Data.Text.Lazy Data.Text.Lazy.Builder Data.Text.Lazy.Builder.Int + Data.Text.Lazy.Builder.RealFloat Data.Text.Lazy.Encoding + Data.Text.Lazy.IO Data.Text.Lazy.Internal Data.Text.Lazy.Read + Data.Text.Read Data.Text.Unsafe +hidden-modules: Data.Text.Show +hs-libraries: HStext-1.2.3.1 +depends: + array-0.5.3.0 base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 + deepseq-1.4.4.0 ghc-prim-0.5.3 integer-gmp-1.0.2.0 +--- +name: time +version: 1.8.0.2 +id: time-1.8.0.2 +key: time-1.8.0.2 +license: BSD-3-Clause +maintainer: +author: Ashley Yakeley +stability: stable +homepage: https://github.com/haskell/time +synopsis: A time library +description: + A time library +category: Time +exposed: True +exposed-modules: + Data.Time Data.Time.Calendar Data.Time.Calendar.Easter + Data.Time.Calendar.Julian Data.Time.Calendar.MonthDay + Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate + Data.Time.Clock Data.Time.Clock.POSIX Data.Time.Clock.System + Data.Time.Clock.TAI Data.Time.Format Data.Time.LocalTime +hidden-modules: Data.Time.Calendar.Private Data.Time.Calendar.Days + Data.Time.Calendar.Gregorian Data.Time.Calendar.JulianYearDay + Data.Time.Clock.Internal.DiffTime + Data.Time.Clock.Internal.AbsoluteTime + Data.Time.Clock.Internal.NominalDiffTime + Data.Time.Clock.Internal.POSIXTime + Data.Time.Clock.Internal.UniversalTime + Data.Time.Clock.Internal.SystemTime + Data.Time.Clock.Internal.UTCTime Data.Time.Clock.Internal.CTimeval + Data.Time.Clock.Internal.CTimespec Data.Time.Clock.Internal.UTCDiff + Data.Time.LocalTime.Internal.TimeZone + Data.Time.LocalTime.Internal.TimeOfDay + Data.Time.LocalTime.Internal.LocalTime + Data.Time.LocalTime.Internal.ZonedTime Data.Time.Format.Parse + Data.Time.Format.Locale +hs-libraries: HStime-1.8.0.2 +depends: + base-4.12.0.0 deepseq-1.4.4.0 +--- +name: transformers +version: 0.5.6.2 +id: transformers-0.5.6.2 +key: transformers-0.5.6.2 +license: BSD-3-Clause +maintainer: Ross Paterson +author: Andy Gill, Ross Paterson +synopsis: Concrete functor and monad transformers +description: + A portable library of functor and monad transformers, inspired by + the paper + . + * \"Functional Programming with Overloading and Higher-Order + Polymorphism\", by Mark P Jones, + in /Advanced School of Functional Programming/, 1995 + (). + . + This package contains: + . + * the monad transformer class (in "Control.Monad.Trans.Class") + . + * concrete functor and monad transformers, each with associated + operations and functions to lift operations associated with other + transformers. + . + The package can be used on its own in portable Haskell code, in + which case operations need to be manually lifted through transformer + stacks (see "Control.Monad.Trans.Class" for some examples). + Alternatively, it can be used with the non-portable monad classes in + the @mtl@ or @monads-tf@ packages, which automatically lift operations + introduced by monad transformers through other transformers. +category: Control +exposed: True +exposed-modules: + Control.Applicative.Backwards Control.Applicative.Lift + Control.Monad.Signatures Control.Monad.Trans.Accum + Control.Monad.Trans.Class Control.Monad.Trans.Cont + Control.Monad.Trans.Error Control.Monad.Trans.Except + Control.Monad.Trans.Identity Control.Monad.Trans.List + Control.Monad.Trans.Maybe Control.Monad.Trans.RWS + Control.Monad.Trans.RWS.CPS Control.Monad.Trans.RWS.Lazy + Control.Monad.Trans.RWS.Strict Control.Monad.Trans.Reader + Control.Monad.Trans.Select Control.Monad.Trans.State + Control.Monad.Trans.State.Lazy Control.Monad.Trans.State.Strict + Control.Monad.Trans.Writer Control.Monad.Trans.Writer.CPS + Control.Monad.Trans.Writer.Lazy Control.Monad.Trans.Writer.Strict + Data.Functor.Constant Data.Functor.Reverse +hs-libraries: HStransformers-0.5.6.2 +depends: + base-4.12.0.0 +--- +name: unix +version: 2.7.2.2 +id: unix-2.7.2.2 +key: unix-2.7.2.2 +license: BSD-3-Clause +maintainer: libraries@haskell.org +homepage: https://github.com/haskell/unix +synopsis: POSIX functionality +description: + This package gives you access to the set of operating system + services standardised by + + (or the IEEE Portable Operating System Interface for Computing + Environments - IEEE Std. 1003.1). + . + The package is not supported under Windows. +category: System +exposed: True +exposed-modules: + System.Posix System.Posix.ByteString + System.Posix.ByteString.FilePath System.Posix.Directory + System.Posix.Directory.ByteString System.Posix.DynamicLinker + System.Posix.DynamicLinker.ByteString + System.Posix.DynamicLinker.Module + System.Posix.DynamicLinker.Module.ByteString + System.Posix.DynamicLinker.Prim System.Posix.Env + System.Posix.Env.ByteString System.Posix.Error System.Posix.Fcntl + System.Posix.Files System.Posix.Files.ByteString System.Posix.IO + System.Posix.IO.ByteString System.Posix.Process + System.Posix.Process.ByteString System.Posix.Process.Internals + System.Posix.Resource System.Posix.Semaphore System.Posix.SharedMem + System.Posix.Signals System.Posix.Signals.Exts System.Posix.Temp + System.Posix.Temp.ByteString System.Posix.Terminal + System.Posix.Terminal.ByteString System.Posix.Time + System.Posix.Unistd System.Posix.User +hidden-modules: System.Posix.Directory.Common + System.Posix.DynamicLinker.Common System.Posix.Files.Common + System.Posix.IO.Common System.Posix.Process.Common + System.Posix.Terminal.Common +hs-libraries: HSunix-2.7.2.2 +includes: + HsUnix.h execvpe.h +depends: + base-4.12.0.0 bytestring-0.10.8.2 time-1.8.0.2 diff --git a/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/version b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/version new file mode 100644 index 0000000000..c705360a92 --- /dev/null +++ b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc-pkg/version @@ -0,0 +1 @@ +GHC package manager version 8.6.5 diff --git a/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/info b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/info new file mode 100644 index 0000000000..5e765c77e8 --- /dev/null +++ b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/info @@ -0,0 +1,57 @@ + [("Project name","The Glorious Glasgow Haskell Compilation System") + ,("GCC extra via C opts"," -fwrapv -fno-builtin") + ,("C compiler flags"," -fno-stack-protector") + ,("C compiler link flags"," -Wl,-z,noexecstack") + ,("C compiler supports -no-pie","YES") + ,("Haskell CPP flags","-E -undef -traditional") + ,("ld flags"," -z noexecstack") + ,("ld supports compact unwind","YES") + ,("ld supports build-id","YES") + ,("ld supports filelist","NO") + ,("ld is GNU ld","YES") + ,("ar flags","q") + ,("ar supports at file","YES") + ,("touch command","touch") + ,("dllwrap command","/bin/false") + ,("windres command","/bin/false") + ,("libtool command","libtool") + ,("cross compiling","YES") + ,("target os","OSLinux") + ,("target arch","ArchARM64") + ,("target word size","8") + ,("target has GNU nonexec stack","True") + ,("target has .ident directive","True") + ,("target has subsections via symbols","False") + ,("target has RTS linker","YES") + ,("Unregisterised","NO") + ,("LLVM llc command","llc") + ,("LLVM opt command","opt") + ,("LLVM clang command","clang") + ,("Project version","8.6.5") + ,("Project Git commit id","92b6a0237e0195cee4773de4b237951addd659d9") + ,("Booter version","8.4.4") + ,("Stage","1") + ,("Build platform","x86_64-unknown-linux") + ,("Host platform","x86_64-unknown-linux") + ,("Target platform","aarch64-unknown-linux") + ,("Have interpreter","YES") + ,("Object splitting supported","NO") + ,("Have native code generator","NO") + ,("Support SMP","YES") + ,("Tables next to code","YES") + ,("RTS ways","l debug thr thr_debug thr_l thr_p ") + ,("RTS expects libdw","NO") + ,("Support dynamic-too","YES") + ,("Support parallel --make","YES") + ,("Support reexported-modules","YES") + ,("Support thinning and renaming package flags","YES") + ,("Support Backpack","YES") + ,("Requires unified installed package IDs","YES") + ,("Uses package keys","YES") + ,("Uses unit IDs","YES") + ,("Dynamic by default","NO") + ,("GHC Dynamic","NO") + ,("GHC Profiled","NO") + ,("Leading underscore","NO") + ,("Debug on","False") + ] diff --git a/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/numeric-version b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/numeric-version new file mode 100644 index 0000000000..a479a82190 --- /dev/null +++ b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/numeric-version @@ -0,0 +1 @@ +8.6.5 diff --git a/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/supported-languages b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/supported-languages new file mode 100644 index 0000000000..50a0383159 --- /dev/null +++ b/materialized/dummy-ghc/aarch64-unknown-linux-musl-aarch64-unknown-linux-musl-ghc-8.6.5-x86_64-linux/ghc/supported-languages @@ -0,0 +1,247 @@ +Haskell98 +Haskell2010 +Unsafe +Trustworthy +Safe +AllowAmbiguousTypes +NoAllowAmbiguousTypes +AlternativeLayoutRule +NoAlternativeLayoutRule +AlternativeLayoutRuleTransitional +NoAlternativeLayoutRuleTransitional +Arrows +NoArrows +AutoDeriveTypeable +NoAutoDeriveTypeable +BangPatterns +NoBangPatterns +BinaryLiterals +NoBinaryLiterals +CApiFFI +NoCApiFFI +CPP +NoCPP +ConstrainedClassMethods +NoConstrainedClassMethods +ConstraintKinds +NoConstraintKinds +DataKinds +NoDataKinds +DatatypeContexts +NoDatatypeContexts +DefaultSignatures +NoDefaultSignatures +DeriveAnyClass +NoDeriveAnyClass +DeriveDataTypeable +NoDeriveDataTypeable +DeriveFoldable +NoDeriveFoldable +DeriveFunctor +NoDeriveFunctor +DeriveGeneric +NoDeriveGeneric +DeriveLift +NoDeriveLift +DeriveTraversable +NoDeriveTraversable +DerivingStrategies +NoDerivingStrategies +DerivingVia +NoDerivingVia +DisambiguateRecordFields +NoDisambiguateRecordFields +DoAndIfThenElse +NoDoAndIfThenElse +BlockArguments +NoBlockArguments +DoRec +NoDoRec +DuplicateRecordFields +NoDuplicateRecordFields +EmptyCase +NoEmptyCase +EmptyDataDecls +NoEmptyDataDecls +EmptyDataDeriving +NoEmptyDataDeriving +ExistentialQuantification +NoExistentialQuantification +ExplicitForAll +NoExplicitForAll +ExplicitNamespaces +NoExplicitNamespaces +ExtendedDefaultRules +NoExtendedDefaultRules +FlexibleContexts +NoFlexibleContexts +FlexibleInstances +NoFlexibleInstances +ForeignFunctionInterface +NoForeignFunctionInterface +FunctionalDependencies +NoFunctionalDependencies +GADTSyntax +NoGADTSyntax +GADTs +NoGADTs +GHCForeignImportPrim +NoGHCForeignImportPrim +GeneralizedNewtypeDeriving +NoGeneralizedNewtypeDeriving +GeneralisedNewtypeDeriving +NoGeneralisedNewtypeDeriving +ImplicitParams +NoImplicitParams +ImplicitPrelude +NoImplicitPrelude +ImpredicativeTypes +NoImpredicativeTypes +IncoherentInstances +NoIncoherentInstances +TypeFamilyDependencies +NoTypeFamilyDependencies +InstanceSigs +NoInstanceSigs +ApplicativeDo +NoApplicativeDo +InterruptibleFFI +NoInterruptibleFFI +JavaScriptFFI +NoJavaScriptFFI +KindSignatures +NoKindSignatures +LambdaCase +NoLambdaCase +LiberalTypeSynonyms +NoLiberalTypeSynonyms +MagicHash +NoMagicHash +MonadComprehensions +NoMonadComprehensions +MonadFailDesugaring +NoMonadFailDesugaring +MonoLocalBinds +NoMonoLocalBinds +MonoPatBinds +NoMonoPatBinds +MonomorphismRestriction +NoMonomorphismRestriction +MultiParamTypeClasses +NoMultiParamTypeClasses +MultiWayIf +NoMultiWayIf +NumericUnderscores +NoNumericUnderscores +NPlusKPatterns +NoNPlusKPatterns +NamedFieldPuns +NoNamedFieldPuns +NamedWildCards +NoNamedWildCards +NegativeLiterals +NoNegativeLiterals +HexFloatLiterals +NoHexFloatLiterals +NondecreasingIndentation +NoNondecreasingIndentation +NullaryTypeClasses +NoNullaryTypeClasses +NumDecimals +NoNumDecimals +OverlappingInstances +NoOverlappingInstances +OverloadedLabels +NoOverloadedLabels +OverloadedLists +NoOverloadedLists +OverloadedStrings +NoOverloadedStrings +PackageImports +NoPackageImports +ParallelArrays +NoParallelArrays +ParallelListComp +NoParallelListComp +PartialTypeSignatures +NoPartialTypeSignatures +PatternGuards +NoPatternGuards +PatternSignatures +NoPatternSignatures +PatternSynonyms +NoPatternSynonyms +PolyKinds +NoPolyKinds +PolymorphicComponents +NoPolymorphicComponents +QuantifiedConstraints +NoQuantifiedConstraints +PostfixOperators +NoPostfixOperators +QuasiQuotes +NoQuasiQuotes +Rank2Types +NoRank2Types +RankNTypes +NoRankNTypes +RebindableSyntax +NoRebindableSyntax +RecordPuns +NoRecordPuns +RecordWildCards +NoRecordWildCards +RecursiveDo +NoRecursiveDo +RelaxedLayout +NoRelaxedLayout +RelaxedPolyRec +NoRelaxedPolyRec +RoleAnnotations +NoRoleAnnotations +ScopedTypeVariables +NoScopedTypeVariables +StandaloneDeriving +NoStandaloneDeriving +StarIsType +NoStarIsType +StaticPointers +NoStaticPointers +Strict +NoStrict +StrictData +NoStrictData +TemplateHaskell +NoTemplateHaskell +TemplateHaskellQuotes +NoTemplateHaskellQuotes +TraditionalRecordSyntax +NoTraditionalRecordSyntax +TransformListComp +NoTransformListComp +TupleSections +NoTupleSections +TypeApplications +NoTypeApplications +TypeInType +NoTypeInType +TypeFamilies +NoTypeFamilies +TypeOperators +NoTypeOperators +TypeSynonymInstances +NoTypeSynonymInstances +UnboxedTuples +NoUnboxedTuples +UnboxedSums +NoUnboxedSums +UndecidableInstances +NoUndecidableInstances +UndecidableSuperClasses +NoUndecidableSuperClasses +UnicodeSyntax +NoUnicodeSyntax +UnliftedFFITypes +NoUnliftedFFITypes +ViewPatterns +NoViewPatterns diff --git a/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global new file mode 100644 index 0000000000..5cd3765f61 --- /dev/null +++ b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc-pkg/dump-global @@ -0,0 +1,1216 @@ +name: Cabal +version: 2.4.0.1 +id: Cabal-2.4.0.1 +key: Cabal-2.4.0.1 +license: BSD-3-Clause +copyright: 2003-2018, Cabal Development Team (see AUTHORS file) +maintainer: cabal-devel@haskell.org +author: Cabal Development Team +homepage: http://www.haskell.org/cabal/ +synopsis: A framework for packaging Haskell software +description: + The Haskell Common Architecture for Building Applications and + Libraries: a framework defining a common interface for authors to more + easily build their Haskell applications in a portable way. + . + The Haskell Cabal is part of a larger infrastructure for distributing, + organizing, and cataloging Haskell libraries and tools. +category: Distribution +exposed: True +exposed-modules: + Distribution.Backpack Distribution.Backpack.ComponentsGraph + Distribution.Backpack.Configure + Distribution.Backpack.ConfiguredComponent + Distribution.Backpack.DescribeUnitId + Distribution.Backpack.FullUnitId + Distribution.Backpack.LinkedComponent + Distribution.Backpack.ModSubst Distribution.Backpack.ModuleShape + Distribution.Backpack.PreModuleShape Distribution.CabalSpecVersion + Distribution.Compat.Binary Distribution.Compat.CharParsing + Distribution.Compat.CreatePipe Distribution.Compat.DList + Distribution.Compat.Directory Distribution.Compat.Environment + Distribution.Compat.Exception Distribution.Compat.Graph + Distribution.Compat.Internal.TempFile Distribution.Compat.Lens + Distribution.Compat.Newtype Distribution.Compat.Parsing + Distribution.Compat.Prelude.Internal Distribution.Compat.ReadP + Distribution.Compat.Semigroup Distribution.Compat.Stack + Distribution.Compat.Time Distribution.Compiler + Distribution.FieldGrammar Distribution.FieldGrammar.Class + Distribution.FieldGrammar.FieldDescrs + Distribution.FieldGrammar.Parsec Distribution.FieldGrammar.Pretty + Distribution.InstalledPackageInfo Distribution.License + Distribution.Make Distribution.ModuleName Distribution.Package + Distribution.PackageDescription + Distribution.PackageDescription.Check + Distribution.PackageDescription.Configuration + Distribution.PackageDescription.FieldGrammar + Distribution.PackageDescription.Parsec + Distribution.PackageDescription.PrettyPrint + Distribution.PackageDescription.Quirks + Distribution.PackageDescription.Utils Distribution.ParseUtils + Distribution.Parsec.Class Distribution.Parsec.Common + Distribution.Parsec.ConfVar Distribution.Parsec.Field + Distribution.Parsec.FieldLineStream Distribution.Parsec.Lexer + Distribution.Parsec.LexerMonad Distribution.Parsec.Newtypes + Distribution.Parsec.ParseResult Distribution.Parsec.Parser + Distribution.Pretty Distribution.PrettyUtils Distribution.ReadE + Distribution.SPDX Distribution.SPDX.License + Distribution.SPDX.LicenseExceptionId + Distribution.SPDX.LicenseExpression Distribution.SPDX.LicenseId + Distribution.SPDX.LicenseListVersion + Distribution.SPDX.LicenseReference Distribution.Simple + Distribution.Simple.Bench Distribution.Simple.Build + Distribution.Simple.Build.Macros + Distribution.Simple.Build.PathsModule + Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget + Distribution.Simple.BuildToolDepends Distribution.Simple.CCompiler + Distribution.Simple.Command Distribution.Simple.Compiler + Distribution.Simple.Configure Distribution.Simple.Doctest + Distribution.Simple.Flag Distribution.Simple.GHC + Distribution.Simple.GHCJS Distribution.Simple.Glob + Distribution.Simple.Haddock Distribution.Simple.HaskellSuite + Distribution.Simple.Hpc Distribution.Simple.Install + Distribution.Simple.InstallDirs Distribution.Simple.LocalBuildInfo + Distribution.Simple.PackageIndex Distribution.Simple.PreProcess + Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program + Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin + Distribution.Simple.Program.Db Distribution.Simple.Program.Find + Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg + Distribution.Simple.Program.Hpc + Distribution.Simple.Program.Internal Distribution.Simple.Program.Ld + Distribution.Simple.Program.ResponseFile + Distribution.Simple.Program.Run Distribution.Simple.Program.Script + Distribution.Simple.Program.Strip Distribution.Simple.Program.Types + Distribution.Simple.Register Distribution.Simple.Setup + Distribution.Simple.SrcDist Distribution.Simple.Test + Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09 + Distribution.Simple.Test.Log Distribution.Simple.UHC + Distribution.Simple.UserHooks Distribution.Simple.Utils + Distribution.System Distribution.TestSuite Distribution.Text + Distribution.Types.AbiDependency Distribution.Types.AbiHash + Distribution.Types.AnnotatedId Distribution.Types.Benchmark + Distribution.Types.Benchmark.Lens + Distribution.Types.BenchmarkInterface + Distribution.Types.BenchmarkType Distribution.Types.BuildInfo + Distribution.Types.BuildInfo.Lens Distribution.Types.BuildType + Distribution.Types.Component Distribution.Types.ComponentId + Distribution.Types.ComponentInclude + Distribution.Types.ComponentLocalBuildInfo + Distribution.Types.ComponentName + Distribution.Types.ComponentRequestedSpec + Distribution.Types.CondTree Distribution.Types.Condition + Distribution.Types.Dependency Distribution.Types.DependencyMap + Distribution.Types.ExeDependency Distribution.Types.Executable + Distribution.Types.Executable.Lens + Distribution.Types.ExecutableScope Distribution.Types.ExposedModule + Distribution.Types.ForeignLib Distribution.Types.ForeignLib.Lens + Distribution.Types.ForeignLibOption + Distribution.Types.ForeignLibType + Distribution.Types.GenericPackageDescription + Distribution.Types.GenericPackageDescription.Lens + Distribution.Types.HookedBuildInfo + Distribution.Types.IncludeRenaming + Distribution.Types.InstalledPackageInfo + Distribution.Types.InstalledPackageInfo.FieldGrammar + Distribution.Types.InstalledPackageInfo.Lens + Distribution.Types.LegacyExeDependency Distribution.Types.Lens + Distribution.Types.Library Distribution.Types.Library.Lens + Distribution.Types.LocalBuildInfo Distribution.Types.Mixin + Distribution.Types.Module Distribution.Types.ModuleReexport + Distribution.Types.ModuleRenaming + Distribution.Types.MungedPackageId + Distribution.Types.MungedPackageName + Distribution.Types.PackageDescription + Distribution.Types.PackageDescription.Lens + Distribution.Types.PackageId Distribution.Types.PackageId.Lens + Distribution.Types.PackageName + Distribution.Types.PkgconfigDependency + Distribution.Types.PkgconfigName Distribution.Types.SetupBuildInfo + Distribution.Types.SetupBuildInfo.Lens + Distribution.Types.SourceRepo Distribution.Types.SourceRepo.Lens + Distribution.Types.TargetInfo Distribution.Types.TestSuite + Distribution.Types.TestSuite.Lens + Distribution.Types.TestSuiteInterface Distribution.Types.TestType + Distribution.Types.UnitId Distribution.Types.UnqualComponentName + Distribution.Types.Version Distribution.Types.VersionInterval + Distribution.Types.VersionRange Distribution.Utils.Generic + Distribution.Utils.IOData Distribution.Utils.LogProgress + Distribution.Utils.MapAccum Distribution.Utils.NubList + Distribution.Utils.Progress Distribution.Utils.ShortText + Distribution.Verbosity Distribution.Version + Language.Haskell.Extension +hidden-modules: Distribution.Backpack.PreExistingComponent + Distribution.Backpack.ReadyComponent Distribution.Backpack.MixLink + Distribution.Backpack.ModuleScope Distribution.Backpack.UnifyM + Distribution.Backpack.Id Distribution.Utils.UnionFind + Distribution.Utils.Base62 Distribution.Compat.CopyFile + Distribution.Compat.GetShortPathName Distribution.Compat.MonadFail + Distribution.Compat.Prelude Distribution.Compat.SnocList + Distribution.GetOpt Distribution.Lex Distribution.Utils.String + Distribution.Simple.GHC.EnvironmentParser + Distribution.Simple.GHC.Internal Distribution.Simple.GHC.ImplInfo + Paths_Cabal +hs-libraries: HSCabal-2.4.0.1 +depends: + array-0.5.3.0 base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 + containers-0.6.0.1 deepseq-1.4.4.0 directory-1.3.3.0 + filepath-1.4.2.1 mtl-2.2.2 parsec-3.1.13.0 pretty-1.1.3.6 + process-1.6.5.0 text-1.2.3.1 time-1.8.0.2 transformers-0.5.6.2 + unix-2.7.2.2 +--- +name: array +version: 0.5.3.0 +id: array-0.5.3.0 +key: array-0.5.3.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Mutable and immutable arrays +description: + In addition to providing the "Data.Array" module + , + this package also defines the classes 'IArray' of + immutable arrays and 'MArray' of arrays mutable within appropriate + monads, as well as some instances of these classes. +category: Data Structures +exposed: True +exposed-modules: + Data.Array Data.Array.Base Data.Array.IArray Data.Array.IO + Data.Array.IO.Internals Data.Array.IO.Safe Data.Array.MArray + Data.Array.MArray.Safe Data.Array.ST Data.Array.ST.Safe + Data.Array.Storable Data.Array.Storable.Internals + Data.Array.Storable.Safe Data.Array.Unboxed Data.Array.Unsafe +hs-libraries: HSarray-0.5.3.0 +depends: + base-4.12.0.0 +--- +name: base +version: 4.12.0.0 +id: base-4.12.0.0 +key: base-4.12.0.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Basic libraries +description: + This package contains the Standard Haskell "Prelude" and its support libraries, + and a large collection of useful libraries ranging from data + structures to parsing combinators and debugging utilities. +category: Prelude +exposed: True +exposed-modules: + Control.Applicative Control.Arrow Control.Category + Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar + Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception + Control.Exception.Base Control.Monad Control.Monad.Fail + Control.Monad.Fix Control.Monad.IO.Class Control.Monad.Instances + Control.Monad.ST Control.Monad.ST.Lazy Control.Monad.ST.Lazy.Safe + Control.Monad.ST.Lazy.Unsafe Control.Monad.ST.Safe + Control.Monad.ST.Strict Control.Monad.ST.Unsafe Control.Monad.Zip + Data.Bifoldable Data.Bifunctor Data.Bitraversable Data.Bits + Data.Bool Data.Char Data.Coerce Data.Complex Data.Data Data.Dynamic + Data.Either Data.Eq Data.Fixed Data.Foldable Data.Function + Data.Functor Data.Functor.Classes Data.Functor.Compose + Data.Functor.Const Data.Functor.Contravariant Data.Functor.Identity + Data.Functor.Product Data.Functor.Sum Data.IORef Data.Int Data.Ix + Data.Kind Data.List Data.List.NonEmpty Data.Maybe Data.Monoid + Data.Ord Data.Proxy Data.Ratio Data.STRef Data.STRef.Lazy + Data.STRef.Strict Data.Semigroup Data.String Data.Traversable + Data.Tuple Data.Type.Bool Data.Type.Coercion Data.Type.Equality + Data.Typeable Data.Unique Data.Version Data.Void Data.Word + Debug.Trace Foreign Foreign.C Foreign.C.Error Foreign.C.String + Foreign.C.Types Foreign.Concurrent Foreign.ForeignPtr + Foreign.ForeignPtr.Safe Foreign.ForeignPtr.Unsafe Foreign.Marshal + Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error + Foreign.Marshal.Pool Foreign.Marshal.Safe Foreign.Marshal.Unsafe + Foreign.Marshal.Utils Foreign.Ptr Foreign.Safe Foreign.StablePtr + Foreign.Storable GHC.Arr GHC.Base GHC.ByteOrder GHC.Char GHC.Clock + GHC.Conc GHC.Conc.IO GHC.Conc.Signal GHC.Conc.Sync + GHC.ConsoleHandler GHC.Constants GHC.Desugar GHC.Enum + GHC.Environment GHC.Err GHC.Event GHC.Exception GHC.Exception.Type + GHC.ExecutionStack GHC.ExecutionStack.Internal GHC.Exts + GHC.Fingerprint GHC.Fingerprint.Type GHC.Float + GHC.Float.ConversionUtils GHC.Float.RealFracMethods GHC.Foreign + GHC.ForeignPtr GHC.GHCi GHC.Generics GHC.IO GHC.IO.Buffer + GHC.IO.BufferedIO GHC.IO.Device GHC.IO.Encoding + GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure + GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types + GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 + GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD + GHC.IO.Handle.Internals GHC.IO.Handle.Lock GHC.IO.Handle.Text + GHC.IO.Handle.Types GHC.IO.IOMode GHC.IO.Unsafe GHC.IOArray + GHC.IORef GHC.Int GHC.List GHC.MVar GHC.Maybe GHC.Natural GHC.Num + GHC.OldList GHC.OverloadedLabels GHC.Pack GHC.Profiling GHC.Ptr + GHC.RTS.Flags GHC.Read GHC.Real GHC.Records GHC.ResponseFile GHC.ST + GHC.STRef GHC.Show GHC.Stable GHC.StableName GHC.Stack + GHC.Stack.CCS GHC.Stack.Types GHC.StaticPtr GHC.Stats GHC.Storable + GHC.TopHandler GHC.TypeLits GHC.TypeNats GHC.Unicode GHC.Weak + GHC.Word Numeric Numeric.Natural Prelude System.CPUTime + System.Console.GetOpt System.Environment System.Environment.Blank + System.Exit System.IO System.IO.Error System.IO.Unsafe System.Info + System.Mem System.Mem.StableName System.Mem.Weak + System.Posix.Internals System.Posix.Types System.Timeout + Text.ParserCombinators.ReadP Text.ParserCombinators.ReadPrec + Text.Printf Text.Read Text.Read.Lex Text.Show Text.Show.Functions + Type.Reflection Type.Reflection.Unsafe Unsafe.Coerce +hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp + Data.Functor.Utils Data.OldList Data.Semigroup.Internal + Data.Typeable.Internal Foreign.ForeignPtr.Imp + GHC.StaticPtr.Internal System.Environment.ExecutablePath + System.CPUTime.Utils GHC.Event.Arr GHC.Event.Array + GHC.Event.Control GHC.Event.EPoll GHC.Event.IntTable + GHC.Event.Internal GHC.Event.KQueue GHC.Event.Manager GHC.Event.PSQ + GHC.Event.Poll GHC.Event.Thread GHC.Event.TimerManager + GHC.Event.Unique System.CPUTime.Posix.ClockGetTime + System.CPUTime.Posix.Times System.CPUTime.Posix.RUsage + System.CPUTime.Unsupported +hs-libraries: HSbase-4.12.0.0 +includes: + HsBase.h +depends: + ghc-prim-0.5.3 integer-gmp-1.0.2.0 rts +--- +name: binary +version: 0.8.6.0 +id: binary-0.8.6.0 +key: binary-0.8.6.0 +license: BSD-3-Clause +maintainer: Lennart Kolmodin, Don Stewart +author: Lennart Kolmodin +stability: provisional +homepage: https://github.com/kolmodin/binary +synopsis: Binary serialisation for Haskell values using lazy ByteStrings +description: + Efficient, pure binary serialisation using lazy ByteStrings. + Haskell values may be encoded to and from binary formats, + written to disk as binary, or sent over the network. + The format used can be automatically generated, or + you can choose to implement a custom format if needed. + Serialisation speeds of over 1 G\/sec have been observed, + so this library should be suitable for high performance + scenarios. +category: Data, Parsing +exposed: True +exposed-modules: + Data.Binary Data.Binary.Builder Data.Binary.Get + Data.Binary.Get.Internal Data.Binary.Put +hidden-modules: Data.Binary.Class Data.Binary.Internal + Data.Binary.Generic Data.Binary.FloatCast +hs-libraries: HSbinary-0.8.6.0 +depends: + array-0.5.3.0 base-4.12.0.0 bytestring-0.10.8.2 containers-0.6.0.1 +--- +name: bytestring +version: 0.10.8.2 +id: bytestring-0.10.8.2 +key: bytestring-0.10.8.2 +license: BSD-3-Clause +copyright: Copyright (c) Don Stewart 2005-2009, + (c) Duncan Coutts 2006-2015, + (c) David Roundy 2003-2005, + (c) Jasper Van der Jeugt 2010, + (c) Simon Meier 2010-2013. +maintainer: Duncan Coutts +author: Don Stewart, + Duncan Coutts +homepage: https://github.com/haskell/bytestring +synopsis: Fast, compact, strict and lazy byte strings with a list interface +description: + An efficient compact, immutable byte string type (both strict and lazy) + suitable for binary or 8-bit character data. + . + The 'ByteString' type represents sequences of bytes or 8-bit characters. + It is suitable for high performance use, both in terms of large data + quantities, or high speed requirements. The 'ByteString' functions follow + the same style as Haskell\'s ordinary lists, so it is easy to convert code + from using 'String' to 'ByteString'. + . + Two 'ByteString' variants are provided: + . + * Strict 'ByteString's keep the string as a single large array. This + makes them convenient for passing data between C and Haskell. + . + * Lazy 'ByteString's use a lazy list of strict chunks which makes it + suitable for I\/O streaming tasks. + . + The @Char8@ modules provide a character-based view of the same + underlying 'ByteString' types. This makes it convenient to handle mixed + binary and 8-bit character content (which is common in many file formats + and network protocols). + . + The 'Builder' module provides an efficient way to build up 'ByteString's + in an ad-hoc way by repeated concatenation. This is ideal for fast + serialisation or pretty printing. + . + There is also a 'ShortByteString' type which has a lower memory overhead + and can can be converted to or from a 'ByteString', but supports very few + other operations. It is suitable for keeping many short strings in memory. + . + 'ByteString's are not designed for Unicode. For Unicode strings you should + use the 'Text' type from the @text@ package. + . + These modules are intended to be imported qualified, to avoid name clashes + with "Prelude" functions, e.g. + . + > import qualified Data.ByteString as BS +category: Data +exposed: True +exposed-modules: + Data.ByteString Data.ByteString.Builder + Data.ByteString.Builder.Extra Data.ByteString.Builder.Internal + Data.ByteString.Builder.Prim Data.ByteString.Builder.Prim.Internal + Data.ByteString.Char8 Data.ByteString.Internal Data.ByteString.Lazy + Data.ByteString.Lazy.Builder Data.ByteString.Lazy.Builder.ASCII + Data.ByteString.Lazy.Builder.Extras Data.ByteString.Lazy.Char8 + Data.ByteString.Lazy.Internal Data.ByteString.Short + Data.ByteString.Short.Internal Data.ByteString.Unsafe +hidden-modules: Data.ByteString.Builder.ASCII + Data.ByteString.Builder.Prim.Binary + Data.ByteString.Builder.Prim.ASCII + Data.ByteString.Builder.Prim.Internal.Floating + Data.ByteString.Builder.Prim.Internal.UncheckedShifts + Data.ByteString.Builder.Prim.Internal.Base16 +hs-libraries: HSbytestring-0.10.8.2 +includes: + fpstring.h +depends: + base-4.12.0.0 deepseq-1.4.4.0 ghc-prim-0.5.3 integer-gmp-1.0.2.0 +--- +name: containers +version: 0.6.0.1 +id: containers-0.6.0.1 +key: containers-0.6.0.1 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Assorted concrete container types +description: + . + This package contains efficient general-purpose implementations + of various immutable container types including sets, maps, sequences, + trees, and graphs. + . + For a walkthrough of what this package provides with examples of common + operations see the [containers + introduction](https://haskell-containers.readthedocs.io). + . + The declared cost of each operation is either worst-case or amortized, but + remains valid even if structures are shared. +category: Data Structures +exposed: True +exposed-modules: + Data.Containers.ListUtils Data.Graph Data.IntMap + Data.IntMap.Internal Data.IntMap.Internal.Debug Data.IntMap.Lazy + Data.IntMap.Merge.Lazy Data.IntMap.Merge.Strict Data.IntMap.Strict + Data.IntSet Data.IntSet.Internal Data.Map Data.Map.Internal + Data.Map.Internal.Debug Data.Map.Lazy Data.Map.Merge.Lazy + Data.Map.Merge.Strict Data.Map.Strict Data.Map.Strict.Internal + Data.Sequence Data.Sequence.Internal Data.Sequence.Internal.Sorting + Data.Set Data.Set.Internal Data.Tree + Utils.Containers.Internal.BitQueue + Utils.Containers.Internal.BitUtil + Utils.Containers.Internal.StrictPair +hidden-modules: Utils.Containers.Internal.State + Utils.Containers.Internal.StrictMaybe + Utils.Containers.Internal.PtrEquality + Utils.Containers.Internal.Coercions + Utils.Containers.Internal.TypeError + Data.Map.Internal.DeprecatedShowTree + Data.IntMap.Internal.DeprecatedDebug +hs-libraries: HScontainers-0.6.0.1 +depends: + array-0.5.3.0 base-4.12.0.0 deepseq-1.4.4.0 ghc-prim-0.5.3 +--- +name: deepseq +version: 1.4.4.0 +id: deepseq-1.4.4.0 +key: deepseq-1.4.4.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Deep evaluation of data structures +description: + This package provides methods for fully evaluating data structures + (\"deep evaluation\"). Deep evaluation is often used for adding + strictness to a program, e.g. in order to force pending exceptions, + remove space leaks, or force lazy I/O to happen. It is also useful + in parallel programs, to ensure pending work does not migrate to the + wrong thread. + . + The primary use of this package is via the 'deepseq' function, a + \"deep\" version of 'seq'. It is implemented on top of an 'NFData' + typeclass (\"Normal Form Data\", data structures with no unevaluated + components) which defines strategies for fully evaluating different + data types. See module documentation in "Control.DeepSeq" for more + details. +category: Control +exposed: True +exposed-modules: + Control.DeepSeq +hidden-modules: Control.DeepSeq.BackDoor +hs-libraries: HSdeepseq-1.4.4.0 +depends: + array-0.5.3.0 base-4.12.0.0 +--- +name: directory +version: 1.3.3.0 +id: directory-1.3.3.0 +key: directory-1.3.3.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Platform-agnostic library for filesystem operations +description: + This library provides a basic set of operations for manipulating files and + directories in a portable way. +category: System +exposed: True +exposed-modules: + System.Directory System.Directory.Internal + System.Directory.Internal.Prelude +hidden-modules: System.Directory.Internal.C_utimensat + System.Directory.Internal.Common System.Directory.Internal.Config + System.Directory.Internal.Posix System.Directory.Internal.Windows +hs-libraries: HSdirectory-1.3.3.0 +depends: + base-4.12.0.0 filepath-1.4.2.1 time-1.8.0.2 unix-2.7.2.2 +--- +name: filepath +version: 1.4.2.1 +id: filepath-1.4.2.1 +key: filepath-1.4.2.1 +license: BSD-3-Clause +copyright: Neil Mitchell 2005-2018 +maintainer: Neil Mitchell +author: Neil Mitchell +homepage: https://github.com/haskell/filepath#readme +synopsis: Library for manipulating FilePaths in a cross platform way. +description: + This package provides functionality for manipulating @FilePath@ values, and is shipped with both and the . It provides three modules: + . + * "System.FilePath.Posix" manipulates POSIX\/Linux style @FilePath@ values (with @\/@ as the path separator). + . + * "System.FilePath.Windows" manipulates Windows style @FilePath@ values (with either @\\@ or @\/@ as the path separator, and deals with drives). + . + * "System.FilePath" is an alias for the module appropriate to your platform. + . + All three modules provide the same API, and the same documentation (calling out differences in the different variants). +category: System +exposed: True +exposed-modules: + System.FilePath System.FilePath.Posix System.FilePath.Windows +hs-libraries: HSfilepath-1.4.2.1 +depends: + base-4.12.0.0 +--- +name: ghc-boot +version: 8.6.5 +id: ghc-boot-8.6.5 +key: ghc-boot-8.6.5 +license: BSD-3-Clause +maintainer: ghc-devs@haskell.org +synopsis: Shared functionality between GHC and its boot libraries +description: + This library is shared between GHC, ghc-pkg, and other boot + libraries. + . + A note about "GHC.PackageDb": it only deals with the subset of + the package database that the compiler cares about: modules + paths etc and not package metadata like description, authors + etc. It is thus not a library interface to ghc-pkg and is *not* + suitable for modifying GHC package databases. + . + The package database format and this library are constructed in + such a way that while ghc-pkg depends on Cabal, the GHC library + and program do not have to depend on Cabal. +category: GHC +exposed: True +exposed-modules: + GHC.ForeignSrcLang GHC.HandleEncoding GHC.LanguageExtensions + GHC.PackageDb GHC.Serialized +hs-libraries: HSghc-boot-8.6.5 +depends: + base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 directory-1.3.3.0 + filepath-1.4.2.1 ghc-boot-th-8.6.5 +--- +name: ghc-boot-th +version: 8.6.5 +id: ghc-boot-th-8.6.5 +key: ghc-boot-th-8.6.5 +license: BSD-3-Clause +maintainer: ghc-devs@haskell.org +synopsis: Shared functionality between GHC and the @template-haskell@ + library +description: + This library contains various bits shared between the @ghc@ and + @template-haskell@ libraries. + . + This package exists to ensure that @template-haskell@ has a + minimal set of transitive dependencies, since it is intended to + be depended upon by user code. +category: GHC +exposed: True +exposed-modules: + GHC.ForeignSrcLang.Type GHC.LanguageExtensions.Type GHC.Lexeme +hs-libraries: HSghc-boot-th-8.6.5 +depends: + base-4.12.0.0 +--- +name: ghc-compact +version: 0.1.0.0 +id: ghc-compact-0.1.0.0 +key: ghc-compact-0.1.0.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: In memory storage of deeply evaluated data structure +description: + This package provides minimal functionality for working with + "compact regions", which hold a fully evaluated Haskell object graph. + These regions maintain the invariant that no pointers live inside the struct + that point outside it, which ensures efficient garbage collection without + ever reading the structure contents (effectively, it works as a manually + managed "oldest generation" which is never freed until the whole is + released). + Internally, the struct is stored a single contiguous block of memory, + which allows efficient serialization and deserialization of structs + for distributed computing. +category: Data +exposed: True +exposed-modules: + GHC.Compact GHC.Compact.Serialized +hs-libraries: HSghc-compact-0.1.0.0 +depends: + base-4.12.0.0 bytestring-0.10.8.2 ghc-prim-0.5.3 +--- +name: ghc-heap +version: 8.6.5 +id: ghc-heap-8.6.5 +key: ghc-heap-8.6.5 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Functions for walking GHC's heap +description: + This package provides functions for walking the GHC heap data structures + and retrieving information about those data structures. +category: GHC +exposed: True +exposed-modules: + GHC.Exts.Heap GHC.Exts.Heap.ClosureTypes GHC.Exts.Heap.Closures + GHC.Exts.Heap.Constants GHC.Exts.Heap.InfoTable + GHC.Exts.Heap.InfoTable.Types GHC.Exts.Heap.InfoTableProf + GHC.Exts.Heap.Utils +hs-libraries: HSghc-heap-8.6.5 +depends: + base-4.12.0.0 ghc-prim-0.5.3 rts +--- +name: ghc-prim +version: 0.5.3 +id: ghc-prim-0.5.3 +key: ghc-prim-0.5.3 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: GHC primitives +description: + This package contains the primitive types and operations supplied by GHC. +category: GHC +exposed: True +exposed-modules: + GHC.CString GHC.Classes GHC.Debug GHC.IntWord64 GHC.Magic + GHC.PrimopWrappers GHC.Tuple GHC.Types GHC.Prim +hs-libraries: HSghc-prim-0.5.3 +extra-libraries: + c m +depends: + rts +--- +name: ghci +version: 8.6.5 +id: ghci-8.6.5 +key: ghci-8.6.5 +license: BSD-3-Clause +maintainer: ghc-devs@haskell.org +synopsis: The library supporting GHC's interactive interpreter +description: + This library offers interfaces which mediate interactions between the + @ghci@ interactive shell and @iserv@, GHC's out-of-process interpreter + backend. +category: GHC +exposed: True +exposed-modules: + GHCi.BinaryArray GHCi.BreakArray GHCi.CreateBCO GHCi.FFI + GHCi.InfoTable GHCi.Message GHCi.ObjLink GHCi.RemoteTypes + GHCi.ResolvedBCO GHCi.Run GHCi.Signals GHCi.StaticPtrTable GHCi.TH + GHCi.TH.Binary SizedSeq +hs-libraries: HSghci-8.6.5 +depends: + array-0.5.3.0 base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 + containers-0.6.0.1 deepseq-1.4.4.0 filepath-1.4.2.1 ghc-boot-8.6.5 + ghc-boot-th-8.6.5 ghc-heap-8.6.5 template-haskell-2.14.0.0 + transformers-0.5.6.2 unix-2.7.2.2 +--- +name: haskeline +version: 0.7.4.3 +id: haskeline-0.7.4.3 +key: haskeline-0.7.4.3 +license: BSD-3-Clause +copyright: (c) Judah Jacobson +maintainer: Judah Jacobson +author: Judah Jacobson +stability: Stable +homepage: https://github.com/judah/haskeline +synopsis: A command-line interface for user input, written in Haskell. +description: + Haskeline provides a user interface for line input in command-line + programs. This library is similar in purpose to readline, but since + it is written in Haskell it is (hopefully) more easily used in other + Haskell programs. + . + Haskeline runs both on POSIX-compatible systems and on Windows. +category: User Interfaces +exposed: True +exposed-modules: + System.Console.Haskeline System.Console.Haskeline.Completion + System.Console.Haskeline.History System.Console.Haskeline.IO + System.Console.Haskeline.MonadException +hidden-modules: System.Console.Haskeline.Backend + System.Console.Haskeline.Backend.WCWidth + System.Console.Haskeline.Command + System.Console.Haskeline.Command.Completion + System.Console.Haskeline.Command.History + System.Console.Haskeline.Command.KillRing + System.Console.Haskeline.Directory System.Console.Haskeline.Emacs + System.Console.Haskeline.InputT System.Console.Haskeline.Key + System.Console.Haskeline.LineState System.Console.Haskeline.Monads + System.Console.Haskeline.Prefs System.Console.Haskeline.Recover + System.Console.Haskeline.RunCommand System.Console.Haskeline.Term + System.Console.Haskeline.Command.Undo System.Console.Haskeline.Vi + System.Console.Haskeline.Backend.Posix + System.Console.Haskeline.Backend.Posix.Encoder + System.Console.Haskeline.Backend.DumbTerm +hs-libraries: HShaskeline-0.7.4.3 +depends: + base-4.12.0.0 bytestring-0.10.8.2 containers-0.6.0.1 + directory-1.3.3.0 filepath-1.4.2.1 process-1.6.5.0 stm-2.5.0.0 + transformers-0.5.6.2 unix-2.7.2.2 +--- +name: hpc +version: 0.6.0.3 +id: hpc-0.6.0.3 +key: hpc-0.6.0.3 +license: BSD-3-Clause +maintainer: ghc-devs@haskell.org +author: Andy Gill +synopsis: Code Coverage Library for Haskell +description: + This package provides the code coverage library for Haskell. + . + See for more + information. +category: Control +exposed: True +exposed-modules: + Trace.Hpc.Mix Trace.Hpc.Reflect Trace.Hpc.Tix Trace.Hpc.Util +hs-libraries: HShpc-0.6.0.3 +depends: + base-4.12.0.0 containers-0.6.0.1 directory-1.3.3.0 filepath-1.4.2.1 + time-1.8.0.2 +--- +name: integer-gmp +version: 1.0.2.0 +id: integer-gmp-1.0.2.0 +key: integer-gmp-1.0.2.0 +license: BSD-3-Clause +maintainer: hvr@gnu.org +author: Herbert Valerio Riedel +synopsis: Integer library based on GMP +description: + This package provides the low-level implementation of the standard + 'Integer' type based on the + . + . + This package provides access to the internal representation of + 'Integer' as well as primitive operations with no proper error + handling, and should only be used directly with the utmost care. +category: Numeric, Algebra +exposed: True +exposed-modules: + GHC.Integer GHC.Integer.GMP.Internals GHC.Integer.Logarithms + GHC.Integer.Logarithms.Internals +hidden-modules: GHC.Integer.Type +hs-libraries: HSinteger-gmp-1.0.2.0 +extra-libraries: + gmp +depends: + ghc-prim-0.5.3 +--- +name: libiserv +version: 8.6.5 +id: libiserv-8.6.5 +key: libiserv-8.6.5 +license: BSD-3-Clause +copyright: XXX +maintainer: XXX +author: XXX +synopsis: Provides shared functionality between iserv and iserv-proxy +category: Development +exposed: True +exposed-modules: + GHCi.Utils Lib +hs-libraries: HSlibiserv-8.6.5 +depends: + base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 containers-0.6.0.1 + deepseq-1.4.4.0 ghci-8.6.5 unix-2.7.2.2 +--- +name: mtl +version: 2.2.2 +id: mtl-2.2.2 +key: mtl-2.2.2 +license: BSD-3-Clause +maintainer: Edward Kmett +author: Andy Gill +homepage: http://github.com/haskell/mtl +synopsis: Monad classes, using functional dependencies +description: + Monad classes using functional dependencies, with instances + for various monad transformers, inspired by the paper + /Functional Programming with Overloading and Higher-Order Polymorphism/, + by Mark P Jones, in /Advanced School of Functional Programming/, 1995 + (). +category: Control +exposed: True +exposed-modules: + Control.Monad.Cont Control.Monad.Cont.Class Control.Monad.Error + Control.Monad.Error.Class Control.Monad.Except + Control.Monad.Identity Control.Monad.List Control.Monad.RWS + Control.Monad.RWS.Class Control.Monad.RWS.Lazy + Control.Monad.RWS.Strict Control.Monad.Reader + Control.Monad.Reader.Class Control.Monad.State + Control.Monad.State.Class Control.Monad.State.Lazy + Control.Monad.State.Strict Control.Monad.Trans Control.Monad.Writer + Control.Monad.Writer.Class Control.Monad.Writer.Lazy + Control.Monad.Writer.Strict +hs-libraries: HSmtl-2.2.2 +depends: + base-4.12.0.0 transformers-0.5.6.2 +--- +name: parsec +version: 3.1.13.0 +id: parsec-3.1.13.0 +key: parsec-3.1.13.0 +license: BSD-3-Clause +maintainer: Herbert Valerio Riedel +author: Daan Leijen , Paolo Martini , Antoine Latter +homepage: https://github.com/haskell/parsec +synopsis: Monadic parser combinators +description: + Parsec is designed from scratch as an industrial-strength parser + library. It is simple, safe, well documented (on the package + homepage), has extensive libraries, good error messages, + and is fast. It is defined as a monad transformer that can be + stacked on arbitrary monads, and it is also parametric in the + input stream type. + . + The main entry point is the "Text.Parsec" module which provides + defaults for parsing 'Char'acter data. + . + The "Text.ParserCombinators.Parsec" module hierarchy contains + the legacy @parsec-2@ API and may be removed at some point in + the future. +category: Parsing +exposed: True +exposed-modules: + Text.Parsec Text.Parsec.ByteString Text.Parsec.ByteString.Lazy + Text.Parsec.Char Text.Parsec.Combinator Text.Parsec.Error + Text.Parsec.Expr Text.Parsec.Language Text.Parsec.Perm + Text.Parsec.Pos Text.Parsec.Prim Text.Parsec.String + Text.Parsec.Text Text.Parsec.Text.Lazy Text.Parsec.Token + Text.ParserCombinators.Parsec Text.ParserCombinators.Parsec.Char + Text.ParserCombinators.Parsec.Combinator + Text.ParserCombinators.Parsec.Error + Text.ParserCombinators.Parsec.Expr + Text.ParserCombinators.Parsec.Language + Text.ParserCombinators.Parsec.Perm + Text.ParserCombinators.Parsec.Pos + Text.ParserCombinators.Parsec.Prim + Text.ParserCombinators.Parsec.Token +hs-libraries: HSparsec-3.1.13.0 +depends: + base-4.12.0.0 bytestring-0.10.8.2 mtl-2.2.2 text-1.2.3.1 +--- +name: pretty +version: 1.1.3.6 +id: pretty-1.1.3.6 +key: pretty-1.1.3.6 +license: BSD-3-Clause +maintainer: David Terei +stability: Stable +homepage: http://github.com/haskell/pretty +synopsis: Pretty-printing library +description: + This package contains a pretty-printing library, a set of API's + that provides a way to easily print out text in a consistent + format of your choosing. This is useful for compilers and related + tools. + . + This library was originally designed by John Hughes's and has since + been heavily modified by Simon Peyton Jones. +category: Text +exposed: True +exposed-modules: + Text.PrettyPrint Text.PrettyPrint.Annotated + Text.PrettyPrint.Annotated.HughesPJ + Text.PrettyPrint.Annotated.HughesPJClass Text.PrettyPrint.HughesPJ + Text.PrettyPrint.HughesPJClass +hs-libraries: HSpretty-1.1.3.6 +depends: + base-4.12.0.0 deepseq-1.4.4.0 ghc-prim-0.5.3 +--- +name: process +version: 1.6.5.0 +id: process-1.6.5.0 +key: process-1.6.5.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Process libraries +description: + This package contains libraries for dealing with system processes. + . + The typed-process package is a more recent take on a process API, + which uses this package internally. It features better binary + support, easier concurrency, and a more composable API. You can + read more about it at + . +category: System +exposed: True +exposed-modules: + System.Cmd System.Process System.Process.Internals +hidden-modules: System.Process.Common System.Process.Posix +hs-libraries: HSprocess-1.6.5.0 +includes: + runProcess.h +depends: + base-4.12.0.0 deepseq-1.4.4.0 directory-1.3.3.0 filepath-1.4.2.1 + unix-2.7.2.2 +--- +name: rts +version: 1.0 +id: rts +key: rts +license: BSD-3-Clause +maintainer: glasgow-haskell-users@haskell.org +exposed: True +hs-libraries: HSrts +extra-libraries: + m rt dl ffi +includes: + Stg.h +ld-options: "-Wl,-u,base_GHCziTopHandler_runIO_closure" + "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" + "-Wl,-u,ghczmprim_GHCziTuple_Z0T_closure" + "-Wl,-u,ghczmprim_GHCziTypes_True_closure" + "-Wl,-u,ghczmprim_GHCziTypes_False_closure" + "-Wl,-u,base_GHCziPack_unpackCString_closure" + "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" + "-Wl,-u,base_GHCziIOziException_stackOverflow_closure" + "-Wl,-u,base_GHCziIOziException_heapOverflow_closure" + "-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" + "-Wl,-u,base_GHCziIOziException_cannotCompactFunction_closure" + "-Wl,-u,base_GHCziIOziException_cannotCompactPinned_closure" + "-Wl,-u,base_GHCziIOziException_cannotCompactMutable_closure" + "-Wl,-u,base_ControlziExceptionziBase_absentSumFieldError_closure" + "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" + "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" + "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure" + "-Wl,-u,base_GHCziConcziSync_runSparks_closure" + "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" + "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" + "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure" + "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" + "-Wl,-u,base_GHCziTopHandler_runMainIO_closure" + "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Wzh_con_info" + "-Wl,-u,base_GHCziPtr_Ptr_con_info" + "-Wl,-u,base_GHCziPtr_FunPtr_con_info" + "-Wl,-u,base_GHCziInt_I8zh_con_info" + "-Wl,-u,base_GHCziInt_I16zh_con_info" + "-Wl,-u,base_GHCziInt_I32zh_con_info" + "-Wl,-u,base_GHCziInt_I64zh_con_info" + "-Wl,-u,base_GHCziWord_W8zh_con_info" + "-Wl,-u,base_GHCziWord_W16zh_con_info" + "-Wl,-u,base_GHCziWord_W32zh_con_info" + "-Wl,-u,base_GHCziWord_W64zh_con_info" + "-Wl,-u,base_GHCziStable_StablePtr_con_info" + "-Wl,-u,hs_atomic_add8" "-Wl,-u,hs_atomic_add16" + "-Wl,-u,hs_atomic_add32" "-Wl,-u,hs_atomic_sub8" + "-Wl,-u,hs_atomic_sub16" "-Wl,-u,hs_atomic_sub32" + "-Wl,-u,hs_atomic_and8" "-Wl,-u,hs_atomic_and16" + "-Wl,-u,hs_atomic_and32" "-Wl,-u,hs_atomic_nand8" + "-Wl,-u,hs_atomic_nand16" "-Wl,-u,hs_atomic_nand32" + "-Wl,-u,hs_atomic_or8" "-Wl,-u,hs_atomic_or16" + "-Wl,-u,hs_atomic_or32" "-Wl,-u,hs_atomic_xor8" + "-Wl,-u,hs_atomic_xor16" "-Wl,-u,hs_atomic_xor32" + "-Wl,-u,hs_cmpxchg8" "-Wl,-u,hs_cmpxchg16" "-Wl,-u,hs_cmpxchg32" + "-Wl,-u,hs_atomicread8" "-Wl,-u,hs_atomicread16" + "-Wl,-u,hs_atomicread32" "-Wl,-u,hs_atomicwrite8" + "-Wl,-u,hs_atomicwrite16" "-Wl,-u,hs_atomicwrite32" +--- +name: stm +version: 2.5.0.0 +id: stm-2.5.0.0 +key: stm-2.5.0.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +homepage: https://wiki.haskell.org/Software_transactional_memory +synopsis: Software Transactional Memory +description: + Software Transactional Memory, or STM, is an abstraction for + concurrent communication. The main benefits of STM are + /composability/ and /modularity/. That is, using STM you can write + concurrent abstractions that can be easily composed with any other + abstraction built using STM, without exposing the details of how + your abstraction ensures safety. This is typically not the case + with other forms of concurrent communication, such as locks or + 'MVar's. +category: Concurrency +exposed: True +exposed-modules: + Control.Concurrent.STM Control.Concurrent.STM.TArray + Control.Concurrent.STM.TBQueue Control.Concurrent.STM.TChan + Control.Concurrent.STM.TMVar Control.Concurrent.STM.TQueue + Control.Concurrent.STM.TSem Control.Concurrent.STM.TVar + Control.Monad.STM +hidden-modules: Control.Sequential.STM +hs-libraries: HSstm-2.5.0.0 +depends: + array-0.5.3.0 base-4.12.0.0 +--- +name: template-haskell +version: 2.14.0.0 +id: template-haskell-2.14.0.0 +key: template-haskell-2.14.0.0 +license: BSD-3-Clause +maintainer: libraries@haskell.org +synopsis: Support library for Template Haskell +description: + This package provides modules containing facilities for manipulating + Haskell source code using Template Haskell. + . + See for more + information. +category: Template Haskell +exposed: True +exposed-modules: + Language.Haskell.TH Language.Haskell.TH.LanguageExtensions + Language.Haskell.TH.Lib Language.Haskell.TH.Lib.Internal + Language.Haskell.TH.Ppr Language.Haskell.TH.PprLib + Language.Haskell.TH.Quote Language.Haskell.TH.Syntax +hidden-modules: Language.Haskell.TH.Lib.Map +hs-libraries: HStemplate-haskell-2.14.0.0 +depends: + base-4.12.0.0 ghc-boot-th-8.6.5 pretty-1.1.3.6 +--- +name: text +version: 1.2.3.1 +id: text-1.2.3.1 +key: text-1.2.3.1 +license: BSD-2-Clause +copyright: 2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper +maintainer: Bryan O'Sullivan , Herbert Valerio Riedel +author: Bryan O'Sullivan +homepage: https://github.com/haskell/text +synopsis: An efficient packed Unicode text type. +description: + . + An efficient packed, immutable Unicode text type (both strict and + lazy), with a powerful loop fusion optimization framework. + . + The 'Text' type represents Unicode character strings, in a time and + space-efficient manner. This package provides text processing + capabilities that are optimized for performance critical use, both + in terms of large data quantities and high speed. + . + The 'Text' type provides character-encoding, type-safe case + conversion via whole-string case conversion functions (see "Data.Text"). + It also provides a range of functions for converting 'Text' values to + and from 'ByteStrings', using several standard encodings + (see "Data.Text.Encoding"). + . + Efficient locale-sensitive support for text IO is also supported + (see "Data.Text.IO"). + . + These modules are intended to be imported qualified, to avoid name + clashes with Prelude functions, e.g. + . + > import qualified Data.Text as T + . + To use an extended and very rich family of functions for working + with Unicode text (including normalization, regular expressions, + non-standard encodings, text breaking, and locales), see + the [text-icu package](https://hackage.haskell.org/package/text-icu) + based on the well-respected and liberally + licensed [ICU library](http://site.icu-project.org/). +category: Data, Text +exposed: True +exposed-modules: + Data.Text Data.Text.Array Data.Text.Encoding + Data.Text.Encoding.Error Data.Text.Foreign Data.Text.IO + Data.Text.Internal Data.Text.Internal.Builder + Data.Text.Internal.Builder.Functions + Data.Text.Internal.Builder.Int.Digits + Data.Text.Internal.Builder.RealFloat.Functions + Data.Text.Internal.Encoding.Fusion + Data.Text.Internal.Encoding.Fusion.Common + Data.Text.Internal.Encoding.Utf16 Data.Text.Internal.Encoding.Utf32 + Data.Text.Internal.Encoding.Utf8 Data.Text.Internal.Functions + Data.Text.Internal.Fusion Data.Text.Internal.Fusion.CaseMapping + Data.Text.Internal.Fusion.Common Data.Text.Internal.Fusion.Size + Data.Text.Internal.Fusion.Types Data.Text.Internal.IO + Data.Text.Internal.Lazy Data.Text.Internal.Lazy.Encoding.Fusion + Data.Text.Internal.Lazy.Fusion Data.Text.Internal.Lazy.Search + Data.Text.Internal.Private Data.Text.Internal.Read + Data.Text.Internal.Search Data.Text.Internal.Unsafe + Data.Text.Internal.Unsafe.Char Data.Text.Internal.Unsafe.Shift + Data.Text.Lazy Data.Text.Lazy.Builder Data.Text.Lazy.Builder.Int + Data.Text.Lazy.Builder.RealFloat Data.Text.Lazy.Encoding + Data.Text.Lazy.IO Data.Text.Lazy.Internal Data.Text.Lazy.Read + Data.Text.Read Data.Text.Unsafe +hidden-modules: Data.Text.Show +hs-libraries: HStext-1.2.3.1 +depends: + array-0.5.3.0 base-4.12.0.0 binary-0.8.6.0 bytestring-0.10.8.2 + deepseq-1.4.4.0 ghc-prim-0.5.3 integer-gmp-1.0.2.0 +--- +name: time +version: 1.8.0.2 +id: time-1.8.0.2 +key: time-1.8.0.2 +license: BSD-3-Clause +maintainer: +author: Ashley Yakeley +stability: stable +homepage: https://github.com/haskell/time +synopsis: A time library +description: + A time library +category: Time +exposed: True +exposed-modules: + Data.Time Data.Time.Calendar Data.Time.Calendar.Easter + Data.Time.Calendar.Julian Data.Time.Calendar.MonthDay + Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate + Data.Time.Clock Data.Time.Clock.POSIX Data.Time.Clock.System + Data.Time.Clock.TAI Data.Time.Format Data.Time.LocalTime +hidden-modules: Data.Time.Calendar.Private Data.Time.Calendar.Days + Data.Time.Calendar.Gregorian Data.Time.Calendar.JulianYearDay + Data.Time.Clock.Internal.DiffTime + Data.Time.Clock.Internal.AbsoluteTime + Data.Time.Clock.Internal.NominalDiffTime + Data.Time.Clock.Internal.POSIXTime + Data.Time.Clock.Internal.UniversalTime + Data.Time.Clock.Internal.SystemTime + Data.Time.Clock.Internal.UTCTime Data.Time.Clock.Internal.CTimeval + Data.Time.Clock.Internal.CTimespec Data.Time.Clock.Internal.UTCDiff + Data.Time.LocalTime.Internal.TimeZone + Data.Time.LocalTime.Internal.TimeOfDay + Data.Time.LocalTime.Internal.LocalTime + Data.Time.LocalTime.Internal.ZonedTime Data.Time.Format.Parse + Data.Time.Format.Locale +hs-libraries: HStime-1.8.0.2 +depends: + base-4.12.0.0 deepseq-1.4.4.0 +--- +name: transformers +version: 0.5.6.2 +id: transformers-0.5.6.2 +key: transformers-0.5.6.2 +license: BSD-3-Clause +maintainer: Ross Paterson +author: Andy Gill, Ross Paterson +synopsis: Concrete functor and monad transformers +description: + A portable library of functor and monad transformers, inspired by + the paper + . + * \"Functional Programming with Overloading and Higher-Order + Polymorphism\", by Mark P Jones, + in /Advanced School of Functional Programming/, 1995 + (). + . + This package contains: + . + * the monad transformer class (in "Control.Monad.Trans.Class") + . + * concrete functor and monad transformers, each with associated + operations and functions to lift operations associated with other + transformers. + . + The package can be used on its own in portable Haskell code, in + which case operations need to be manually lifted through transformer + stacks (see "Control.Monad.Trans.Class" for some examples). + Alternatively, it can be used with the non-portable monad classes in + the @mtl@ or @monads-tf@ packages, which automatically lift operations + introduced by monad transformers through other transformers. +category: Control +exposed: True +exposed-modules: + Control.Applicative.Backwards Control.Applicative.Lift + Control.Monad.Signatures Control.Monad.Trans.Accum + Control.Monad.Trans.Class Control.Monad.Trans.Cont + Control.Monad.Trans.Error Control.Monad.Trans.Except + Control.Monad.Trans.Identity Control.Monad.Trans.List + Control.Monad.Trans.Maybe Control.Monad.Trans.RWS + Control.Monad.Trans.RWS.CPS Control.Monad.Trans.RWS.Lazy + Control.Monad.Trans.RWS.Strict Control.Monad.Trans.Reader + Control.Monad.Trans.Select Control.Monad.Trans.State + Control.Monad.Trans.State.Lazy Control.Monad.Trans.State.Strict + Control.Monad.Trans.Writer Control.Monad.Trans.Writer.CPS + Control.Monad.Trans.Writer.Lazy Control.Monad.Trans.Writer.Strict + Data.Functor.Constant Data.Functor.Reverse +hs-libraries: HStransformers-0.5.6.2 +depends: + base-4.12.0.0 +--- +name: unix +version: 2.7.2.2 +id: unix-2.7.2.2 +key: unix-2.7.2.2 +license: BSD-3-Clause +maintainer: libraries@haskell.org +homepage: https://github.com/haskell/unix +synopsis: POSIX functionality +description: + This package gives you access to the set of operating system + services standardised by + + (or the IEEE Portable Operating System Interface for Computing + Environments - IEEE Std. 1003.1). + . + The package is not supported under Windows. +category: System +exposed: True +exposed-modules: + System.Posix System.Posix.ByteString + System.Posix.ByteString.FilePath System.Posix.Directory + System.Posix.Directory.ByteString System.Posix.DynamicLinker + System.Posix.DynamicLinker.ByteString + System.Posix.DynamicLinker.Module + System.Posix.DynamicLinker.Module.ByteString + System.Posix.DynamicLinker.Prim System.Posix.Env + System.Posix.Env.ByteString System.Posix.Error System.Posix.Fcntl + System.Posix.Files System.Posix.Files.ByteString System.Posix.IO + System.Posix.IO.ByteString System.Posix.Process + System.Posix.Process.ByteString System.Posix.Process.Internals + System.Posix.Resource System.Posix.Semaphore System.Posix.SharedMem + System.Posix.Signals System.Posix.Signals.Exts System.Posix.Temp + System.Posix.Temp.ByteString System.Posix.Terminal + System.Posix.Terminal.ByteString System.Posix.Time + System.Posix.Unistd System.Posix.User +hidden-modules: System.Posix.Directory.Common + System.Posix.DynamicLinker.Common System.Posix.Files.Common + System.Posix.IO.Common System.Posix.Process.Common + System.Posix.Terminal.Common +hs-libraries: HSunix-2.7.2.2 +includes: + HsUnix.h execvpe.h +depends: + base-4.12.0.0 bytestring-0.10.8.2 time-1.8.0.2 diff --git a/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc-pkg/version b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc-pkg/version new file mode 100644 index 0000000000..c705360a92 --- /dev/null +++ b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc-pkg/version @@ -0,0 +1 @@ +GHC package manager version 8.6.5 diff --git a/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/info b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/info new file mode 100644 index 0000000000..ef06ebc35e --- /dev/null +++ b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/info @@ -0,0 +1,57 @@ + [("Project name","The Glorious Glasgow Haskell Compilation System") + ,("GCC extra via C opts"," -fwrapv -fno-builtin") + ,("C compiler flags"," -marm -fno-stack-protector") + ,("C compiler link flags","-fuse-ld=gold -Wl,-z,noexecstack") + ,("C compiler supports -no-pie","YES") + ,("Haskell CPP flags","-E -undef -traditional") + ,("ld flags"," -z noexecstack") + ,("ld supports compact unwind","YES") + ,("ld supports build-id","YES") + ,("ld supports filelist","NO") + ,("ld is GNU ld","YES") + ,("ar flags","q") + ,("ar supports at file","YES") + ,("touch command","touch") + ,("dllwrap command","/bin/false") + ,("windres command","/bin/false") + ,("libtool command","libtool") + ,("cross compiling","YES") + ,("target os","OSLinux") + ,("target arch","ArchARM {armISA = ARMv7, armISAExt = [VFPv3,NEON], armABI = HARD}") + ,("target word size","4") + ,("target has GNU nonexec stack","True") + ,("target has .ident directive","True") + ,("target has subsections via symbols","False") + ,("target has RTS linker","YES") + ,("Unregisterised","NO") + ,("LLVM llc command","llc") + ,("LLVM opt command","opt") + ,("LLVM clang command","clang") + ,("Project version","8.6.5") + ,("Project Git commit id","92b6a0237e0195cee4773de4b237951addd659d9") + ,("Booter version","8.4.4") + ,("Stage","1") + ,("Build platform","x86_64-unknown-linux") + ,("Host platform","x86_64-unknown-linux") + ,("Target platform","arm-unknown-linux") + ,("Have interpreter","YES") + ,("Object splitting supported","NO") + ,("Have native code generator","NO") + ,("Support SMP","YES") + ,("Tables next to code","YES") + ,("RTS ways","l debug thr thr_debug thr_l thr_p ") + ,("RTS expects libdw","NO") + ,("Support dynamic-too","YES") + ,("Support parallel --make","YES") + ,("Support reexported-modules","YES") + ,("Support thinning and renaming package flags","YES") + ,("Support Backpack","YES") + ,("Requires unified installed package IDs","YES") + ,("Uses package keys","YES") + ,("Uses unit IDs","YES") + ,("Dynamic by default","NO") + ,("GHC Dynamic","NO") + ,("GHC Profiled","NO") + ,("Leading underscore","NO") + ,("Debug on","False") + ] diff --git a/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/numeric-version b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/numeric-version new file mode 100644 index 0000000000..a479a82190 --- /dev/null +++ b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/numeric-version @@ -0,0 +1 @@ +8.6.5 diff --git a/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/supported-languages b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/supported-languages new file mode 100644 index 0000000000..50a0383159 --- /dev/null +++ b/materialized/dummy-ghc/armv7l-unknown-linux-musleabihf-armv7l-unknown-linux-musleabihf-ghc-8.6.5-x86_64-linux/ghc/supported-languages @@ -0,0 +1,247 @@ +Haskell98 +Haskell2010 +Unsafe +Trustworthy +Safe +AllowAmbiguousTypes +NoAllowAmbiguousTypes +AlternativeLayoutRule +NoAlternativeLayoutRule +AlternativeLayoutRuleTransitional +NoAlternativeLayoutRuleTransitional +Arrows +NoArrows +AutoDeriveTypeable +NoAutoDeriveTypeable +BangPatterns +NoBangPatterns +BinaryLiterals +NoBinaryLiterals +CApiFFI +NoCApiFFI +CPP +NoCPP +ConstrainedClassMethods +NoConstrainedClassMethods +ConstraintKinds +NoConstraintKinds +DataKinds +NoDataKinds +DatatypeContexts +NoDatatypeContexts +DefaultSignatures +NoDefaultSignatures +DeriveAnyClass +NoDeriveAnyClass +DeriveDataTypeable +NoDeriveDataTypeable +DeriveFoldable +NoDeriveFoldable +DeriveFunctor +NoDeriveFunctor +DeriveGeneric +NoDeriveGeneric +DeriveLift +NoDeriveLift +DeriveTraversable +NoDeriveTraversable +DerivingStrategies +NoDerivingStrategies +DerivingVia +NoDerivingVia +DisambiguateRecordFields +NoDisambiguateRecordFields +DoAndIfThenElse +NoDoAndIfThenElse +BlockArguments +NoBlockArguments +DoRec +NoDoRec +DuplicateRecordFields +NoDuplicateRecordFields +EmptyCase +NoEmptyCase +EmptyDataDecls +NoEmptyDataDecls +EmptyDataDeriving +NoEmptyDataDeriving +ExistentialQuantification +NoExistentialQuantification +ExplicitForAll +NoExplicitForAll +ExplicitNamespaces +NoExplicitNamespaces +ExtendedDefaultRules +NoExtendedDefaultRules +FlexibleContexts +NoFlexibleContexts +FlexibleInstances +NoFlexibleInstances +ForeignFunctionInterface +NoForeignFunctionInterface +FunctionalDependencies +NoFunctionalDependencies +GADTSyntax +NoGADTSyntax +GADTs +NoGADTs +GHCForeignImportPrim +NoGHCForeignImportPrim +GeneralizedNewtypeDeriving +NoGeneralizedNewtypeDeriving +GeneralisedNewtypeDeriving +NoGeneralisedNewtypeDeriving +ImplicitParams +NoImplicitParams +ImplicitPrelude +NoImplicitPrelude +ImpredicativeTypes +NoImpredicativeTypes +IncoherentInstances +NoIncoherentInstances +TypeFamilyDependencies +NoTypeFamilyDependencies +InstanceSigs +NoInstanceSigs +ApplicativeDo +NoApplicativeDo +InterruptibleFFI +NoInterruptibleFFI +JavaScriptFFI +NoJavaScriptFFI +KindSignatures +NoKindSignatures +LambdaCase +NoLambdaCase +LiberalTypeSynonyms +NoLiberalTypeSynonyms +MagicHash +NoMagicHash +MonadComprehensions +NoMonadComprehensions +MonadFailDesugaring +NoMonadFailDesugaring +MonoLocalBinds +NoMonoLocalBinds +MonoPatBinds +NoMonoPatBinds +MonomorphismRestriction +NoMonomorphismRestriction +MultiParamTypeClasses +NoMultiParamTypeClasses +MultiWayIf +NoMultiWayIf +NumericUnderscores +NoNumericUnderscores +NPlusKPatterns +NoNPlusKPatterns +NamedFieldPuns +NoNamedFieldPuns +NamedWildCards +NoNamedWildCards +NegativeLiterals +NoNegativeLiterals +HexFloatLiterals +NoHexFloatLiterals +NondecreasingIndentation +NoNondecreasingIndentation +NullaryTypeClasses +NoNullaryTypeClasses +NumDecimals +NoNumDecimals +OverlappingInstances +NoOverlappingInstances +OverloadedLabels +NoOverloadedLabels +OverloadedLists +NoOverloadedLists +OverloadedStrings +NoOverloadedStrings +PackageImports +NoPackageImports +ParallelArrays +NoParallelArrays +ParallelListComp +NoParallelListComp +PartialTypeSignatures +NoPartialTypeSignatures +PatternGuards +NoPatternGuards +PatternSignatures +NoPatternSignatures +PatternSynonyms +NoPatternSynonyms +PolyKinds +NoPolyKinds +PolymorphicComponents +NoPolymorphicComponents +QuantifiedConstraints +NoQuantifiedConstraints +PostfixOperators +NoPostfixOperators +QuasiQuotes +NoQuasiQuotes +Rank2Types +NoRank2Types +RankNTypes +NoRankNTypes +RebindableSyntax +NoRebindableSyntax +RecordPuns +NoRecordPuns +RecordWildCards +NoRecordWildCards +RecursiveDo +NoRecursiveDo +RelaxedLayout +NoRelaxedLayout +RelaxedPolyRec +NoRelaxedPolyRec +RoleAnnotations +NoRoleAnnotations +ScopedTypeVariables +NoScopedTypeVariables +StandaloneDeriving +NoStandaloneDeriving +StarIsType +NoStarIsType +StaticPointers +NoStaticPointers +Strict +NoStrict +StrictData +NoStrictData +TemplateHaskell +NoTemplateHaskell +TemplateHaskellQuotes +NoTemplateHaskellQuotes +TraditionalRecordSyntax +NoTraditionalRecordSyntax +TransformListComp +NoTransformListComp +TupleSections +NoTupleSections +TypeApplications +NoTypeApplications +TypeInType +NoTypeInType +TypeFamilies +NoTypeFamilies +TypeOperators +NoTypeOperators +TypeSynonymInstances +NoTypeSynonymInstances +UnboxedTuples +NoUnboxedTuples +UnboxedSums +NoUnboxedSums +UndecidableInstances +NoUndecidableInstances +UndecidableSuperClasses +NoUndecidableSuperClasses +UnicodeSyntax +NoUnicodeSyntax +UnliftedFFITypes +NoUnliftedFFITypes +ViewPatterns +NoViewPatterns diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 971f9e423e..18d534a1a4 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -109,7 +109,7 @@ in { ++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table.patch ++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table-2.patch ++ always ./patches/ghc/respect-ar-path.patch - ++ until "8.12" ./patches/ghc/MR2537-use-one-shot-kqueue-on-macos.patch + ++ until "8.12" ./patches/ghc/MR2537-use-one-shot-kqueue-on-macos.patch ++ final.lib.optional (version == "8.6.3") ./patches/ghc/T16057--ghci-doa-on-windows.patch ++ final.lib.optional (version == "8.6.3") ./patches/ghc/ghc-8.6.3-reinstallable-lib-ghc.patch ++ final.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-reinstallable-lib-ghc.patch @@ -117,10 +117,15 @@ in { ++ final.lib.optional (version == "8.6.5") ./patches/ghc/ghc-8.6.5-atomic-arm-arch.patch ++ final.lib.optional (version == "8.6.5") ./patches/ghc/MR3214-writable-rel-ro-data.patch ++ final.lib.optional (version == "8.8.1") ./patches/ghc/ghc-8.8.1-reinstallable-lib-ghc.patch - ++ fromUntil "8.8.2" "8.9" ./patches/ghc/ghc-8.8.2-reinstallable-lib-ghc.patch + ++ fromUntil "8.8.2" "8.9" ./patches/ghc/ghc-8.8.2-reinstallable-lib-ghc.patch ++ final.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-better-plusSimplCountErrors.patch ++ final.lib.optional (versionAtLeast "8.6.4" && final.stdenv.isDarwin) ./patches/ghc/ghc-macOS-loadArchive-fix.patch ++ final.lib.optional (versionAtLeast "8.4.4" && final.stdenv.isDarwin) ./patches/ghc/ghc-darwin-gcc-version-fix.patch + ++ final.lib.optional (versionAtLeast "8.6.4" && final.stdenv.buildPlatform != final.stdenv.targetPlatform) ./patches/ghc/ghc-no-system-linker.patch + ++ final.lib.optional (versionAtLeast "8.6.4" && final.stdenv.buildPlatform != final.stdenv.targetPlatform) ./patches/ghc/ghci-no-dynamic-linking.patch + ++ final.lib.optional (versionAtLeast "8.6.4" && final.stdenv.buildPlatform != final.stdenv.targetPlatform) ./patches/ghc/aarch64-linker.patch + ++ final.lib.optional (versionAtLeast "8.6.4" && final.stdenv.buildPlatform != final.stdenv.targetPlatform) ./patches/ghc/llvm-emit-nonlazybind.patch + ++ final.lib.optional (versionAtLeast "8.6.4") ./patches/ghc/Cabal-3886.patch ; in ({ ghc844 = final.callPackage ../compiler/ghc { @@ -279,6 +284,7 @@ in { # with the current use of env and exact Deps. (builtins.mapAttrs (_: v: v // { + useLLVM = false; isHaskellNixBootCompiler = true; }) ({ @@ -449,6 +455,7 @@ in { v.overrideAttrs (drv: { postInstall = (drv.postInstall or "") + installDeps ""; }) // { + useLLVM = false; isHaskellNixBootCompiler = true; } ) diff --git a/overlays/linux-cross.nix b/overlays/linux-cross.nix index ee5d5d76c9..d46338c554 100644 --- a/overlays/linux-cross.nix +++ b/overlays/linux-cross.nix @@ -35,23 +35,22 @@ let unset configureFlags PORT=$((5000 + $RANDOM % 5000)) (>&2 echo "---> Starting remote-iserv on port $PORT") - ${qemu}/bin/qemu-${qemuSuffix} ${remote-iserv}/bin/remote-iserv tmp $PORT & + ${qemu}/bin/qemu-${qemuSuffix} ${remote-iserv.override { enableDebugRTS = true; enableDWARF = true; }}/bin/remote-iserv tmp $PORT & (>&2 echo "---| remote-iserv should have started on $PORT") RISERV_PID="$!" ${iserv-proxy}/bin/iserv-proxy $@ 127.0.0.1 "$PORT" - (>&2 echo "---> killing remote-iserve...") + (>&2 echo "---> killing remote-iserv...") kill $RISERV_PID ''; configureFlags = lib.optional hostPlatform.isAarch32 "--disable-split-sections"; - setupBuildFlags = map (opt: "--ghc-option=" + opt) ((lib.optionals isLinuxCross + setupBuildFlags = (map (opt: "--ghc-option=" + opt) (lib.optionals isLinuxCross [ "-fexternal-interpreter" "-pgmi" "${qemuIservWrapper}/bin/iserv-wrapper" "-L${gmp}/lib" # Required to work-around https://gitlab.haskell.org/ghc/ghc/issues/15275 - ] ++ lib.optionals hostPlatform.isAarch64 ["-fPIC"])) - ++ lib.optionals hostPlatform.isAarch32 (map (opt: "--gcc-option=" + opt) [ "-fno-pic" "-fno-plt" ]) - # Also for GHC #15275 - ++ lib.optionals hostPlatform.isAarch64 ["--gcc-option=-fPIC"]; + ])) ++ (map (opt: "--gcc-option=" + opt) (lib.optionals (hostPlatform.isAarch32 || hostPlatform.isAarch64) + [ "-fPIC" "-fno-plt" ])); + qemuTestWrapper = writeScriptBin "test-wrapper" '' #!${stdenv.shell} set -euo pipefail diff --git a/overlays/musl.nix b/overlays/musl.nix index d1d6608083..692642821d 100644 --- a/overlays/musl.nix +++ b/overlays/musl.nix @@ -11,6 +11,16 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({ # Prevent pkgsMusl.pkgsStatic chain busybox-sandbox-shell = prev.busybox-sandbox-shell.override { inherit (final) busybox; }; + # we don't want the static output to be split. That just + # messes with the z -> libz mapping. We can't have a conditonal + # z -> libz / z -> libz.static mapping without threading the + # package configuration in. That seems a bit overkill. + zlib = prev.zlib.override { splitStaticOutput = false; }; + + # and a few more packages that need their static libs explicitly enabled + gmp = prev.gmp.override { withStatic = true; }; + ncurses = prev.ncurses.override { enableStatic = true; }; + # Fails on cross compile nix = prev.nix.overrideAttrs (_: { doInstallCheck = false; }); } // prev.lib.optionalAttrs (prev.lib.versionAtLeast prev.lib.trivial.release "20.03") { diff --git a/overlays/patches/ghc/Cabal-3886.patch b/overlays/patches/ghc/Cabal-3886.patch new file mode 100644 index 0000000000..b5ecdb2459 --- /dev/null +++ b/overlays/patches/ghc/Cabal-3886.patch @@ -0,0 +1,170 @@ +Submodule libraries/Cabal contains modified content +diff --git a/libraries/Cabal/Cabal/Distribution/Simple/Program/Ld.hs b/libraries/Cabal/Cabal/Distribution/Simple/Program/Ld.hs +index 68b5a391a..f4979bf5f 100644 +--- a/libraries/Cabal/Cabal/Distribution/Simple/Program/Ld.hs ++++ b/libraries/Cabal/Cabal/Distribution/Simple/Program/Ld.hs +@@ -21,7 +21,7 @@ import Distribution.Compat.Prelude + import Distribution.Simple.Compiler (arResponseFilesSupported) + import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..)) + import Distribution.Simple.Program.ResponseFile +- ( withResponseFile ) ++ ( withResponseFile, withLinkerScript ) + import Distribution.Simple.Program.Run + ( ProgramInvocation, programInvocation, multiStageProgramInvocation + , runProgramInvocation ) +@@ -31,6 +31,8 @@ import Distribution.Simple.Setup + ( fromFlagOrDefault, configUseResponseFiles ) + import Distribution.Simple.Utils + ( defaultTempFileOptions ) ++import Distribution.System ++ ( OS(..), Platform(..) ) + import Distribution.Verbosity + ( Verbosity ) + +@@ -50,7 +52,71 @@ combineObjectFiles verbosity lbi ld target files = do + -- have a slight problem. What we have to do is link files in batches into + -- a temp object file and then include that one in the next batch. + +- let simpleArgs = ["-r", "-o", target] ++ let linkerScriptELF = unlines $ ++ [ "/* Linker script to undo -split-sections and merge all sections together when " ++ , " * linking relocatable object files for GHCi. " ++ , " * ld -r normally retains the individual sections, which is what you would want " ++ , " * if the intention is to eventually link into a binary with --gc-sections, but " ++ , " * it doesn't have a flag for directly doing what we want. */ " ++ , "SECTIONS " ++ , "{ " ++ , " .text : { " ++ , " *(.text*) " ++ , " } " ++ , " .rodata.cst16 : { " ++ , " *(.rodata.cst16*) " ++ , " } " ++ , " .rodata : { " ++ , " *(.rodata*) " ++ , " } " ++ , " .data.rel.ro : { " ++ , " *(.data.rel.ro*) " ++ , " } " ++ , " .data : { " ++ , " *(.data*) " ++ , " } " ++ , " .bss : { " ++ , " *(.bss*) " ++ , " } " ++ , "} " ++ ] ++ ++ linkerScriptPE = unlines $ ++ [ "/* Linker script to undo -split-sections and merge all sections together when " ++ , " * linking relocatable object files for GHCi. " ++ , " * ld -r normally retains the individual sections, which is what you would want " ++ , " * if the intention is to eventually link into a binary with --gc-sections, but " ++ , " * it doesn't have a flag for directly doing what we want. */ " ++ , "SECTIONS " ++ , "{ " ++ , " .text : { " ++ , " *(.text$*) " ++ , " } " ++ , " .rdata : { " ++ , " *(.rdata$*) " ++ , " } " ++ , " .data : { " ++ , " *(.data$*) " ++ , " } " ++ , " .pdata : { " ++ , " *(.pdata$*) " ++ , " } " ++ , " .xdata : { " ++ , " *(.xdata$*) " ++ , " } " ++ , " .bss : { " ++ , " *(.bss$*) " ++ , " } " ++ , "} " ++ ] ++ linkerScript = case hostOS of ++ Windows -> linkerScriptPE ++ _ -> linkerScriptELF ++ linkerScriptArgs = case hostOS of ++ Windows -> [] ++ _ -> ["-T"] ++ ++ simpleArgs = ["-r", "-o", target] + + initialArgs = ["-r", "-o", target] + middleArgs = ["-r", "-o", target, tmpfile] +@@ -63,9 +129,9 @@ combineObjectFiles verbosity lbi ld target files = do + + targetDir = takeDirectory target + +- invokeWithResponesFile :: FilePath -> ProgramInvocation +- invokeWithResponesFile atFile = +- programInvocation ld $ simpleArgs ++ ['@' : atFile] ++ invokeWithLinkerScriptAndResponesFile :: FilePath -> FilePath -> ProgramInvocation ++ invokeWithLinkerScriptAndResponesFile script atFile = ++ programInvocation ld $ simpleArgs ++ linkerScriptArgs ++ [ script, '@' : atFile] + + oldVersionManualOverride = + fromFlagOrDefault False $ configUseResponseFiles $ configFlags lbi +@@ -78,10 +144,13 @@ combineObjectFiles verbosity lbi ld target files = do + then + run $ multiStageProgramInvocation simple (initial, middle, final) files + else +- withResponseFile verbosity defaultTempFileOptions targetDir "ld.rsp" Nothing files $ +- \path -> runProgramInvocation verbosity $ invokeWithResponesFile path ++ withLinkerScript verbosity defaultTempFileOptions targetDir "merge_sections.ld" Nothing linkerScript $ ++ \scriptPath -> withResponseFile verbosity defaultTempFileOptions targetDir "ld.rsp" Nothing files $ ++ \path -> runProgramInvocation verbosity $ invokeWithLinkerScriptAndResponesFile scriptPath path + + where ++ Platform _hostArch hostOS = hostPlatform lbi ++ + tmpfile = target <.> "tmp" -- perhaps should use a proper temp file + + run :: [ProgramInvocation] -> IO () +diff --git a/libraries/Cabal/Cabal/Distribution/Simple/Program/ResponseFile.hs b/libraries/Cabal/Cabal/Distribution/Simple/Program/ResponseFile.hs +index e5ef41412..3b038e6b1 100644 +--- a/libraries/Cabal/Cabal/Distribution/Simple/Program/ResponseFile.hs ++++ b/libraries/Cabal/Cabal/Distribution/Simple/Program/ResponseFile.hs +@@ -10,7 +10,7 @@ + -- Created : 23 July 2017 + ---------------------------------------------------------------------------- + +-module Distribution.Simple.Program.ResponseFile (withResponseFile) where ++module Distribution.Simple.Program.ResponseFile (withResponseFile, withLinkerScript) where + + import Prelude () + import System.IO (TextEncoding, hSetEncoding, hPutStr, hClose) +@@ -39,6 +39,25 @@ withResponseFile verbosity tmpFileOpts workDir fileNameTemplate encoding argumen + debug verbosity $ ">>> " ++ responseFileName + f responseFileName + ++withLinkerScript ++ :: Verbosity ++ -> TempFileOptions ++ -> FilePath ++ -> FilePath ++ -> Maybe TextEncoding ++ -> String ++ -> (FilePath -> IO a) ++ -> IO a ++withLinkerScript verbosity tmpFileOpts workDir fileNameTemplate encoding linkerScript f = ++ withTempFileEx tmpFileOpts workDir fileNameTemplate $ \linkerScriptName hf -> do ++ traverse_ (hSetEncoding hf) encoding ++ hPutStr hf linkerScript ++ hClose hf ++ debug verbosity $ linkerScriptName ++ " contents: <<<" ++ debug verbosity linkerScript ++ debug verbosity $ ">>> " ++ linkerScriptName ++ f linkerScriptName ++ + -- Support a gcc-like response file syntax. Each separate + -- argument and its possible parameter(s), will be separated in the + -- response file by an actual newline; all other whitespace, +@@ -56,5 +75,3 @@ escapeResponseFileArg = reverse . foldl' escape [] + '"' -> c:'\\':cs + _ | isSpace c -> c:'\\':cs + | otherwise -> c:cs +- +- diff --git a/overlays/patches/ghc/aarch64-linker.patch b/overlays/patches/ghc/aarch64-linker.patch new file mode 100644 index 0000000000..0f5c1c585c --- /dev/null +++ b/overlays/patches/ghc/aarch64-linker.patch @@ -0,0 +1,288 @@ +diff --git a/rts/Linker.c b/rts/Linker.c +index 7ed9e9d148..468bd593b6 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -192,7 +192,7 @@ int ocTryLoad( ObjectCode* oc ); + * + * MAP_32BIT not available on OpenBSD/amd64 + */ +-#if (defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) || defined(aarch64_TARGET_ARCH)) && defined(MAP_32BIT) ++#if (defined(x86_64_HOST_ARCH) || (defined(aarch64_TARGET_ARCH) || defined(aarch64_HOST_ARCH))) && defined(MAP_32BIT) + #define TRY_MAP_32BIT MAP_32BIT + #else + #define TRY_MAP_32BIT 0 +@@ -216,11 +216,18 @@ int ocTryLoad( ObjectCode* oc ); + * We pick a default address based on the OS, but also make this + * configurable via an RTS flag (+RTS -xm) + */ +-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) ++#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || (defined(aarch64_TARGET_ARCH) || defined(aarch64_HOST_ARCH)) + + #define MMAP_MAX_RETRY 100 + +-#if defined(MAP_32BIT) ++#if (defined(aarch64_TARGET_ARCH) || defined(aarch64_HOST_ARCH)) ++// Try to use stg_upd_frame_info as the base. We need to be within +-4GB of that ++// address, otherwise we violate the aarch64 memory model. Any object we load ++// can potentially reference any of the ones we bake into the binary (and list) ++// in RtsSymbols. Thus we'll need to be within +-4GB of those, ++// stg_upd_frame_info is a good candidate as it's referenced often. ++#define MMAP_32BIT_BASE_DEFAULT (void*)&stg_upd_frame_info; ++#elif defined(MAP_32BIT) + // Try to use MAP_32BIT + #define MMAP_32BIT_BASE_DEFAULT 0 + #else +@@ -502,7 +509,7 @@ initLinker_ (int retain_cafs) + } + # endif + +-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) ++#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) + if (RtsFlags.MiscFlags.linkerMemBase != 0) { + // User-override for mmap_32bit_base + mmap_32bit_base = (void*)RtsFlags.MiscFlags.linkerMemBase; +@@ -881,8 +888,9 @@ SymbolAddr* lookupSymbol_ (SymbolName* lbl) + * Symbol name only used for diagnostics output. + */ + SymbolAddr* loadSymbol(SymbolName *lbl, RtsSymbolInfo *pinfo) { +- IF_DEBUG(linker, debugBelch("lookupSymbol: value of %s is %p\n", lbl, +- pinfo->value)); ++ IF_DEBUG(linker, debugBelch("lookupSymbol: value of %s is %p, owned by %s\n", lbl, ++ pinfo->value, ++ pinfo->owner ? OC_INFORMATIVE_FILENAME(pinfo->owner) : "No owner, probably built-in.")); + ObjectCode* oc = pinfo->owner; + + /* Symbol can be found during linking, but hasn't been relocated. Do so now. +@@ -906,6 +914,27 @@ SymbolAddr* loadSymbol(SymbolName *lbl, RtsSymbolInfo *pinfo) { + return pinfo->value; + } + ++void ++printLoadedObjects() { ++ ObjectCode* oc; ++ for (oc = objects; oc; oc = oc->next) { ++ if (oc->sections != NULL) { ++ int i; ++ printf("%s\n", OC_INFORMATIVE_FILENAME(oc)); ++ for (i=0; i < oc->n_sections; i++) { ++ if(oc->sections[i].mapped_start != NULL || oc->sections[i].start != NULL) { ++ printf("\tsec %2d[alloc: %d; kind: %d]: %p - %p; mmaped: %p - %p\n", ++ i, oc->sections[i].alloc, oc->sections[i].kind, ++ oc->sections[i].start, ++ (void*)((uintptr_t)(oc->sections[i].start) + oc->sections[i].size), ++ oc->sections[i].mapped_start, ++ (void*)((uintptr_t)(oc->sections[i].mapped_start) + oc->sections[i].mapped_size)); ++ } ++ } ++ } ++ } ++} ++ + SymbolAddr* lookupSymbol( SymbolName* lbl ) + { + ACQUIRE_LOCK(&linker_mutex); +@@ -913,6 +942,7 @@ SymbolAddr* lookupSymbol( SymbolName* lbl ) + if (!r) { + errorBelch("^^ Could not load '%s', dependency unresolved. " + "See top entry above.\n", lbl); ++ printLoadedObjects(); + fflush(stderr); + } + RELEASE_LOCK(&linker_mutex); +@@ -1003,6 +1033,23 @@ resolveSymbolAddr (pathchar* buffer, int size, + } + + #if RTS_LINKER_USE_MMAP ++ ++void* ++mmap_next(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { ++ if(addr == NULL) return mmap(addr, length, prot, flags, fd, offset); ++ // we are going to look for up to pageSize * 1024 * 1024 (4GB) from the ++ // address. ++ size_t pageSize = getPageSize(); ++ for(int i = (uintptr_t)addr & (pageSize-1) ? 1 : 0; i < 1024*1024; i++) { ++ void *target = (void*)(((uintptr_t)addr & ~(pageSize-1))+(i*pageSize)); ++ void *mem = mmap(target, length, prot, flags, fd, offset); ++ if(mem == NULL) return mem; ++ if(mem == target) return mem; ++ munmap(mem, length); ++ } ++ return NULL; ++} ++ + // + // Returns NULL on failure. + // +@@ -1017,7 +1064,7 @@ mmapForLinker (size_t bytes, uint32_t prot, uint32_t flags, int fd, int offset) + IF_DEBUG(linker, debugBelch("mmapForLinker: start\n")); + size = roundUpToPage(bytes); + +-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) || defined(aarch64_TARGET_ARCH) ++#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) ||( defined(aarch64_TARGET_ARCH) || defined(aarch64_HOST_ARCH)) + + size_t mmap_counter = MMAP_MAX_RETRY; + mmap_again: +@@ -1037,9 +1084,9 @@ mmap_again: + debugBelch("mmapForLinker: \tflags %#0x\n", + MAP_PRIVATE | TRY_MAP_32BIT | fixed | flags)); + +- result = mmap(map_addr, size, +- prot, +- MAP_PRIVATE|TRY_MAP_32BIT|fixed|flags, fd, offset); ++ result = mmap_next(map_addr, size, ++ prot, ++ MAP_PRIVATE|TRY_MAP_32BIT|fixed|flags, fd, offset); + + if (result == MAP_FAILED) { + sysErrorBelch("mmap %" FMT_Word " bytes at %p",(W_)size,map_addr); +@@ -1047,7 +1094,7 @@ mmap_again: + return NULL; + } + +-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) || defined(aarch64_TARGET_ARCH) ++#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) + if (mmap_32bit_base != 0) { + if (result == map_addr) { + mmap_32bit_base = (StgWord8*)map_addr + size; +@@ -1091,6 +1138,28 @@ mmap_again: + goto mmap_again; + } + } ++#elif (defined(aarch64_TARGET_ARCH) || defined(aarch64_HOST_ARCH)) ++ // for aarch64 we need to make sure we stay within 4GB of the ++ // mmap_32bit_base, and we also do not want to update it. ++// if (mmap_32bit_base != (void*)&stg_upd_frame_info) { ++ if (result == map_addr) { ++ mmap_32bit_base = (void*)((uintptr_t)map_addr + size); ++ } else { ++ // upper limit 4GB - size of the object file - 1mb wiggle room. ++ if(llabs((uintptr_t)result - (uintptr_t)&stg_upd_frame_info) > (2<<32) - size - (2<<20)) { ++ // not within range :( ++ debugTrace(DEBUG_linker, ++ "MAP_32BIT didn't work; gave us %lu bytes at 0x%p", ++ bytes, result); ++ munmap(result, size); ++ // TODO: some abort/mmap_32bit_base recomputation based on ++ // if mmap_32bit_base is changed, or still at stg_upd_frame_info ++ goto mmap_again; ++ } else { ++ mmap_32bit_base = (void*)((uintptr_t)result + size); ++ } ++ } ++// } + #endif + + IF_DEBUG(linker, +@@ -1643,6 +1712,9 @@ static HsInt resolveObjs_ (void) + r = ocTryLoad(oc); + if (!r) + { ++ errorBelch("Could not load Object Code %s.\n", OC_INFORMATIVE_FILENAME(oc)); ++ printLoadedObjects(); ++ fflush(stderr); + return r; + } + } +diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h +index f7ef0da81e..02cb6b814f 100644 +--- a/rts/LinkerInternals.h ++++ b/rts/LinkerInternals.h +@@ -13,6 +13,7 @@ + + #if RTS_LINKER_USE_MMAP + #include ++void* mmap_next(void *addr, size_t length, int prot, int flags, int fd, off_t offset); + #endif + + #include "BeginPrivate.h" +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index 8e477c0425..955d1151d5 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -824,6 +824,26 @@ ocGetNames_ELF ( ObjectCode* oc ) + + unsigned curSymbol = 0; + ++ unsigned long common_size = 0; ++ unsigned long common_used = 0; ++ for(ElfSymbolTable *symTab = oc->info->symbolTables; ++ symTab != NULL; symTab = symTab->next) { ++ for (size_t j = 0; j < symTab->n_symbols; j++) { ++ ElfSymbol *symbol = &symTab->symbols[j]; ++ if (SHN_COMMON == symTab->symbols[j].elf_sym->st_shndx) { ++ common_size += symbol->elf_sym->st_size; ++ } ++ } ++ } ++ void * common_mem = NULL; ++ if(common_size > 0) { ++ common_mem = mmapForLinker(common_size, ++ PROT_READ | PROT_WRITE, ++ MAP_ANON | MAP_PRIVATE, ++ -1, 0); ++ ASSERT(common_mem != NULL); ++ } ++ + //TODO: we ignore local symbols anyway right? So we can use the + // shdr[i].sh_info to get the index of the first non-local symbol + // ie we should use j = shdr[i].sh_info +@@ -859,12 +879,15 @@ ocGetNames_ELF ( ObjectCode* oc ) + + if (shndx == SHN_COMMON) { + isLocal = false; +- symbol->addr = stgCallocBytes(1, symbol->elf_sym->st_size, +- "ocGetNames_ELF(COMMON)"); +- /* +- debugBelch("COMMON symbol, size %d name %s\n", +- stab[j].st_size, nm); +- */ ++ ASSERT(common_used < common_size); ++ ASSERT(common_mem); ++ symbol->addr = (void*)((uintptr_t)common_mem + common_used); ++ common_used += symbol->elf_sym->st_size; ++ ASSERT(common_used <= common_size); ++ ++ debugBelch("COMMON symbol, size %ld name %s allocated at %p\n", ++ symbol->elf_sym->st_size, nm, symbol->addr); ++ + /* Pointless to do addProddableBlock() for this area, + since the linker should never poke around in it. */ + } else if ((ELF_ST_BIND(symbol->elf_sym->st_info) == STB_GLOBAL +diff --git a/rts/linker/elf_reloc_aarch64.c b/rts/linker/elf_reloc_aarch64.c +index a826c58170..7e80bc4183 100644 +--- a/rts/linker/elf_reloc_aarch64.c ++++ b/rts/linker/elf_reloc_aarch64.c +@@ -310,14 +310,14 @@ relocateObjectCodeAarch64(ObjectCode * oc) { + symbol->name, + OC_INFORMATIVE_FILENAME(oc))); + if(encodeAddendAarch64(targetSection, rel, addend)) { +- sysErrorBelch("Failed to relocate symbol: %s (%s) " ++ debugBelch("REL: Failed to relocate symbol: %s (%s) " + "at %p in %p with addend 0x%" PRIx64 "\n", + symbol->name, + OC_INFORMATIVE_FILENAME(oc), + symbol->addr, + (addr_t)((uint8_t*)targetSection->start + rel->r_offset), + addend); +- stg_exit(EXIT_FAILURE); ++ return EXIT_FAILURE; + } + } + } +@@ -349,14 +349,14 @@ relocateObjectCodeAarch64(ObjectCode * oc) { + symbol->name, + OC_INFORMATIVE_FILENAME(oc))); + if(encodeAddendAarch64(targetSection, (Elf_Rel*)rel, addend)) { +- sysErrorBelch("Failed to relocate symbol: %s (%s) " ++ debugBelch("RELA: Failed to relocate symbol: %s (%s) " + "at %p in %p with addend 0x%" PRIx64 "\n", + symbol->name, + OC_INFORMATIVE_FILENAME(oc), + symbol->addr, + (addr_t)((uint8_t*)targetSection->start + rel->r_offset), + addend); +- stg_exit(EXIT_FAILURE); ++ return EXIT_FAILURE; + } + } + } diff --git a/overlays/patches/ghc/ghc-no-system-linker.patch b/overlays/patches/ghc/ghc-no-system-linker.patch new file mode 100644 index 0000000000..ed82cd531a --- /dev/null +++ b/overlays/patches/ghc/ghc-no-system-linker.patch @@ -0,0 +1,78 @@ +diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in +index 01628dcad1..209704d034 100644 +--- a/compiler/ghc.cabal.in ++++ b/compiler/ghc.cabal.in +@@ -45,6 +45,11 @@ Flag terminfo + Default: True + Manual: True + ++Flag dynamic-system-linker ++ Description: The system can load dynamic code. This is not the case for musl. ++ Default: True ++ Manual: False ++ + Library + Default-Language: Haskell2010 + Exposed: False +@@ -84,6 +89,9 @@ Library + CPP-Options: -DGHCI + Include-Dirs: ../rts/dist/build @FFIIncludeDir@ + ++ if flag(dynamic-system-linker) ++ CPP-Options: -DCAN_LOAD_DLL ++ + Other-Extensions: + BangPatterns + CPP +diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs +index 3b030be2d3..879c5c19ee 100644 +--- a/compiler/ghci/Linker.hs ++++ b/compiler/ghci/Linker.hs +@@ -1295,13 +1295,13 @@ linkPackage hsc_env pkg + + maybePutStr dflags + ("Loading package " ++ sourcePackageIdString pkg ++ " ... ") +- + -- See comments with partOfGHCi ++#if defined(CAN_LOAD_DLL) + when (packageName pkg `notElem` partOfGHCi) $ do + loadFrameworks hsc_env platform pkg + mapM_ (load_dyn hsc_env) + (known_dlls ++ map (mkSOName platform) dlls) +- ++#endif + -- After loading all the DLLs, we can load the static objects. + -- Ordering isn't important here, because we do one final link + -- step to resolve everything. +@@ -1382,10 +1382,15 @@ locateLib hsc_env is_hs lib_dirs gcc_dirs lib + -- O(n). Loading an import library is also O(n) so in general we prefer + -- shared libraries because they are simpler and faster. + -- +- = findDll user `orElse` ++ = ++#if defined(CAN_LOAD_DLL) ++ findDll user `orElse` ++#endif + tryImpLib user `orElse` ++#if defined(CAN_LOAD_DLL) + findDll gcc `orElse` + findSysDll `orElse` ++#endif + tryImpLib gcc `orElse` + findArchive `orElse` + tryGcc `orElse` +@@ -1452,7 +1457,13 @@ locateLib hsc_env is_hs lib_dirs gcc_dirs lib + full = dllpath $ search lib_so_name lib_dirs + gcc name = liftM (fmap Archive) $ search name lib_dirs + files = import_libs ++ arch_files +- in apply $ short : full : map gcc files ++ dlls = [short, full] ++ archives = map gcc files ++ in apply $ ++#if defined(CAN_LOAD_DLL) ++ dlls ++ ++#endif ++ archives + tryImpLib re = case os of + OSMinGW32 -> + let dirs' = if re == user then lib_dirs else gcc_dirs diff --git a/overlays/patches/ghc/ghci-no-dynamic-linking.patch b/overlays/patches/ghc/ghci-no-dynamic-linking.patch new file mode 100644 index 0000000000..072bfe0b3c --- /dev/null +++ b/overlays/patches/ghc/ghci-no-dynamic-linking.patch @@ -0,0 +1,1991 @@ +diff --git a/compiler/cmm/CmmMachOp.hs b/compiler/cmm/CmmMachOp.hs +index 15a5827643..fd50db511d 100644 +--- a/compiler/cmm/CmmMachOp.hs ++++ b/compiler/cmm/CmmMachOp.hs +@@ -562,6 +562,7 @@ data CallishMachOp + | MO_SubIntC Width + | MO_U_Mul2 Width + ++ | MO_ReadBarrier + | MO_WriteBarrier + | MO_Touch -- Keep variables live (when using interior pointers) + +diff --git a/compiler/cmm/CmmParse.y.source b/compiler/cmm/CmmParse.y.source +index 4d7e288381..480cd48fd1 100644 +--- a/compiler/cmm/CmmParse.y.source ++++ b/compiler/cmm/CmmParse.y.source +@@ -998,6 +998,7 @@ machOps = listToUFM $ + callishMachOps :: UniqFM ([CmmExpr] -> (CallishMachOp, [CmmExpr])) + callishMachOps = listToUFM $ + map (\(x, y) -> (mkFastString x, y)) [ ++ ( "read_barrier", (,) MO_ReadBarrier ), + ( "write_barrier", (,) MO_WriteBarrier ), + ( "memcpy", memcpyLikeTweakArgs MO_Memcpy ), + ( "memset", memcpyLikeTweakArgs MO_Memset ), +diff --git a/compiler/cmm/CmmParse.hs b/compiler/cmm/CmmParse.hs +index 4d7e288381..480cd48fd1 100644 +--- a/compiler/cmm/CmmParse.hs ++++ b/compiler/cmm/CmmParse.hs +@@ -2559,6 +2559,7 @@ + callishMachOps :: UniqFM ([CmmExpr] -> (CallishMachOp, [CmmExpr])) + callishMachOps = listToUFM $ + map (\(x, y) -> (mkFastString x, y)) [ ++ ( "read_barrier", (,) MO_ReadBarrier ), + ( "write_barrier", (,) MO_WriteBarrier ), + ( "memcpy", memcpyLikeTweakArgs MO_Memcpy ), + ( "memset", memcpyLikeTweakArgs MO_Memset ), +diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs +index 9e8ced88b5..3b6587778e 100644 +--- a/compiler/cmm/PprC.hs ++++ b/compiler/cmm/PprC.hs +@@ -794,6 +794,7 @@ pprCallishMachOp_for_C mop + MO_F32_Exp -> text "expf" + MO_F32_Sqrt -> text "sqrtf" + MO_F32_Fabs -> text "fabsf" ++ MO_ReadBarrier -> text "load_load_barrier" + MO_WriteBarrier -> text "write_barrier" + MO_Memcpy _ -> text "memcpy" + MO_Memset _ -> text "memset" +diff --git a/compiler/codeGen/StgCmmBind.hs b/compiler/codeGen/StgCmmBind.hs +index aa2b954a95..5b9811cd0f 100644 +--- a/compiler/codeGen/StgCmmBind.hs ++++ b/compiler/codeGen/StgCmmBind.hs +@@ -629,6 +629,7 @@ emitBlackHoleCode node = do + + when eager_blackholing $ do + emitStore (cmmOffsetW dflags node (fixedHdrSizeW dflags)) currentTSOExpr ++ -- See Note [Heap memory barriers] in SMP.h. + emitPrimCall [] MO_WriteBarrier [] + emitStore node (CmmReg (CmmGlobal EagerBlackholeInfo)) + +diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +index f5d06e54b6..33d5d0c83c 100644 +--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs ++++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +@@ -170,17 +170,25 @@ barrier = do + let s = Fence False SyncSeqCst + return (unitOL s, []) + ++-- | Insert a 'barrier', unless the target platform is in the provided list of ++-- exceptions (where no code will be emitted instead). ++barrierUnless :: [Arch] -> LlvmM StmtData ++barrierUnless exs = do ++ platform <- getLlvmPlatform ++ if platformArch platform `elem` exs ++ then return (nilOL, []) ++ else barrier ++ + -- | Foreign Calls + genCall :: ForeignTarget -> [CmmFormal] -> [CmmActual] + -> LlvmM StmtData + +--- Write barrier needs to be handled specially as it is implemented as an LLVM +--- intrinsic function. ++-- Barriers need to be handled specially as they are implemented as LLVM ++-- intrinsic functions. ++genCall (PrimTarget MO_ReadBarrier) _ _ = ++ barrierUnless [ArchX86, ArchX86_64, ArchSPARC] + genCall (PrimTarget MO_WriteBarrier) _ _ = do +- platform <- getLlvmPlatform +- if platformArch platform `elem` [ArchX86, ArchX86_64, ArchSPARC] +- then return (nilOL, []) +- else barrier ++ barrierUnless [ArchX86, ArchX86_64, ArchSPARC] + + genCall (PrimTarget MO_Touch) _ _ + = return (nilOL, []) +@@ -817,6 +825,7 @@ cmmPrimOpFunctions mop = do + -- We support MO_U_Mul2 through ordinary LLVM mul instruction, see the + -- appropriate case of genCall. + MO_U_Mul2 {} -> unsupported ++ MO_ReadBarrier -> unsupported + MO_WriteBarrier -> unsupported + MO_Touch -> unsupported + MO_UF_Conv _ -> unsupported +diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs +index 88b9692920..fa05c68efc 100644 +--- a/compiler/nativeGen/PPC/CodeGen.hs ++++ b/compiler/nativeGen/PPC/CodeGen.hs +@@ -1096,6 +1096,8 @@ genCCall :: ForeignTarget -- function to call + -> [CmmFormal] -- where to put the result + -> [CmmActual] -- arguments (of mixed type) + -> NatM InstrBlock ++genCCall (PrimTarget MO_ReadBarrier) _ _ ++ = return $ unitOL LWSYNC + genCCall (PrimTarget MO_WriteBarrier) _ _ + = return $ unitOL LWSYNC + +@@ -2023,6 +2025,7 @@ genCCall' dflags gcp target dest_regs args + MO_AddIntC {} -> unsupported + MO_SubIntC {} -> unsupported + MO_U_Mul2 {} -> unsupported ++ MO_ReadBarrier -> unsupported + MO_WriteBarrier -> unsupported + MO_Touch -> unsupported + MO_Prefetch_Data _ -> unsupported +diff --git a/compiler/nativeGen/SPARC/CodeGen.hs b/compiler/nativeGen/SPARC/CodeGen.hs +index 98e062df62..29e8dbf0f9 100644 +--- a/compiler/nativeGen/SPARC/CodeGen.hs ++++ b/compiler/nativeGen/SPARC/CodeGen.hs +@@ -401,6 +401,8 @@ genCCall + -- + -- In the SPARC case we don't need a barrier. + -- ++genCCall (PrimTarget MO_ReadBarrier) _ _ ++ = return $ nilOL + genCCall (PrimTarget MO_WriteBarrier) _ _ + = return $ nilOL + +@@ -678,6 +680,7 @@ outOfLineMachOp_table mop + MO_AddIntC {} -> unsupported + MO_SubIntC {} -> unsupported + MO_U_Mul2 {} -> unsupported ++ MO_ReadBarrier -> unsupported + MO_WriteBarrier -> unsupported + MO_Touch -> unsupported + (MO_Prefetch_Data _) -> unsupported +diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs +index 4551754200..98830b1233 100644 +--- a/compiler/nativeGen/X86/CodeGen.hs ++++ b/compiler/nativeGen/X86/CodeGen.hs +@@ -1809,8 +1809,9 @@ genCCall dflags _ (PrimTarget (MO_Memset align)) _ + dst_addr = AddrBaseIndex (EABaseReg dst) EAIndexNone + (ImmInteger (n - i)) + ++genCCall _ _ (PrimTarget MO_ReadBarrier) _ _ = return nilOL + genCCall _ _ (PrimTarget MO_WriteBarrier) _ _ = return nilOL +- -- write barrier compiles to no code on x86/x86-64; ++ -- barriers compile to no code on x86/x86-64; + -- we keep it this long in order to prevent earlier optimisations. + + genCCall _ _ (PrimTarget MO_Touch) _ _ = return nilOL +@@ -2793,6 +2794,7 @@ outOfLineCmmOp mop res args + MO_AddWordC {} -> unsupported + MO_SubWordC {} -> unsupported + MO_U_Mul2 {} -> unsupported ++ MO_ReadBarrier -> unsupported + MO_WriteBarrier -> unsupported + MO_Touch -> unsupported + (MO_Prefetch_Data _ ) -> unsupported +diff --git a/includes/Cmm.h b/includes/Cmm.h +index 7334eab8c1..ede77f0c00 100644 +--- a/includes/Cmm.h ++++ b/includes/Cmm.h +@@ -303,7 +303,9 @@ + #define ENTER_(ret,x) \ + again: \ + W_ info; \ +- LOAD_INFO(ret,x) \ ++ LOAD_INFO(ret,x) \ ++ /* See Note [Heap memory barriers] in SMP.h */ \ ++ prim_read_barrier; \ + switch [INVALID_OBJECT .. N_CLOSURE_TYPES] \ + (TO_W_( %INFO_TYPE(%STD_INFO(info)) )) { \ + case \ +@@ -626,6 +628,14 @@ + #define OVERWRITING_CLOSURE_OFS(c,n) /* nothing */ + #endif + ++// Memory barriers. ++// For discussion of how these are used to fence heap object ++// accesses see Note [Heap memory barriers] in SMP.h. ++#if defined(THREADED_RTS) ++#define prim_read_barrier prim %read_barrier() ++#else ++#define prim_read_barrier /* nothing */ ++#endif + #if defined(THREADED_RTS) + #define prim_write_barrier prim %write_barrier() + #else +diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h +index 4020aef0d9..db6b4b954a 100644 +--- a/includes/stg/SMP.h ++++ b/includes/stg/SMP.h +@@ -96,6 +96,151 @@ EXTERN_INLINE void write_barrier(void); + EXTERN_INLINE void store_load_barrier(void); + EXTERN_INLINE void load_load_barrier(void); + ++/* ++ * Note [Heap memory barriers] ++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ * ++ * Machines with weak memory ordering semantics have consequences for how ++ * closures are observed and mutated. For example, consider a thunk that needs ++ * to be updated to an indirection. In order for the indirection to be safe for ++ * concurrent observers to enter, said observers must read the indirection's ++ * info table before they read the indirectee. Furthermore, the indirectee must ++ * be set before the info table pointer. This ensures that if the observer sees ++ * an IND info table then the indirectee is valid. ++ * ++ * When a closure is updated with an indirection, both its info table and its ++ * indirectee must be written. With weak memory ordering, these two writes can ++ * be arbitrarily reordered, and perhaps even interleaved with other threads' ++ * reads and writes (in the absence of memory barrier instructions). Consider ++ * this example of a bad reordering: ++ * ++ * - An updater writes to a closure's info table (INFO_TYPE is now IND). ++ * - A concurrent observer branches upon reading the closure's INFO_TYPE as IND. ++ * - A concurrent observer reads the closure's indirectee and enters it. ++ * - An updater writes the closure's indirectee. ++ * ++ * Here the update to the indirectee comes too late and the concurrent observer ++ * has jumped off into the abyss. Speculative execution can also cause us ++ * issues, consider: ++ * ++ * - an observer is about to case on a value in closure's info table. ++ * - the observer speculatively reads one or more of closure's fields. ++ * - an updater writes to closure's info table. ++ * - the observer takes a branch based on the new info table value, but with the ++ * old closure fields! ++ * - the updater writes to the closure's other fields, but its too late. ++ * ++ * Because of these effects, reads and writes to a closure's info table must be ++ * ordered carefully with respect to reads and writes to the closure's other ++ * fields, and memory barriers must be placed to ensure that reads and writes ++ * occur in program order. Specifically, updates to an already existing closure ++ * must follow the following pattern: ++ * ++ * - Update the closure's (non-info table) fields. ++ * - Write barrier. ++ * - Update the closure's info table. ++ * ++ * Observing the fields of an updateable closure (e.g. a THUNK) must follow the ++ * following pattern: ++ * ++ * - Read the closure's info pointer. ++ * - Read barrier. ++ * - Read the closure's (non-info table) fields. ++ * ++ * We must also take care when we expose a newly-allocated closure to other cores ++ * by writing a pointer to it to some shared data structure (e.g. an MVar#, a Message, ++ * or MutVar#). Specifically, we need to ensure that all writes constructing the ++ * closure are visible *before* the write exposing the new closure is made visible: ++ * ++ * - Allocate memory for the closure ++ * - Write the closure's info pointer and fields (ordering betweeen this doesn't ++ * matter since the closure isn't yet visible to anyone else). ++ * - Write barrier ++ * - Make closure visible to other cores ++ * ++ * Note that thread stacks are inherently thread-local and consequently allocating an ++ * object and introducing a reference to it to our stack needs no barrier. ++ * ++ * There are several ways in which the mutator may make a newly-allocated ++ * closure visible to other cores: ++ * ++ * - Eager blackholing a THUNK: ++ * This is protected by an explicit write barrier in the eager blackholing ++ * code produced by the codegen. See StgCmmBind.emitBlackHoleCode. ++ * ++ * - Lazy blackholing a THUNK: ++ * This is is protected by an explicit write barrier in the thread suspension ++ * code. See ThreadPaused.c:threadPaused. ++ * ++ * - Updating a BLACKHOLE: ++ * This case is protected by explicit write barriers in the the update frame ++ * entry code (see rts/Updates.h). ++ * ++ * - Blocking on an MVar# (e.g. takeMVar#): ++ * In this case the appropriate MVar primops (e.g. stg_takeMVarzh). include ++ * explicit memory barriers to ensure that the the newly-allocated ++ * MVAR_TSO_QUEUE is visible to other cores. ++ * ++ * - Write to an MVar# (e.g. putMVar#): ++ * This protected by the full barrier implied by the CAS in putMVar#. ++ * ++ * - Write to a TVar#: ++ * This is protected by the full barrier implied by the CAS in STM.c:lock_stm. ++ * ++ * - Write to an Array#, ArrayArray#, or SmallArray#: ++ * This case is protected by an explicit write barrier in the code produced ++ * for this primop by the codegen. See StgCmmPrim.doWritePtrArrayOp and ++ * StgCmmPrim.doWriteSmallPtrArrayOp. Relevant issue: #12469. ++ * ++ * - Write to MutVar# via writeMutVar#: ++ * This case is protected by an explicit write barrier in the code produced ++ * for this primop by the codegen. ++ * ++ * - Write to MutVar# via atomicModifyMutVar# or casMutVar#: ++ * This is protected by the full barrier implied by the cmpxchg operations ++ * in this primops. ++ * ++ * - Sending a Message to another capability: ++ * This is protected by the acquition and release of the target capability's ++ * lock in Messages.c:sendMessage. ++ * ++ * Finally, we must ensure that we flush all cores store buffers before ++ * entering and leaving GC, since stacks may be read by other cores. This ++ * happens as a side-effect of taking and release mutexes (which implies ++ * acquire and release barriers, respectively). ++ * ++ * N.B. recordClosureMutated places a reference to the mutated object on ++ * the capability-local mut_list. Consequently this does not require any memory ++ * barrier. ++ * ++ * During parallel GC we need to be careful during evacuation: before replacing ++ * a closure with a forwarding pointer we must commit a write barrier to ensure ++ * that the copy we made in to-space is visible to other cores. ++ * ++ * However, we can be a bit lax when *reading* during GC. Specifically, the GC ++ * can only make a very limited set of changes to existing closures: ++ * ++ * - it can replace a closure's info table with stg_WHITEHOLE. ++ * - it can replace a previously-whitehole'd closure's info table with a ++ * forwarding pointer ++ * - it can replace a previously-whitehole'd closure's info table with a ++ * valid info table pointer (done in eval_thunk_selector) ++ * - it can update the value of a pointer field after evacuating it ++ * ++ * This is quite nice since we don't need to worry about an interleaving ++ * of writes producing an invalid state: a closure's fields remain valid after ++ * an update of its info table pointer and vice-versa. ++ * ++ * After a round of parallel scavenging we must also ensure that any writes the ++ * GC thread workers made are visible to the main GC thread. This is ensured by ++ * the full barrier implied by the atomic decrement in ++ * GC.c:scavenge_until_all_done. ++ * ++ * The work-stealing queue (WSDeque) also requires barriers; these are ++ * documented in WSDeque.c. ++ * ++ */ ++ + /* ---------------------------------------------------------------------------- + Implementations + ------------------------------------------------------------------------- */ +diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal +index a95f1ecaa8..4866490899 100644 +--- a/libraries/ghc-prim/ghc-prim.cabal ++++ b/libraries/ghc-prim/ghc-prim.cabal +@@ -66,6 +66,11 @@ Library + -- on Windows. Required because of mingw32. + extra-libraries: user32, mingw32, mingwex + ++ if os(linux) ++ -- we need libm, but for musl and other's we might need libc, as libm ++ -- is just an empty shell. ++ extra-libraries: c, m ++ + c-sources: + cbits/atomic.c + cbits/bswap.c +diff --git a/rts/Apply.cmm b/rts/Apply.cmm +index 0454fd69e2..7d87d4dd75 100644 +--- a/rts/Apply.cmm ++++ b/rts/Apply.cmm +@@ -62,6 +62,8 @@ again: + W_ info; + P_ untaggedfun; + W_ arity; ++ // We must obey the correct heap object observation pattern in ++ // Note [Heap memory barriers] in SMP.h. + untaggedfun = UNTAG(fun); + info = %INFO_PTR(untaggedfun); + switch [INVALID_OBJECT .. N_CLOSURE_TYPES] +diff --git a/rts/Compact.cmm b/rts/Compact.cmm +index 061646846d..bae94a03cd 100644 +--- a/rts/Compact.cmm ++++ b/rts/Compact.cmm +@@ -53,6 +53,9 @@ import CLOSURE base_GHCziIOziException_cannotCompactPinned_closure; + // data structure. It takes the location to store the address of the + // compacted object as an argument, so that it can be tail-recursive. + // ++// N.B. No memory barrier (see Note [Heap memory barriers] in SMP.h) is needed ++// here since this is essentially an allocation of a new object which won't ++// be visible to other cores until after we return. + stg_compactAddWorkerzh ( + P_ compact, // The Compact# object + P_ p, // The object to compact +diff --git a/rts/Interpreter.c b/rts/Interpreter.c +index 9eb6560a8c..0540cf964c 100644 +--- a/rts/Interpreter.c ++++ b/rts/Interpreter.c +@@ -266,7 +266,6 @@ StgClosure * copyPAP (Capability *cap, StgPAP *oldpap) + uint32_t size = PAP_sizeW(oldpap->n_args); + StgPAP *pap = (StgPAP *)allocate(cap, size); + enterFunCCS(&cap->r, oldpap->header.prof.ccs); +- SET_HDR(pap, &stg_PAP_info, cap->r.rCCCS); + pap->arity = oldpap->arity; + pap->n_args = oldpap->n_args; + pap->fun = oldpap->fun; +@@ -274,6 +273,8 @@ StgClosure * copyPAP (Capability *cap, StgPAP *oldpap) + for (i = 0; i < ((StgPAP *)pap)->n_args; i++) { + pap->payload[i] = oldpap->payload[i]; + } ++ // No write barrier is needed here as this is a new allocation ++ SET_HDR(pap, &stg_PAP_info, cap->r.rCCCS); + return (StgClosure *)pap; + } + +@@ -799,7 +800,6 @@ do_apply: + // build a new PAP and return it. + StgPAP *new_pap; + new_pap = (StgPAP *)allocate(cap, PAP_sizeW(pap->n_args + m)); +- SET_HDR(new_pap,&stg_PAP_info,cap->r.rCCCS); + new_pap->arity = pap->arity - n; + new_pap->n_args = pap->n_args + m; + new_pap->fun = pap->fun; +@@ -809,6 +809,8 @@ do_apply: + for (i = 0; i < m; i++) { + new_pap->payload[pap->n_args + i] = (StgClosure *)SpW(i); + } ++ // No write barrier is needed here as this is a new allocation ++ SET_HDR(new_pap,&stg_PAP_info,cap->r.rCCCS); + tagged_obj = (StgClosure *)new_pap; + Sp_addW(m); + goto do_return; +@@ -844,13 +846,14 @@ do_apply: + StgPAP *pap; + uint32_t i; + pap = (StgPAP *)allocate(cap, PAP_sizeW(m)); +- SET_HDR(pap, &stg_PAP_info,cap->r.rCCCS); + pap->arity = arity - n; + pap->fun = obj; + pap->n_args = m; + for (i = 0; i < m; i++) { + pap->payload[i] = (StgClosure *)SpW(i); + } ++ // No write barrier is needed here as this is a new allocation ++ SET_HDR(pap, &stg_PAP_info,cap->r.rCCCS); + tagged_obj = (StgClosure *)pap; + Sp_addW(m); + goto do_return; +@@ -1081,7 +1084,6 @@ run_BCO: + // the BCO + size_words = BCO_BITMAP_SIZE(obj) + 2; + new_aps = (StgAP_STACK *) allocate(cap, AP_STACK_sizeW(size_words)); +- SET_HDR(new_aps,&stg_AP_STACK_info,cap->r.rCCCS); + new_aps->size = size_words; + new_aps->fun = &stg_dummy_ret_closure; + +@@ -1095,6 +1097,9 @@ run_BCO: + new_aps->payload[i] = (StgClosure *)SpW(i-2); + } + ++ // No write barrier is needed here as this is a new allocation ++ SET_HDR(new_aps,&stg_AP_STACK_info,cap->r.rCCCS); ++ + // Arrange the stack to call the breakpoint IO action, and + // continue execution of this BCO when the IO action returns. + // +@@ -1423,6 +1428,8 @@ run_BCO: + ap = (StgAP*)allocate(cap, AP_sizeW(n_payload)); + SpW(-1) = (W_)ap; + ap->n_args = n_payload; ++ // No write barrier is needed here as this is a new allocation ++ // visible only from our stack + SET_HDR(ap, &stg_AP_info, cap->r.rCCCS) + Sp_subW(1); + goto nextInsn; +@@ -1434,6 +1441,8 @@ run_BCO: + ap = (StgAP*)allocate(cap, AP_sizeW(n_payload)); + SpW(-1) = (W_)ap; + ap->n_args = n_payload; ++ // No write barrier is needed here as this is a new allocation ++ // visible only from our stack + SET_HDR(ap, &stg_AP_NOUPD_info, cap->r.rCCCS) + Sp_subW(1); + goto nextInsn; +@@ -1447,6 +1456,8 @@ run_BCO: + SpW(-1) = (W_)pap; + pap->n_args = n_payload; + pap->arity = arity; ++ // No write barrier is needed here as this is a new allocation ++ // visible only from our stack + SET_HDR(pap, &stg_PAP_info, cap->r.rCCCS) + Sp_subW(1); + goto nextInsn; +@@ -1522,12 +1533,14 @@ run_BCO: + itbl->layout.payload.nptrs ); + StgClosure* con = (StgClosure*)allocate_NONUPD(cap,request); + ASSERT( itbl->layout.payload.ptrs + itbl->layout.payload.nptrs > 0); +- SET_HDR(con, (StgInfoTable*)BCO_LIT(o_itbl), cap->r.rCCCS); + for (i = 0; i < n_words; i++) { + con->payload[i] = (StgClosure*)SpW(i); + } + Sp_addW(n_words); + Sp_subW(1); ++ // No write barrier is needed here as this is a new allocation ++ // visible only from our stack ++ SET_HDR(con, (StgInfoTable*)BCO_LIT(o_itbl), cap->r.rCCCS); + SpW(0) = (W_)con; + IF_DEBUG(interpreter, + debugBelch("\tBuilt "); +diff --git a/rts/Linker.c b/rts/Linker.c +index b7e83858b0..7ed9e9d148 100644 +--- a/rts/Linker.c ++++ b/rts/Linker.c +@@ -192,7 +192,7 @@ int ocTryLoad( ObjectCode* oc ); + * + * MAP_32BIT not available on OpenBSD/amd64 + */ +-#if defined(x86_64_HOST_ARCH) && defined(MAP_32BIT) ++#if (defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) || defined(aarch64_TARGET_ARCH)) && defined(MAP_32BIT) + #define TRY_MAP_32BIT MAP_32BIT + #else + #define TRY_MAP_32BIT 0 +@@ -209,10 +209,16 @@ int ocTryLoad( ObjectCode* oc ); + * in the low 2Gb of the address space and try to allocate memory from + * there. + * ++ * The same holds for aarch64, where the default, even with PIC, model ++ * is 4GB. The linker is free to emit AARCH64_ADR_PREL_PG_HI21 ++ * relocations. ++ * + * We pick a default address based on the OS, but also make this + * configurable via an RTS flag (+RTS -xm) + */ +-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) ++#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) ++ ++#define MMAP_MAX_RETRY 100 + + #if defined(MAP_32BIT) + // Try to use MAP_32BIT +@@ -496,7 +502,7 @@ initLinker_ (int retain_cafs) + } + # endif + +-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) ++#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) + if (RtsFlags.MiscFlags.linkerMemBase != 0) { + // User-override for mmap_32bit_base + mmap_32bit_base = (void*)RtsFlags.MiscFlags.linkerMemBase; +@@ -1001,7 +1007,7 @@ resolveSymbolAddr (pathchar* buffer, int size, + // Returns NULL on failure. + // + void * +-mmapForLinker (size_t bytes, uint32_t flags, int fd, int offset) ++mmapForLinker (size_t bytes, uint32_t prot, uint32_t flags, int fd, int offset) + { + void *map_addr = NULL; + void *result; +@@ -1011,9 +1017,14 @@ mmapForLinker (size_t bytes, uint32_t flags, int fd, int offset) + IF_DEBUG(linker, debugBelch("mmapForLinker: start\n")); + size = roundUpToPage(bytes); + +-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) +-mmap_again: ++#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) || defined(aarch64_TARGET_ARCH) + ++ size_t mmap_counter = MMAP_MAX_RETRY; ++mmap_again: ++ if (0 == --mmap_counter) { ++ sysErrorBelch("mmap, small memory model: failed to allocate within 2GB after %d retries.\n", MMAP_MAX_RETRY); ++ stg_exit(EXIT_FAILURE); ++ } + if (mmap_32bit_base != 0) { + map_addr = mmap_32bit_base; + } +@@ -1021,13 +1032,13 @@ mmap_again: + + IF_DEBUG(linker, + debugBelch("mmapForLinker: \tprotection %#0x\n", +- PROT_EXEC | PROT_READ | PROT_WRITE)); ++ prot)); + IF_DEBUG(linker, + debugBelch("mmapForLinker: \tflags %#0x\n", + MAP_PRIVATE | TRY_MAP_32BIT | fixed | flags)); + + result = mmap(map_addr, size, +- PROT_EXEC|PROT_READ|PROT_WRITE, ++ prot, + MAP_PRIVATE|TRY_MAP_32BIT|fixed|flags, fd, offset); + + if (result == MAP_FAILED) { +@@ -1036,7 +1047,7 @@ mmap_again: + return NULL; + } + +-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) ++#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) || defined(aarch64_TARGET_ARCH) + if (mmap_32bit_base != 0) { + if (result == map_addr) { + mmap_32bit_base = (StgWord8*)map_addr + size; +@@ -1360,9 +1371,9 @@ preloadObjectFile (pathchar *path) + * See also the misalignment logic for darwin below. + */ + #if defined(ios_HOST_OS) +- image = mmap(NULL, fileSize, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); ++ image = mmapForLinker(fileSize, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); + #else +- image = mmap(NULL, fileSize, PROT_READ|PROT_WRITE|PROT_EXEC, ++ image = mmapForLinker(fileSize, PROT_READ|PROT_WRITE|PROT_EXEC, + MAP_PRIVATE, fd, 0); + #endif + +@@ -1820,4 +1831,3 @@ addSection (Section *s, SectionKind kind, SectionAlloc alloc, + start, (void*)((StgWord)start + size), + size, kind )); + } +- +diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h +index b48fc75966..f7ef0da81e 100644 +--- a/rts/LinkerInternals.h ++++ b/rts/LinkerInternals.h +@@ -246,7 +246,7 @@ void exitLinker( void ); + void freeObjectCode (ObjectCode *oc); + SymbolAddr* loadSymbol(SymbolName *lbl, RtsSymbolInfo *pinfo); + +-void *mmapForLinker (size_t bytes, uint32_t flags, int fd, int offset); ++void *mmapForLinker (size_t bytes, uint32_t prot, uint32_t flags, int fd, int offset); + + void addProddableBlock ( ObjectCode* oc, void* start, int size ); + void checkProddableBlock (ObjectCode *oc, void *addr, size_t size ); +diff --git a/rts/Messages.c b/rts/Messages.c +index 2b13b6306c..d878db5eda 100644 +--- a/rts/Messages.c ++++ b/rts/Messages.c +@@ -173,6 +173,7 @@ uint32_t messageBlackHole(Capability *cap, MessageBlackHole *msg) + "blackhole %p", (W_)msg->tso->id, msg->bh); + + info = bh->header.info; ++ load_load_barrier(); // See Note [Heap memory barriers] in SMP.h + + // If we got this message in our inbox, it might be that the + // BLACKHOLE has already been updated, and GC has shorted out the +@@ -196,6 +197,7 @@ loop: + // and turns this into an infinite loop. + p = UNTAG_CLOSURE((StgClosure*)VOLATILE_LOAD(&((StgInd*)bh)->indirectee)); + info = p->header.info; ++ load_load_barrier(); // See Note [Heap memory barriers] in SMP.h + + if (info == &stg_IND_info) + { +@@ -226,7 +228,6 @@ loop: + bq = (StgBlockingQueue*)allocate(cap, sizeofW(StgBlockingQueue)); + + // initialise the BLOCKING_QUEUE object +- SET_HDR(bq, &stg_BLOCKING_QUEUE_DIRTY_info, CCS_SYSTEM); + bq->bh = bh; + bq->queue = msg; + bq->owner = owner; +@@ -238,6 +239,11 @@ loop: + // a collision to update a BLACKHOLE and a BLOCKING_QUEUE + // becomes orphaned (see updateThunk()). + bq->link = owner->bq; ++ SET_HDR(bq, &stg_BLOCKING_QUEUE_DIRTY_info, CCS_SYSTEM); ++ // We are about to make the newly-constructed message visible to other cores; ++ // a barrier is necessary to ensure that all writes are visible. ++ // See Note [Heap memory barriers] in SMP.h. ++ write_barrier(); + owner->bq = bq; + dirty_TSO(cap, owner); // we modified owner->bq + +@@ -255,7 +261,7 @@ loop: + } + + // point to the BLOCKING_QUEUE from the BLACKHOLE +- write_barrier(); // make the BQ visible ++ write_barrier(); // make the BQ visible, see Note [Heap memory barriers]. + ((StgInd*)bh)->indirectee = (StgClosure *)bq; + recordClosureMutated(cap,bh); // bh was mutated + +@@ -286,10 +292,14 @@ loop: + + msg->link = bq->queue; + bq->queue = msg; ++ // No barrier is necessary here: we are only exposing the ++ // closure to the GC. See Note [Heap memory barriers] in SMP.h. + recordClosureMutated(cap,(StgClosure*)msg); + + if (info == &stg_BLOCKING_QUEUE_CLEAN_info) { + bq->header.info = &stg_BLOCKING_QUEUE_DIRTY_info; ++ // No barrier is necessary here: we are only exposing the ++ // closure to the GC. See Note [Heap memory barriers] in SMP.h. + recordClosureMutated(cap,(StgClosure*)bq); + } + +diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm +index cbb8e54e28..4274dfb50a 100644 +--- a/rts/PrimOps.cmm ++++ b/rts/PrimOps.cmm +@@ -105,6 +105,7 @@ stg_newPinnedByteArrayzh ( W_ n ) + to BA_ALIGN bytes: */ + p = p + ((-p - SIZEOF_StgArrBytes) & BA_MASK); + ++ /* No write barrier needed since this is a new allocation. */ + SET_HDR(p, stg_ARR_WORDS_info, CCCS); + StgArrBytes_bytes(p) = n; + return (p); +@@ -147,6 +148,7 @@ stg_newAlignedPinnedByteArrayzh ( W_ n, W_ alignment ) + is a power of 2, which is technically not guaranteed */ + p = p + ((-p - SIZEOF_StgArrBytes) & (alignment - 1)); + ++ /* No write barrier needed since this is a new allocation. */ + SET_HDR(p, stg_ARR_WORDS_info, CCCS); + StgArrBytes_bytes(p) = n; + return (p); +@@ -257,6 +259,7 @@ stg_newArrayzh ( W_ n /* words */, gcptr init ) + } + TICK_ALLOC_PRIM(SIZEOF_StgMutArrPtrs, WDS(size), 0); + ++ /* No write barrier needed since this is a new allocation. */ + SET_HDR(arr, stg_MUT_ARR_PTRS_DIRTY_info, CCCS); + StgMutArrPtrs_ptrs(arr) = n; + StgMutArrPtrs_size(arr) = size; +@@ -408,6 +411,7 @@ stg_newSmallArrayzh ( W_ n /* words */, gcptr init ) + } + TICK_ALLOC_PRIM(SIZEOF_StgSmallMutArrPtrs, WDS(n), 0); + ++ /* No write barrier needed since this is a new allocation. */ + SET_HDR(arr, stg_SMALL_MUT_ARR_PTRS_DIRTY_info, CCCS); + StgSmallMutArrPtrs_ptrs(arr) = n; + +@@ -522,6 +526,7 @@ stg_newMutVarzh ( gcptr init ) + ALLOC_PRIM_P (SIZEOF_StgMutVar, stg_newMutVarzh, init); + + mv = Hp - SIZEOF_StgMutVar + WDS(1); ++ /* No write barrier needed since this is a new allocation. */ + SET_HDR(mv,stg_MUT_VAR_DIRTY_info,CCCS); + StgMutVar_var(mv) = init; + +@@ -655,6 +660,7 @@ stg_mkWeakzh ( gcptr key, + ALLOC_PRIM (SIZEOF_StgWeak) + + w = Hp - SIZEOF_StgWeak + WDS(1); ++ // No memory barrier needed as this is a new allocation. + SET_HDR(w, stg_WEAK_info, CCCS); + + StgWeak_key(w) = key; +@@ -770,6 +776,7 @@ stg_deRefWeakzh ( gcptr w ) + gcptr val; + + info = GET_INFO(w); ++ prim_read_barrier; + + if (info == stg_WHITEHOLE_info) { + // w is locked by another thread. Now it's not immediately clear if w is +@@ -1341,11 +1348,13 @@ stg_readTVarzh (P_ tvar) + + stg_readTVarIOzh ( P_ tvar /* :: TVar a */ ) + { +- W_ result; ++ W_ result, resultinfo; + + again: + result = StgTVar_current_value(tvar); +- if (%INFO_PTR(result) == stg_TREC_HEADER_info) { ++ resultinfo = %INFO_PTR(result); ++ prim_read_barrier; ++ if (resultinfo == stg_TREC_HEADER_info) { + goto again; + } + return (result); +@@ -1414,6 +1423,7 @@ stg_newMVarzh () + ALLOC_PRIM_ (SIZEOF_StgMVar, stg_newMVarzh); + + mvar = Hp - SIZEOF_StgMVar + WDS(1); ++ // No memory barrier needed as this is a new allocation. + SET_HDR(mvar,stg_MVAR_DIRTY_info,CCCS); + // MVARs start dirty: generation 0 has no mutable list + StgMVar_head(mvar) = stg_END_TSO_QUEUE_closure; +@@ -1438,7 +1448,7 @@ stg_newMVarzh () + + stg_takeMVarzh ( P_ mvar /* :: MVar a */ ) + { +- W_ val, info, tso, q; ++ W_ val, info, tso, q, qinfo; + + LOCK_CLOSURE(mvar, info); + +@@ -1460,9 +1470,12 @@ stg_takeMVarzh ( P_ mvar /* :: MVar a */ ) + + q = Hp - SIZEOF_StgMVarTSOQueue + WDS(1); + +- SET_HDR(q, stg_MVAR_TSO_QUEUE_info, CCS_SYSTEM); + StgMVarTSOQueue_link(q) = END_TSO_QUEUE; + StgMVarTSOQueue_tso(q) = CurrentTSO; ++ SET_HDR(q, stg_MVAR_TSO_QUEUE_info, CCS_SYSTEM); ++ // Write barrier before we make the new MVAR_TSO_QUEUE ++ // visible to other cores. ++ prim_write_barrier; + + if (StgMVar_head(mvar) == stg_END_TSO_QUEUE_closure) { + StgMVar_head(mvar) = q; +@@ -1492,8 +1505,10 @@ loop: + unlockClosure(mvar, info); + return (val); + } +- if (StgHeader_info(q) == stg_IND_info || +- StgHeader_info(q) == stg_MSG_NULL_info) { ++ qinfo = StgHeader_info(q); ++ prim_read_barrier; ++ if (qinfo == stg_IND_info || ++ qinfo == stg_MSG_NULL_info) { + q = StgInd_indirectee(q); + goto loop; + } +@@ -1531,7 +1546,7 @@ loop: + + stg_tryTakeMVarzh ( P_ mvar /* :: MVar a */ ) + { +- W_ val, info, tso, q; ++ W_ val, info, tso, q, qinfo; + + LOCK_CLOSURE(mvar, info); + +@@ -1558,8 +1573,11 @@ loop: + return (1, val); + } + +- if (StgHeader_info(q) == stg_IND_info || +- StgHeader_info(q) == stg_MSG_NULL_info) { ++ qinfo = StgHeader_info(q); ++ prim_read_barrier; ++ ++ if (qinfo == stg_IND_info || ++ qinfo == stg_MSG_NULL_info) { + q = StgInd_indirectee(q); + goto loop; + } +@@ -1598,7 +1616,7 @@ loop: + stg_putMVarzh ( P_ mvar, /* :: MVar a */ + P_ val, /* :: a */ ) + { +- W_ info, tso, q; ++ W_ info, tso, q, qinfo; + + LOCK_CLOSURE(mvar, info); + +@@ -1618,10 +1636,12 @@ stg_putMVarzh ( P_ mvar, /* :: MVar a */ + + q = Hp - SIZEOF_StgMVarTSOQueue + WDS(1); + +- SET_HDR(q, stg_MVAR_TSO_QUEUE_info, CCS_SYSTEM); + StgMVarTSOQueue_link(q) = END_TSO_QUEUE; + StgMVarTSOQueue_tso(q) = CurrentTSO; + ++ SET_HDR(q, stg_MVAR_TSO_QUEUE_info, CCS_SYSTEM); ++ prim_write_barrier; ++ + if (StgMVar_head(mvar) == stg_END_TSO_QUEUE_closure) { + StgMVar_head(mvar) = q; + } else { +@@ -1648,8 +1668,12 @@ loop: + unlockClosure(mvar, stg_MVAR_DIRTY_info); + return (); + } +- if (StgHeader_info(q) == stg_IND_info || +- StgHeader_info(q) == stg_MSG_NULL_info) { ++ ++ qinfo = StgHeader_info(q); ++ prim_read_barrier; ++ ++ if (qinfo == stg_IND_info || ++ qinfo == stg_MSG_NULL_info) { + q = StgInd_indirectee(q); + goto loop; + } +@@ -1706,7 +1730,7 @@ loop: + stg_tryPutMVarzh ( P_ mvar, /* :: MVar a */ + P_ val, /* :: a */ ) + { +- W_ info, tso, q; ++ W_ info, tso, q, qinfo; + + LOCK_CLOSURE(mvar, info); + +@@ -1729,8 +1753,12 @@ loop: + unlockClosure(mvar, stg_MVAR_DIRTY_info); + return (1); + } +- if (StgHeader_info(q) == stg_IND_info || +- StgHeader_info(q) == stg_MSG_NULL_info) { ++ ++ qinfo = StgHeader_info(q); ++ prim_read_barrier; ++ ++ if (qinfo == stg_IND_info || ++ qinfo == stg_MSG_NULL_info) { + q = StgInd_indirectee(q); + goto loop; + } +@@ -1801,10 +1829,12 @@ stg_readMVarzh ( P_ mvar, /* :: MVar a */ ) + + // readMVars are pushed to the front of the queue, so + // they get handled immediately +- SET_HDR(q, stg_MVAR_TSO_QUEUE_info, CCS_SYSTEM); + StgMVarTSOQueue_link(q) = StgMVar_head(mvar); + StgMVarTSOQueue_tso(q) = CurrentTSO; + ++ SET_HDR(q, stg_MVAR_TSO_QUEUE_info, CCS_SYSTEM); ++ prim_write_barrier; ++ + StgTSO__link(CurrentTSO) = q; + StgTSO_block_info(CurrentTSO) = mvar; + StgTSO_why_blocked(CurrentTSO) = BlockedOnMVarRead::I16; +@@ -1869,6 +1899,10 @@ stg_makeStableNamezh ( P_ obj ) + BYTES_TO_WDS(SIZEOF_StgStableName)); + SET_HDR(sn_obj, stg_STABLE_NAME_info, CCCS); + StgStableName_sn(sn_obj) = index; ++ // This will make the StableName# object visible to other threads; ++ // be sure that its completely visible to other cores. ++ // See Note [Heap memory barriers] in SMP.h. ++ prim_write_barrier; + snEntry_sn_obj(W_[stable_name_table] + index*SIZEOF_snEntry) = sn_obj; + } else { + sn_obj = snEntry_sn_obj(W_[stable_name_table] + index*SIZEOF_snEntry); +@@ -1910,6 +1944,7 @@ stg_newBCOzh ( P_ instrs, + ALLOC_PRIM (bytes); + + bco = Hp - bytes + WDS(1); ++ // No memory barrier necessary as this is a new allocation. + SET_HDR(bco, stg_BCO_info, CCS_MAIN); + + StgBCO_instrs(bco) = instrs; +@@ -1946,6 +1981,7 @@ stg_mkApUpd0zh ( P_ bco ) + CCCS_ALLOC(SIZEOF_StgAP); + + ap = Hp - SIZEOF_StgAP + WDS(1); ++ // No memory barrier necessary as this is a new allocation. + SET_HDR(ap, stg_AP_info, CCS_MAIN); + + StgAP_n_args(ap) = HALF_W_(0); +@@ -1958,6 +1994,7 @@ stg_unpackClosurezh ( P_ closure ) + { + W_ info, ptrs, nptrs, p, ptrs_arr, dat_arr; + info = %GET_STD_INFO(UNTAG(closure)); ++ prim_read_barrier; + + ptrs = TO_W_(%INFO_PTRS(info)); + nptrs = TO_W_(%INFO_NPTRS(info)); +@@ -2279,7 +2316,10 @@ stg_noDuplicatezh /* no arg list: explicit stack layout */ + + stg_getApStackValzh ( P_ ap_stack, W_ offset ) + { +- if (%INFO_PTR(UNTAG(ap_stack)) == stg_AP_STACK_info) { ++ W_ ap_stackinfo; ++ ap_stackinfo = %INFO_PTR(UNTAG(ap_stack)); ++ prim_read_barrier; ++ if (ap_stackinfo == stg_AP_STACK_info) { + return (1,StgAP_STACK_payload(ap_stack,offset)); + } else { + return (0,ap_stack); +diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c +index ddd6d39ffb..59de87916e 100644 +--- a/rts/RaiseAsync.c ++++ b/rts/RaiseAsync.c +@@ -870,6 +870,7 @@ raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception, + ap->payload[i] = (StgClosure *)*sp++; + } + ++ write_barrier(); // XXX: Necessary? + SET_HDR(ap,&stg_AP_STACK_info, + ((StgClosure *)frame)->header.prof.ccs /* ToDo */); + TICK_ALLOC_UP_THK(WDS(words+1),0); +diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c +index 87fa98dd4f..ccfed93714 100644 +--- a/rts/RtsSymbols.c ++++ b/rts/RtsSymbols.c +@@ -53,7 +53,6 @@ + SymI_HasProto(signal_handlers) \ + SymI_HasProto(stg_sig_install) \ + SymI_HasProto(rtsTimerSignal) \ +- SymI_HasProto(atexit) \ + SymI_NeedsDataProto(nocldstop) + #endif + +@@ -932,26 +931,187 @@ + RTS_USER_SIGNALS_SYMBOLS \ + RTS_INTCHAR_SYMBOLS + +- + // 64-bit support functions in libgcc.a ++// See https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc + #if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32) + #define RTS_LIBGCC_SYMBOLS \ +- SymI_NeedsProto(__divdi3) \ +- SymI_NeedsProto(__udivdi3) \ +- SymI_NeedsProto(__moddi3) \ +- SymI_NeedsProto(__umoddi3) \ +- SymI_NeedsProto(__muldi3) \ +- SymI_NeedsProto(__ashldi3) \ +- SymI_NeedsProto(__ashrdi3) \ +- SymI_NeedsProto(__lshrdi3) \ +- SymI_NeedsProto(__fixunsdfdi) ++ SymI_NeedsProto(__fixunsdfdi) \ ++ /* 4 The GCC low-level runtime library */\ ++ /* 4.1.1 Arithmetic functions */\ ++ /* SymI_NeedsProto(__ashlsi3) */\ ++ SymI_NeedsProto(__ashldi3) \ ++ /* SymI_NeedsProto(__ashlti3) */\ ++ /* These functions return the result of shifting a left by b bits. */\ ++ /* SymI_NeedsProto(__ashrsi3) */\ ++ SymI_NeedsProto(__ashrdi3) \ ++ /* SymI_NeedsProto(__ashrti3) */\ ++ /* These functions return the result of arithmetically shifting a right by b bits. */\ ++ /* SymI_NeedsProto(__divsi3) */\ ++ SymI_NeedsProto(__divdi3) \ ++ /* SymI_NeedsProto(__divti3) */\ ++ /* These functions return the quotient of the signed division of a and b. */\ ++ /* SymI_NeedsProto(__lshrsi3) */ \ ++ SymI_NeedsProto(__lshrdi3) \ ++ /* SymI_NeedsProto(__lshrti3) */ \ ++ /* These functions return the result of logically shifting a right by b bits. */\ ++ /* SymI_NeedsProto(__modsi3) */ \ ++ SymI_NeedsProto(__moddi3) \ ++ /* SymI_NeedsProto(__modti3) */ \ ++ /* These functions return the remainder of the signed division of a and b. */\ ++ /* SymI_NeedsProto(__mulsi3) */ \ ++ SymI_NeedsProto(__muldi3) \ ++ /* SymI_NeedsProto(__multi3) */ \ ++ /* These functions return the product of a and b. */\ ++ SymI_NeedsProto(__negdi2) \ ++ /* SymI_NeedsProto(__negti2) */ \ ++ /* These functions return the negation of a. */\ ++ /* SymI_NeedsProto(__udivsi3) */ \ ++ SymI_NeedsProto(__udivdi3) \ ++ /* SymI_NeedsProto(__udivti3) */ \ ++ /* These functions return the quotient of the unsigned division of a and b. */\ ++ SymI_NeedsProto(__udivmoddi4) \ ++ /* SymI_NeedsProto(__udivmodti4) */ \ ++ /* These functions calculate both the quotient and remainder of the unsigned division of a and b. The return value is the quotient, and the remainder is placed in variable pointed to by c. */\ ++ /* SymI_NeedsProto(__umodsi3) */ \ ++ SymI_NeedsProto(__umoddi3) \ ++ /* SymI_NeedsProto(__umodti3) */ \ ++ /* These functions return the remainder of the unsigned division of a and b. */\ ++ /* 4.1.2 Comparison functions */\ ++ /* The following functions implement integral comparisons. These functions implement a low-level compare, upon which the higher level comparison operators (such as less than and greater than or equal to) can be constructed. The returned values lie in the range zero to two, to allow the high-level operators to be implemented by testing the returned result using either signed or unsigned comparison. */\ ++ SymI_NeedsProto(__cmpdi2) \ ++ /* SymI_NeedsProto(__cmpti2) */ \ ++ /* These functions perform a signed comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\ ++ SymI_NeedsProto(__ucmpdi2) \ ++ /* SymI_NeedsProto(__ucmpti2) */ \ ++ /* These functions perform an unsigned comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\ ++ /* 4.1.3 Trapping arithmetic functions */\ ++ /* The following functions implement trapping arithmetic. These functions call the libc function abort upon signed arithmetic overflow. */\ ++ SymI_NeedsProto(__absvsi2) \ ++ SymI_NeedsProto(__absvdi2) \ ++ /* These functions return the absolute value of a. */\ ++ /* SymI_NeedsProto(__addvsi3) */ \ ++ SymI_NeedsProto(__addvdi3) \ ++ /* These functions return the sum of a and b; that is a + b. */\ ++ /* SymI_NeedsProto(__mulvsi3) */ \ ++ SymI_NeedsProto(__mulvdi3) \ ++ /* The functions return the product of a and b; that is a * b. */\ ++ SymI_NeedsProto(__negvsi2) \ ++ SymI_NeedsProto(__negvdi2) \ ++ /* These functions return the negation of a; that is -a. */\ ++ /* SymI_NeedsProto(__subvsi3) */ \ ++ SymI_NeedsProto(__subvdi3) \ ++ /* These functions return the difference between b and a; that is a - b. */\ ++ /* 4.1.4 Bit operations */\ ++ SymI_NeedsProto(__clzsi2) \ ++ SymI_NeedsProto(__clzdi2) \ ++ /* SymI_NeedsProto(__clzti2) */ \ ++ /* These functions return the number of leading 0-bits in a, starting at the most significant bit position. If a is zero, the result is undefined. */\ ++ SymI_NeedsProto(__ctzsi2) \ ++ SymI_NeedsProto(__ctzdi2) \ ++ /* SymI_NeedsProto(__ctzti2) */ \ ++ /* These functions return the number of trailing 0-bits in a, starting at the least significant bit position. If a is zero, the result is undefined. */\ ++ SymI_NeedsProto(__ffsdi2) \ ++ /* SymI_NeedsProto(__ffsti2) */ \ ++ /* These functions return the index of the least significant 1-bit in a, or the value zero if a is zero. The least significant bit is index one. */\ ++ SymI_NeedsProto(__paritysi2) \ ++ SymI_NeedsProto(__paritydi2) \ ++ /* SymI_NeedsProto(__parityti2) */\ ++ /* These functions return the value zero if the number of bits set in a is even, and the value one otherwise. */\ ++ SymI_NeedsProto(__popcountsi2) \ ++ SymI_NeedsProto(__popcountdi2) \ ++ /* SymI_NeedsProto(__popcountti2) */ \ ++ /* These functions return the number of bits set in a. */\ ++ SymI_NeedsProto(__bswapsi2) \ ++ SymI_NeedsProto(__bswapdi2) \ ++ /* armv6l */\ ++ /* TODO: should check for __ARM_EABI__ */\ ++ SymI_NeedsProto(__aeabi_d2f) \ ++ SymI_NeedsProto(__aeabi_d2iz) \ ++ SymI_NeedsProto(__aeabi_d2lz) \ ++ SymI_NeedsProto(__aeabi_d2uiz) \ ++ SymI_NeedsProto(__aeabi_d2ulz) \ ++ SymI_NeedsProto(__aeabi_dadd) \ ++ SymI_NeedsProto(__aeabi_dcmpeq) \ ++ SymI_NeedsProto(__aeabi_dcmpge) \ ++ SymI_NeedsProto(__aeabi_dcmpgt) \ ++ SymI_NeedsProto(__aeabi_dcmple) \ ++ SymI_NeedsProto(__aeabi_dcmplt) \ ++ SymI_NeedsProto(__aeabi_dcmpun) \ ++ SymI_NeedsProto(__aeabi_ddiv) \ ++ SymI_NeedsProto(__aeabi_dmul) \ ++ SymI_NeedsProto(__aeabi_dneg) \ ++ SymI_NeedsProto(__aeabi_dsub) \ ++ SymI_NeedsProto(__aeabi_f2d) \ ++ SymI_NeedsProto(__aeabi_f2iz) \ ++ SymI_NeedsProto(__aeabi_f2lz) \ ++ SymI_NeedsProto(__aeabi_f2uiz) \ ++ SymI_NeedsProto(__aeabi_f2ulz) \ ++ SymI_NeedsProto(__aeabi_fadd) \ ++ SymI_NeedsProto(__aeabi_fcmpeq) \ ++ SymI_NeedsProto(__aeabi_fcmpge) \ ++ SymI_NeedsProto(__aeabi_fcmpgt) \ ++ SymI_NeedsProto(__aeabi_fcmple) \ ++ SymI_NeedsProto(__aeabi_fcmplt) \ ++ SymI_NeedsProto(__aeabi_fcmpun) \ ++ SymI_NeedsProto(__aeabi_fdiv) \ ++ SymI_NeedsProto(__aeabi_fmul) \ ++ SymI_NeedsProto(__aeabi_fneg) \ ++ SymI_NeedsProto(__aeabi_fsub) \ ++ SymI_NeedsProto(__aeabi_i2d) \ ++ SymI_NeedsProto(__aeabi_i2f) \ ++ SymI_NeedsProto(__aeabi_idiv) \ ++ SymI_NeedsProto(__aeabi_idivmod) \ ++ SymI_NeedsProto(__aeabi_l2d) \ ++ SymI_NeedsProto(__aeabi_l2f) \ ++ SymI_NeedsProto(__aeabi_lasr) \ ++ SymI_NeedsProto(__aeabi_lcmp) \ ++ SymI_NeedsProto(__aeabi_ldivmod) \ ++ SymI_NeedsProto(__aeabi_llsl) \ ++ SymI_NeedsProto(__aeabi_llsr) \ ++ SymI_NeedsProto(__aeabi_lmul) \ ++ SymI_NeedsProto(__aeabi_ui2d) \ ++ SymI_NeedsProto(__aeabi_ui2f) \ ++ SymI_NeedsProto(__aeabi_uidiv) \ ++ SymI_NeedsProto(__aeabi_uidivmod) \ ++ SymI_NeedsProto(__aeabi_ul2d) \ ++ SymI_NeedsProto(__aeabi_ul2f) \ ++ SymI_NeedsProto(__aeabi_ulcmp) \ ++ SymI_NeedsProto(__aeabi_uldivmod) ++ + #elif defined(__GNUC__) && SIZEOF_VOID_P == 8 + #define RTS_LIBGCC_SYMBOLS \ + SymI_NeedsProto(__udivti3) \ +- SymI_NeedsProto(__umodti3) ++ SymI_NeedsProto(__umodti3) \ ++ /* for aarch64 */\ ++ SymI_NeedsProto(__netf2) \ ++ SymI_NeedsProto(__addtf3) \ ++ SymI_NeedsProto(__subtf3) \ ++ SymI_NeedsProto(__multf3) \ ++ SymI_NeedsProto(__extenddftf2) \ ++ SymI_NeedsProto(__fixtfsi) \ ++ SymI_NeedsProto(__fixunstfsi) \ ++ SymI_NeedsProto(__floatsitf) \ ++ SymI_NeedsProto(__floatunsitf) + #else + #define RTS_LIBGCC_SYMBOLS + #endif ++#if !defined(mingw32_HOST_OS) ++#define RTS_SSP_SYMBOLS \ ++ SymI_NeedsProto(__stack_chk_guard) \ ++ SymI_NeedsProto(__stack_chk_fail) ++#else ++#define RTS_SSP_SYMBOLS ++#endif ++#if !defined(DYNAMIC) && !defined(mingw32_HOST_OS) ++// we need these for static musl builds. However when ++// linking shared objects (DLLs) this will fail, hence ++// we do not include them when building with -DDYNAMIC ++#define RTS_LINKER_SYMBOLS \ ++ SymI_NeedsProto(__fini_array_start) \ ++ SymI_NeedsProto(__fini_array_end) ++#else ++#define RTS_LINKER_SYMBOLS ++#endif + + #if defined(darwin_HOST_OS) && defined(powerpc_HOST_ARCH) + // Symbols that don't have a leading underscore +@@ -963,7 +1123,11 @@ + #endif + + /* entirely bogus claims about types of these symbols */ +-#define SymI_NeedsProto(vvv) extern void vvv(void); ++/* to prevent a bit of define expansion, SymI_NeedsProto is a variadic ++ * macro. And we'll concat vvv with the __VA_ARGS__. This prevents ++ * vvv from getting macro expanded. ++ */ ++#define SymI_NeedsProto(vvv,...) extern void vvv ## __VA_ARGS__ (void); + #define SymI_NeedsDataProto(vvv) extern StgWord vvv[]; + #if defined(COMPILING_WINDOWS_DLL) + #define SymE_HasProto(vvv) SymE_HasProto(vvv); +@@ -990,6 +1154,8 @@ RTS_DARWIN_ONLY_SYMBOLS + RTS_OPENBSD_ONLY_SYMBOLS + RTS_LIBGCC_SYMBOLS + RTS_LIBFFI_SYMBOLS ++RTS_SSP_SYMBOLS ++RTS_LINKER_SYMBOLS + #undef SymI_NeedsProto + #undef SymI_NeedsDataProto + #undef SymI_HasProto +@@ -1009,7 +1175,7 @@ RTS_LIBFFI_SYMBOLS + #define SymE_HasDataProto(vvv) \ + SymE_HasProto(vvv) + +-#define SymI_NeedsProto(vvv) SymI_HasProto(vvv) ++#define SymI_NeedsProto(vvv,...) SymI_HasProto(vvv ## __VA_ARGS__) + #define SymI_NeedsDataProto(vvv) SymI_HasDataProto(vvv) + #define SymE_NeedsProto(vvv) SymE_HasProto(vvv) + #define SymE_NeedsDataProto(vvv) SymE_HasDataProto(vvv) +@@ -1030,6 +1196,8 @@ RTS_LIBFFI_SYMBOLS + #define SymI_HasProto_deprecated(vvv) \ + { #vvv, (void*)0xBAADF00D, true }, + ++void *RTS_DYNAMIC = NULL; ++ + RtsSymbolVal rtsSyms[] = { + RTS_SYMBOLS + RTS_RET_SYMBOLS +@@ -1040,11 +1208,14 @@ RtsSymbolVal rtsSyms[] = { + RTS_OPENBSD_ONLY_SYMBOLS + RTS_LIBGCC_SYMBOLS + RTS_LIBFFI_SYMBOLS ++ RTS_SSP_SYMBOLS ++ RTS_LINKER_SYMBOLS + #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH) + // dyld stub code contains references to this, + // but it should never be called because we treat + // lazy pointers as nonlazy. + { "dyld_stub_binding_helper", (void*)0xDEADBEEF, false }, + #endif ++ { "_DYNAMIC", (void*)(&RTS_DYNAMIC), false }, + { 0, 0, false } /* sentinel */ + }; +diff --git a/rts/Sparks.c b/rts/Sparks.c +index bd5e120863..4022691da2 100644 +--- a/rts/Sparks.c ++++ b/rts/Sparks.c +@@ -182,6 +182,7 @@ pruneSparkQueue (Capability *cap) + traceEventSparkFizzle(cap); + } else { + info = spark->header.info; ++ load_load_barrier(); + if (IS_FORWARDING_PTR(info)) { + tmp = (StgClosure*)UN_FORWARDING_PTR(info); + /* if valuable work: shift inside the pool */ +diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm +index e645442033..b368bdad2e 100644 +--- a/rts/StgMiscClosures.cmm ++++ b/rts/StgMiscClosures.cmm +@@ -292,12 +292,14 @@ INFO_TABLE(stg_BLACKHOLE,1,0,BLACKHOLE,"BLACKHOLE","BLACKHOLE") + TICK_ENT_DYN_IND(); /* tick */ + + retry: ++ prim_read_barrier; + p = StgInd_indirectee(node); + if (GETTAG(p) != 0) { + return (p); + } + + info = StgHeader_info(p); ++ prim_read_barrier; + if (info == stg_IND_info) { + // This could happen, if e.g. we got a BLOCKING_QUEUE that has + // just been replaced with an IND by another thread in +@@ -313,9 +315,11 @@ retry: + ("ptr" msg) = ccall allocate(MyCapability() "ptr", + BYTES_TO_WDS(SIZEOF_MessageBlackHole)); + +- SET_HDR(msg, stg_MSG_BLACKHOLE_info, CCS_SYSTEM); + MessageBlackHole_tso(msg) = CurrentTSO; + MessageBlackHole_bh(msg) = node; ++ SET_HDR(msg, stg_MSG_BLACKHOLE_info, CCS_SYSTEM); ++ // messageBlackHole has appropriate memory barriers when this object is exposed. ++ // See Note [Heap memory barriers]. + + (r) = ccall messageBlackHole(MyCapability() "ptr", msg "ptr"); + +diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c +index 3f7bddeb79..eca2bb7c72 100644 +--- a/rts/ThreadPaused.c ++++ b/rts/ThreadPaused.c +@@ -195,6 +195,7 @@ threadPaused(Capability *cap, StgTSO *tso) + const StgRetInfoTable *info; + const StgInfoTable *bh_info; + const StgInfoTable *cur_bh_info USED_IF_THREADS; ++ const StgInfoTable *frame_info; + StgClosure *bh; + StgPtr stack_end; + uint32_t words_to_squeeze = 0; +@@ -218,6 +219,8 @@ threadPaused(Capability *cap, StgTSO *tso) + + frame = (StgClosure *)tso->stackobj->sp; + ++ // N.B. We know that the TSO is owned by the current capability so no ++ // memory barriers are needed here. + while ((P_)frame < stack_end) { + info = get_ret_itbl(frame); + +@@ -226,7 +229,8 @@ threadPaused(Capability *cap, StgTSO *tso) + case UPDATE_FRAME: + + // If we've already marked this frame, then stop here. +- if (frame->header.info == (StgInfoTable *)&stg_marked_upd_frame_info) { ++ frame_info = frame->header.info; ++ if (frame_info == (StgInfoTable *)&stg_marked_upd_frame_info) { + if (prev_was_update_frame) { + words_to_squeeze += sizeofW(StgUpdateFrame); + weight += weight_pending; +diff --git a/rts/Threads.c b/rts/Threads.c +index 78c5b6cc84..dc733d3dba 100644 +--- a/rts/Threads.c ++++ b/rts/Threads.c +@@ -126,6 +126,8 @@ createThread(Capability *cap, W_ size) + ACQUIRE_LOCK(&sched_mutex); + tso->id = next_thread_id++; // while we have the mutex + tso->global_link = g0->threads; ++ /* Mutations above need no memory barrier since this lock will provide ++ * a release barrier */ + g0->threads = tso; + RELEASE_LOCK(&sched_mutex); + +@@ -257,8 +259,10 @@ tryWakeupThread (Capability *cap, StgTSO *tso) + { + MessageWakeup *msg; + msg = (MessageWakeup *)allocate(cap,sizeofW(MessageWakeup)); +- SET_HDR(msg, &stg_MSG_TRY_WAKEUP_info, CCS_SYSTEM); + msg->tso = tso; ++ SET_HDR(msg, &stg_MSG_TRY_WAKEUP_info, CCS_SYSTEM); ++ // Ensure that writes constructing Message are committed before sending. ++ write_barrier(); + sendMessage(cap, tso->cap, (Message*)msg); + debugTraceCap(DEBUG_sched, cap, "message: try wakeup thread %ld on cap %d", + (W_)tso->id, tso->cap->no); +@@ -363,6 +367,7 @@ wakeBlockingQueue(Capability *cap, StgBlockingQueue *bq) + for (msg = bq->queue; msg != (MessageBlackHole*)END_TSO_QUEUE; + msg = msg->link) { + i = msg->header.info; ++ load_load_barrier(); + if (i != &stg_IND_info) { + ASSERT(i == &stg_MSG_BLACKHOLE_info); + tryWakeupThread(cap,msg->tso); +@@ -398,15 +403,18 @@ checkBlockingQueues (Capability *cap, StgTSO *tso) + for (bq = tso->bq; bq != (StgBlockingQueue*)END_TSO_QUEUE; bq = next) { + next = bq->link; + +- if (bq->header.info == &stg_IND_info) { ++ const StgInfoTable *bqinfo = bq->header.info; ++ load_load_barrier(); // XXX: Is this needed? ++ if (bqinfo == &stg_IND_info) { + // ToDo: could short it out right here, to avoid + // traversing this IND multiple times. + continue; + } + + p = bq->bh; +- +- if (p->header.info != &stg_BLACKHOLE_info || ++ const StgInfoTable *pinfo = p->header.info; ++ load_load_barrier(); ++ if (pinfo != &stg_BLACKHOLE_info || + ((StgInd *)p)->indirectee != (StgClosure*)bq) + { + wakeBlockingQueue(cap,bq); +@@ -430,6 +438,7 @@ updateThunk (Capability *cap, StgTSO *tso, StgClosure *thunk, StgClosure *val) + const StgInfoTable *i; + + i = thunk->header.info; ++ load_load_barrier(); + if (i != &stg_BLACKHOLE_info && + i != &stg_CAF_BLACKHOLE_info && + i != &__stg_EAGER_BLACKHOLE_info && +@@ -450,6 +459,7 @@ updateThunk (Capability *cap, StgTSO *tso, StgClosure *thunk, StgClosure *val) + } + + i = v->header.info; ++ load_load_barrier(); + if (i == &stg_TSO_info) { + checkBlockingQueues(cap, tso); + return; +@@ -673,6 +683,8 @@ threadStackOverflow (Capability *cap, StgTSO *tso) + new_stack->sp -= chunk_words; + } + ++ // No write barriers needed; all of the writes above are to structured ++ // owned by our capability. + tso->stackobj = new_stack; + + // we're about to run it, better mark it dirty +@@ -744,6 +756,7 @@ threadStackUnderflow (Capability *cap, StgTSO *tso) + bool performTryPutMVar(Capability *cap, StgMVar *mvar, StgClosure *value) + { + const StgInfoTable *info; ++ const StgInfoTable *qinfo; + StgMVarTSOQueue *q; + StgTSO *tso; + +@@ -768,8 +781,11 @@ loop: + unlockClosure((StgClosure*)mvar, &stg_MVAR_DIRTY_info); + return true; + } +- if (q->header.info == &stg_IND_info || +- q->header.info == &stg_MSG_NULL_info) { ++ ++ qinfo = q->header.info; ++ load_load_barrier(); ++ if (qinfo == &stg_IND_info || ++ qinfo == &stg_MSG_NULL_info) { + q = (StgMVarTSOQueue*)((StgInd*)q)->indirectee; + goto loop; + } +diff --git a/rts/TopHandler.c b/rts/TopHandler.c +index 8e868e6e92..dd8d6a7ab7 100644 +--- a/rts/TopHandler.c ++++ b/rts/TopHandler.c +@@ -29,6 +29,7 @@ StgTSO *getTopHandlerThread(void) { + StgWeak *weak = (StgWeak*)deRefStablePtr(topHandlerPtr); + RELEASE_LOCK(&m); + const StgInfoTable *info = weak->header.info; ++ load_load_barrier(); + if (info == &stg_WEAK_info) { + StgClosure *key = ((StgWeak*)weak)->key; + +diff --git a/rts/Updates.h b/rts/Updates.h +index 1ba398bd35..1bd3e065af 100644 +--- a/rts/Updates.h ++++ b/rts/Updates.h +@@ -39,10 +39,16 @@ + PROF_HDR_FIELDS(w_,ccs,p2) \ + p_ updatee + +- ++/* ++ * Getting the memory barriers correct here is quite tricky. Essentially ++ * the write barrier ensures that any writes to the new indirectee are visible ++ * before we introduce the indirection. ++ * See Note [Heap memory barriers] in SMP.h. ++ */ + #define updateWithIndirection(p1, p2, and_then) \ + W_ bd; \ + \ ++ prim_write_barrier; \ + OVERWRITING_CLOSURE(p1); \ + StgInd_indirectee(p1) = p2; \ + prim_write_barrier; \ +@@ -69,6 +75,8 @@ INLINE_HEADER void updateWithIndirection (Capability *cap, + ASSERT( (P_)p1 != (P_)p2 ); + /* not necessarily true: ASSERT( !closure_IND(p1) ); */ + /* occurs in RaiseAsync.c:raiseAsync() */ ++ /* See Note [Heap memory barriers] in SMP.h */ ++ write_barrier(); + OVERWRITING_CLOSURE(p1); + ((StgInd *)p1)->indirectee = p2; + write_barrier(); +diff --git a/rts/Weak.c b/rts/Weak.c +index a322d822af..ec998c214f 100644 +--- a/rts/Weak.c ++++ b/rts/Weak.c +@@ -57,7 +57,9 @@ runAllCFinalizers(StgWeak *list) + // If there's no major GC between the time that the finalizer for the + // object from the oldest generation is manually called and shutdown + // we end up running the same finalizer twice. See #7170. +- if (w->header.info != &stg_DEAD_WEAK_info) { ++ const StgInfoTable *winfo = w->header.info; ++ load_load_barrier(); ++ if (winfo != &stg_DEAD_WEAK_info) { + runCFinalizers((StgCFinalizerList *)w->cfinalizers); + } + } +@@ -138,6 +140,7 @@ scheduleFinalizers(Capability *cap, StgWeak *list) + size = n + mutArrPtrsCardTableSize(n); + arr = (StgMutArrPtrs *)allocate(cap, sizeofW(StgMutArrPtrs) + size); + TICK_ALLOC_PRIM(sizeofW(StgMutArrPtrs), n, 0); ++ // No write barrier needed here; this array is only going to referred to by this core. + SET_HDR(arr, &stg_MUT_ARR_PTRS_FROZEN_CLEAN_info, CCS_SYSTEM); + arr->ptrs = n; + arr->size = size; +diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c +index ede0482c6b..8e477c0425 100644 +--- a/rts/linker/Elf.c ++++ b/rts/linker/Elf.c +@@ -626,7 +626,7 @@ mapObjectFileSection (int fd, Elf_Word offset, Elf_Word size, + + pageOffset = roundDownToPage(offset); + pageSize = roundUpToPage(offset-pageOffset+size); +- p = mmapForLinker(pageSize, 0, fd, pageOffset); ++ p = mmapForLinker(pageSize, PROT_READ | PROT_WRITE | PROT_EXEC, 0, fd, pageOffset); + if (p == NULL) return NULL; + *mapped_size = pageSize; + *mapped_offset = pageOffset; +@@ -688,7 +688,7 @@ ocGetNames_ELF ( ObjectCode* oc ) + * address might be out of range for sections that are mmaped. + */ + alloc = SECTION_MMAP; +- start = mmap(NULL, size, ++ start = mmapForLinker(size, + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_ANON | MAP_PRIVATE, + -1, 0); +@@ -732,7 +732,7 @@ ocGetNames_ELF ( ObjectCode* oc ) + unsigned nstubs = numberOfStubsForSection(oc, i); + unsigned stub_space = STUB_SIZE * nstubs; + +- void * mem = mmap(NULL, size+stub_space, ++ void * mem = mmapForLinker(size+stub_space, + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_ANON | MAP_PRIVATE, + -1, 0); +diff --git a/rts/linker/LoadArchive.c b/rts/linker/LoadArchive.c +index 85eedb930d..bcc042f468 100644 +--- a/rts/linker/LoadArchive.c ++++ b/rts/linker/LoadArchive.c +@@ -465,6 +465,7 @@ static HsInt loadArchive_ (pathchar *path) + /* TODO: Stop relying on file extensions to determine input formats. + Instead try to match file headers. See Trac #13103. */ + isObject = (thisFileNameSize >= 2 && strncmp(fileName + thisFileNameSize - 2, ".o" , 2) == 0) ++ || (thisFileNameSize >= 3 && strncmp(fileName + thisFileNameSize - 3, ".lo" , 3) == 0) + || (thisFileNameSize >= 4 && strncmp(fileName + thisFileNameSize - 4, ".p_o", 4) == 0) + || (thisFileNameSize >= 4 && strncmp(fileName + thisFileNameSize - 4, ".obj", 4) == 0); + +@@ -497,7 +498,7 @@ static HsInt loadArchive_ (pathchar *path) + isThin); + #elif defined(darwin_HOST_OS) || defined(ios_HOST_OS) + if (RTS_LINKER_USE_MMAP) +- image = mmapForLinker(memberSize, MAP_ANONYMOUS, -1, 0); ++ image = mmapForLinker(memberSize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS, -1, 0); + else { + /* See loadObj() */ + misalignment = machoGetMisalignment(f); +@@ -555,7 +556,7 @@ while reading filename from `%" PATH_FMT "'", path); + } + DEBUG_LOG("Found GNU-variant file index\n"); + #if RTS_LINKER_USE_MMAP +- gnuFileIndex = mmapForLinker(memberSize + 1, MAP_ANONYMOUS, -1, 0); ++ gnuFileIndex = mmapForLinker(memberSize + 1, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS, -1, 0); + #else + gnuFileIndex = stgMallocBytes(memberSize + 1, "loadArchive(image)"); + #endif +diff --git a/rts/linker/M32Alloc.c b/rts/linker/M32Alloc.c +index 52b182e54d..3016704bd2 100644 +--- a/rts/linker/M32Alloc.c ++++ b/rts/linker/M32Alloc.c +@@ -157,7 +157,7 @@ m32_allocator_init(void) + // Preallocate the initial M32_MAX_PAGES to ensure that they don't + // fragment the memory. + size_t pgsz = getPageSize(); +- char* bigchunk = mmapForLinker(pgsz * M32_MAX_PAGES,MAP_ANONYMOUS,-1,0); ++ char* bigchunk = mmapForLinker(pgsz * M32_MAX_PAGES, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS,-1,0); + if (bigchunk == NULL) + barf("m32_allocator_init: Failed to map"); + +@@ -249,7 +249,7 @@ m32_alloc(size_t size, size_t alignment) + + if (m32_is_large_object(size,alignment)) { + // large object +- return mmapForLinker(size,MAP_ANONYMOUS,-1,0); ++ return mmapForLinker(size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS,-1,0); + } + + // small object +@@ -297,7 +297,7 @@ m32_alloc(size_t size, size_t alignment) + } + + // Allocate a new page +- void * addr = mmapForLinker(pgsz,MAP_ANONYMOUS,-1,0); ++ void * addr = mmapForLinker(pgsz, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS,-1,0); + if (addr == NULL) { + return NULL; + } +diff --git a/rts/linker/MachO.c b/rts/linker/MachO.c +index b6a14d142c..8a48425637 100644 +--- a/rts/linker/MachO.c ++++ b/rts/linker/MachO.c +@@ -588,7 +588,7 @@ makeGot(ObjectCode * oc) { + + if(got_slots > 0) { + oc->info->got_size = got_slots * sizeof(void*); +- oc->info->got_start = mmap(NULL, oc->info->got_size, ++ oc->info->got_start = mmapForLinker(oc->info->got_size, + PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, + -1, 0); +@@ -1419,7 +1419,7 @@ ocGetNames_MachO(ObjectCode* oc) + case S_ZEROFILL: + case S_GB_ZEROFILL: { + // See Note [mmap r+w+x] +- void * mem = mmap(NULL, section->size, ++ void * mem = mmapForLinker(section->size, + PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, + -1, 0); +@@ -1472,7 +1472,7 @@ ocGetNames_MachO(ObjectCode* oc) + * instructions (ldr, br) for each relocation. + */ 16 * n_ext_sec_sym; + // See Note [mmap r+w+x] +- void * mem = mmap(NULL, section->size+stub_space, ++ void * mem = mmapForLinker(section->size+stub_space, + PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, + -1, 0); +@@ -1502,7 +1502,7 @@ ocGetNames_MachO(ObjectCode* oc) + case S_GB_ZEROFILL: { + char * zeroFillArea; + if (RTS_LINKER_USE_MMAP) { +- zeroFillArea = mmapForLinker(section->size, MAP_ANONYMOUS, ++ zeroFillArea = mmapForLinker(section->size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANONYMOUS, + -1, 0); + if (zeroFillArea == NULL) return 0; + memset(zeroFillArea, 0, section->size); +diff --git a/rts/linker/SymbolExtras.c b/rts/linker/SymbolExtras.c +index 486fa4a572..f4485bba31 100644 +--- a/rts/linker/SymbolExtras.c ++++ b/rts/linker/SymbolExtras.c +@@ -52,6 +52,7 @@ int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first ) + + /* Keep image and symbol_extras contiguous */ + void *new = mmapForLinker(n + (sizeof(SymbolExtra) * count), ++ PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_ANONYMOUS, -1, 0); + if (new) { + memcpy(new, oc->image, oc->fileSize); +diff --git a/rts/linker/elf_got.c b/rts/linker/elf_got.c +index 0395d169df..5846a94c31 100644 +--- a/rts/linker/elf_got.c ++++ b/rts/linker/elf_got.c +@@ -44,7 +44,7 @@ makeGot(ObjectCode * oc) { + } + if(got_slots > 0) { + oc->info->got_size = got_slots * sizeof(void *); +- void * mem = mmap(NULL, oc->info->got_size, ++ void * mem = mmapForLinker(oc->info->got_size, + PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, + -1, 0); +diff --git a/rts/linker/elf_reloc_aarch64.c b/rts/linker/elf_reloc_aarch64.c +index c50ef04080..a826c58170 100644 +--- a/rts/linker/elf_reloc_aarch64.c ++++ b/rts/linker/elf_reloc_aarch64.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + #include "elf_compat.h" + #include "elf_reloc_aarch64.h" + #include "util.h" +@@ -60,6 +61,9 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) { + /* instructions are 32bit! */ + addr_t P = (addr_t)((uint8_t*)section->start + rel->r_offset); + int exp_shift = -1; ++ ++ bool ret = EXIT_SUCCESS; ++ + switch(ELF64_R_TYPE(rel->r_info)) { + /* static misc relocations */ + /* static data relocations */ +@@ -90,12 +94,21 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) { + // ... hi ] [ Rd ] + // + // imm64 = SignExtend(hi:lo:0x000,64) +- assert(isInt64(32, addend)); +- assert((addend & 0xfff) == 0); /* page relative */ +- +- *(inst_t *)P = (*(inst_t *)P & 0x9f00001f) +- | (inst_t) (((uint64_t) addend << 17) & 0x60000000) +- | (inst_t) (((uint64_t) addend >> 9) & 0x00ffffe0); ++ // Range is 21 bits + the 12 page relative bits ++ // known to be 0. -2^32 <= X < 2^32 ++ if(!isInt64(21+12, addend)) { ++ IF_DEBUG(linker, debugBelch( ++ "R_AARCH64_ADR_PREL_PG_HI21 addend out of range: 0x%" PRIx64 "\n", ++ addend)); ++ ret = EXIT_FAILURE; ++ } else { ++ assert(isInt64(21+12, addend)); ++ assert((addend & 0xfff) == 0); /* page relative */ ++ ++ *(inst_t *)P = (*(inst_t *)P & 0x9f00001f) ++ | (inst_t) (((uint64_t) addend << 17) & 0x60000000) ++ | (inst_t) (((uint64_t) addend >> 9) & 0x00ffffe0); ++ } + break; + } + /* - control flow relocations */ +@@ -103,13 +116,13 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) { + case COMPAT_R_AARCH64_CALL26: { /* relocate bl ... */ + assert(isInt64(26+2, addend)); /* X in range */ + *(inst_t *)P = (*(inst_t *)P & 0xfc000000) /* keep upper 6 (32-6) +- * bits */ ++ * bits */ + | ((uint32_t)(addend >> 2) & 0x03ffffff); + break; + } + case COMPAT_R_AARCH64_ADR_GOT_PAGE: { +- +- assert(isInt64(32, addend)); /* X in range */ ++ /* range is -2^32 <= X < 2^32 */ ++ assert(isInt64(21+12, addend)); /* X in range */ + assert((addend & 0xfff) == 0); /* page relative */ + + *(inst_t *)P = (*(inst_t *)P & 0x9f00001f) +@@ -159,7 +172,7 @@ encodeAddendAarch64(Section * section, Elf_Rel * rel, int64_t addend) { + default: + abort(); + } +- return EXIT_SUCCESS; ++ return ret; + } + + +@@ -293,7 +306,19 @@ relocateObjectCodeAarch64(ObjectCode * oc) { + int64_t addend = decodeAddendAarch64(targetSection, rel); + + addend = computeAddend(targetSection, rel, symbol, addend); +- encodeAddendAarch64(targetSection, rel, addend); ++ IF_DEBUG(linker, debugBelch("REL: relocating symbol: %s (%s)\n", ++ symbol->name, ++ OC_INFORMATIVE_FILENAME(oc))); ++ if(encodeAddendAarch64(targetSection, rel, addend)) { ++ sysErrorBelch("Failed to relocate symbol: %s (%s) " ++ "at %p in %p with addend 0x%" PRIx64 "\n", ++ symbol->name, ++ OC_INFORMATIVE_FILENAME(oc), ++ symbol->addr, ++ (addr_t)((uint8_t*)targetSection->start + rel->r_offset), ++ addend); ++ stg_exit(EXIT_FAILURE); ++ } + } + } + for(ElfRelocationATable *relaTab = oc->info->relaTable; +@@ -320,7 +345,19 @@ relocateObjectCodeAarch64(ObjectCode * oc) { + + addend = computeAddend(targetSection, (Elf_Rel*)rel, + symbol, addend); +- encodeAddendAarch64(targetSection, (Elf_Rel*)rel, addend); ++ IF_DEBUG(linker, debugBelch("RELA: relocating symbol: %s (%s)\n", ++ symbol->name, ++ OC_INFORMATIVE_FILENAME(oc))); ++ if(encodeAddendAarch64(targetSection, (Elf_Rel*)rel, addend)) { ++ sysErrorBelch("Failed to relocate symbol: %s (%s) " ++ "at %p in %p with addend 0x%" PRIx64 "\n", ++ symbol->name, ++ OC_INFORMATIVE_FILENAME(oc), ++ symbol->addr, ++ (addr_t)((uint8_t*)targetSection->start + rel->r_offset), ++ addend); ++ stg_exit(EXIT_FAILURE); ++ } + } + } + return EXIT_SUCCESS; +diff --git a/rts/sm/CNF.c b/rts/sm/CNF.c +index 6bc58cde75..02d354fa4c 100644 +--- a/rts/sm/CNF.c ++++ b/rts/sm/CNF.c +@@ -542,8 +542,9 @@ insertCompactHash (Capability *cap, + StgClosure *p, StgClosure *to) + { + insertHashTable(str->hash, (StgWord)p, (const void*)to); +- if (str->header.info == &stg_COMPACT_NFDATA_CLEAN_info) { +- str->header.info = &stg_COMPACT_NFDATA_DIRTY_info; ++ const StgInfoTable *strinfo = str->header.info; ++ if (strinfo == &stg_COMPACT_NFDATA_CLEAN_info) { ++ strinfo = &stg_COMPACT_NFDATA_DIRTY_info; + recordClosureMutated(cap, (StgClosure*)str); + } + } +diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c +index 289031945d..f080221e28 100644 +--- a/rts/sm/Evac.c ++++ b/rts/sm/Evac.c +@@ -131,7 +131,7 @@ copy_tag(StgClosure **p, const StgInfoTable *info, + #else + src->header.info = (const StgInfoTable *)MK_FORWARDING_PTR(to); + *p = TAG_CLOSURE(tag,(StgClosure*)to); +-#endif ++#endif /* defined(PARALLEL_GC) */ + + #if defined(PROFILING) + // We store the size of the just evacuated object in the LDV word so that +@@ -194,7 +194,7 @@ spin: + if (info == (W_)&stg_WHITEHOLE_info) { + #if defined(PROF_SPIN) + whitehole_gc_spin++; +-#endif ++#endif /* PROF_SPIN */ + busy_wait_nop(); + goto spin; + } +@@ -205,7 +205,7 @@ spin: + } + #else + info = (W_)src->header.info; +-#endif ++#endif /* PARALLEL_GC */ + + to = alloc_for_copy(size_to_reserve, gen_no); + +@@ -216,8 +216,8 @@ spin: + } + + write_barrier(); +- src->header.info = (const StgInfoTable*)MK_FORWARDING_PTR(to); + *p = (StgClosure *)to; ++ src->header.info = (const StgInfoTable*)MK_FORWARDING_PTR(to); + + #if defined(PROFILING) + // We store the size of the just evacuated object in the LDV word so that +@@ -1099,6 +1099,7 @@ selector_chain: + // need the write-barrier stuff. + // - undo the chain we've built to point to p. + SET_INFO((StgClosure *)p, (const StgInfoTable *)info_ptr); ++ write_barrier(); + *q = (StgClosure *)p; + if (evac) evacuate(q); + unchain_thunk_selectors(prev_thunk_selector, (StgClosure *)p); +@@ -1109,7 +1110,7 @@ selector_chain: + // Save the real info pointer (NOTE: not the same as get_itbl()). + info_ptr = (StgWord)p->header.info; + SET_INFO((StgClosure *)p,&stg_WHITEHOLE_info); +-#endif ++#endif /* THREADED_RTS */ + + field = INFO_PTR_TO_STRUCT((StgInfoTable *)info_ptr)->layout.selector_offset; + +@@ -1165,6 +1166,7 @@ selector_loop: + SET_INFO((StgClosure*)p, (StgInfoTable *)info_ptr); + OVERWRITING_CLOSURE((StgClosure*)p); + SET_INFO((StgClosure*)p, &stg_WHITEHOLE_info); ++ write_barrier(); + } + #endif + +diff --git a/rts/sm/GC.c b/rts/sm/GC.c +index 90857abe38..09a8f411fe 100644 +--- a/rts/sm/GC.c ++++ b/rts/sm/GC.c +@@ -1092,6 +1092,8 @@ loop: + + // scavenge_loop() only exits when there's no work to do + ++ // This atomic decrement also serves as a full barrier to ensure that any ++ // writes we made during scavenging are visible to other threads. + #if defined(DEBUG) + r = dec_running(); + #else +diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c +index 23ed3f0622..a1a2c79c0a 100644 +--- a/rts/sm/GCAux.c ++++ b/rts/sm/GCAux.c +@@ -83,6 +83,7 @@ isAlive(StgClosure *p) + } + + info = INFO_PTR_TO_STRUCT(info); ++ load_load_barrier(); + + switch (info->type) { + +diff --git a/rts/sm/MarkWeak.c b/rts/sm/MarkWeak.c +index 88037f6a34..8ed499e9b3 100644 +--- a/rts/sm/MarkWeak.c ++++ b/rts/sm/MarkWeak.c +@@ -242,16 +242,22 @@ static bool tidyWeakList(generation *gen) + last_w = &gen->old_weak_ptr_list; + for (w = gen->old_weak_ptr_list; w != NULL; w = next_w) { + ++ info = w->header.info; ++ /* N.B. This function is executed only during the serial part of GC ++ * so consequently there is no potential for data races and therefore ++ * no need for memory barriers. ++ */ ++ + /* There might be a DEAD_WEAK on the list if finalizeWeak# was + * called on a live weak pointer object. Just remove it. + */ +- if (w->header.info == &stg_DEAD_WEAK_info) { ++ if (info == &stg_DEAD_WEAK_info) { + next_w = w->link; + *last_w = next_w; + continue; + } + +- info = get_itbl((StgClosure *)w); ++ info = INFO_PTR_TO_STRUCT(info); + switch (info->type) { + + case WEAK: +diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c +index 748f2f45b0..40cbb42db7 100644 +--- a/rts/sm/Sanity.c ++++ b/rts/sm/Sanity.c +@@ -233,6 +233,7 @@ checkClosure( const StgClosure* p ) + p = UNTAG_CONST_CLOSURE(p); + + info = p->header.info; ++ load_load_barrier(); + + if (IS_FORWARDING_PTR(info)) { + barf("checkClosure: found EVACUATED closure %d", info->type); +@@ -243,6 +244,7 @@ checkClosure( const StgClosure* p ) + #endif + + info = INFO_PTR_TO_STRUCT(info); ++ load_load_barrier(); + + switch (info->type) { + +@@ -564,6 +566,7 @@ checkTSO(StgTSO *tso) + + next = tso->_link; + info = (const StgInfoTable*) tso->_link->header.info; ++ load_load_barrier(); + + ASSERT(next == END_TSO_QUEUE || + info == &stg_MVAR_TSO_QUEUE_info || +diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c +index 39374c057f..45fe0d0c53 100644 +--- a/rts/sm/Scav.c ++++ b/rts/sm/Scav.c +@@ -394,7 +394,7 @@ scavenge_block (bdescr *bd) + // time around the loop. + while (p < bd->free || (bd == ws->todo_bd && p < ws->todo_free)) { + +- ASSERT(bd->link == NULL); ++ ASSERT(bd->link == NULL); + ASSERT(LOOKS_LIKE_CLOSURE_PTR(p)); + info = get_itbl((StgClosure *)p); + +@@ -1543,6 +1543,7 @@ scavenge_mutable_list(bdescr *bd, generation *gen) + ASSERT(LOOKS_LIKE_CLOSURE_PTR(p)); + + #if defined(DEBUG) ++ const StgInfoTable *pinfo; + switch (get_itbl((StgClosure *)p)->type) { + case MUT_VAR_CLEAN: + // can happen due to concurrent writeMutVars +@@ -1562,9 +1563,10 @@ scavenge_mutable_list(bdescr *bd, generation *gen) + case TREC_CHUNK: + mutlist_TREC_CHUNK++; break; + case MUT_PRIM: +- if (((StgClosure*)p)->header.info == &stg_TVAR_WATCH_QUEUE_info) ++ pinfo = ((StgClosure*)p)->header.info; ++ if (pinfo == &stg_TVAR_WATCH_QUEUE_info) + mutlist_TVAR_WATCH_QUEUE++; +- else if (((StgClosure*)p)->header.info == &stg_TREC_HEADER_info) ++ else if (pinfo == &stg_TREC_HEADER_info) + mutlist_TREC_HEADER++; + else + mutlist_OTHERS++; +diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c +index 52dab73709..5edd4fdcfd 100644 +--- a/rts/sm/Storage.c ++++ b/rts/sm/Storage.c +@@ -407,8 +407,10 @@ lockCAF (StgRegTable *reg, StgIndStatic *caf) + + // Allocate the blackhole indirection closure + bh = (StgInd *)allocate(cap, sizeofW(*bh)); +- SET_HDR(bh, &stg_CAF_BLACKHOLE_info, caf->header.prof.ccs); + bh->indirectee = (StgClosure *)cap->r.rCurrentTSO; ++ SET_HDR(bh, &stg_CAF_BLACKHOLE_info, caf->header.prof.ccs); ++ // Ensure that above writes are visible before we introduce reference as CAF indirectee. ++ write_barrier(); + + caf->indirectee = (StgClosure *)bh; + write_barrier(); +@@ -1081,6 +1083,8 @@ void + dirty_MUT_VAR(StgRegTable *reg, StgClosure *p) + { + Capability *cap = regTableToCapability(reg); ++ // No barrier required here as no other heap object fields are read. See ++ // note [Heap memory barriers] in SMP.h. + if (p->header.info == &stg_MUT_VAR_CLEAN_info) { + p->header.info = &stg_MUT_VAR_DIRTY_info; + recordClosureMutated(cap,p); +@@ -1090,6 +1094,8 @@ dirty_MUT_VAR(StgRegTable *reg, StgClosure *p) + void + dirty_TVAR(Capability *cap, StgTVar *p) + { ++ // No barrier required here as no other heap object fields are read. See ++ // note [Heap memory barriers] in SMP.h. + if (p->header.info == &stg_TVAR_CLEAN_info) { + p->header.info = &stg_TVAR_DIRTY_info; + recordClosureMutated(cap,(StgClosure*)p); diff --git a/overlays/patches/ghc/llvm-emit-nonlazybind.patch b/overlays/patches/ghc/llvm-emit-nonlazybind.patch new file mode 100644 index 0000000000..c36d9abeff --- /dev/null +++ b/overlays/patches/ghc/llvm-emit-nonlazybind.patch @@ -0,0 +1,63 @@ +diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs +index b350ab408d..2585326560 100644 +--- a/compiler/llvmGen/Llvm/PpLlvm.hs ++++ b/compiler/llvmGen/Llvm/PpLlvm.hs +@@ -149,11 +149,12 @@ ppLlvmFunctionHeader (LlvmFunctionDecl n l c r varg p a) args + align = case a of + Just a' -> text " align " <> ppr a' + Nothing -> empty ++ bind = text " nonlazybind " + args' = map (\((ty,p),n) -> ppr ty <+> ppSpaceJoin p <+> char '%' + <> ftext n) + (zip p args) + in ppr l <+> ppr c <+> ppr r <+> char '@' <> ftext n <> lparen <> +- (hsep $ punctuate comma args') <> ptext varg' <> rparen <> align ++ (hsep $ punctuate comma args') <> ptext varg' <> rparen <> bind <> align + + -- | Print out a list of function declaration. + ppLlvmFunctionDecls :: LlvmFunctionDecls -> SDoc +diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs +index bc7bbaab1b..882040897e 100644 +--- a/compiler/llvmGen/Llvm/Types.hs ++++ b/compiler/llvmGen/Llvm/Types.hs +@@ -555,6 +555,10 @@ data LlvmFuncAttr + -- | This attribute disables prologue / epilogue emission for the function. + -- This can have very system-specific consequences. + | Naked ++ -- | This attribute suppresses lazy symbol binding for the function. This ++ -- may make calls to the function faster, at the cost of extra program startup ++ -- time if the function is not called during program startup. ++ | NonLazyBind + deriving (Eq) + + instance Outputable LlvmFuncAttr where +@@ -571,6 +575,7 @@ instance Outputable LlvmFuncAttr where + ppr NoRedZone = text "noredzone" + ppr NoImplicitFloat = text "noimplicitfloat" + ppr Naked = text "naked" ++ ppr NonLazyBind = text "nonlazybind" + + + -- | Different types to call a function. +diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs +index 6e20da48c1..c1dc50d316 100644 +--- a/compiler/llvmGen/LlvmCodeGen/Base.hs ++++ b/compiler/llvmGen/LlvmCodeGen/Base.hs +@@ -159,8 +159,16 @@ llvmFunArgs dflags live = + isSSE _ = False + + -- | Llvm standard fun attributes ++-- ++-- Haskell code needs to always be marked NonLazyBind. ++-- This prevents the compiler from forcing it through ++-- the plt. This is an issue for haskell functions with ++-- info tables. Other functions migth use the function ++-- pointer and do relative computations off of it, which ++-- in turn would point somewhere into the PLT instead of ++-- the info-table, *if* we did not pass NonLazyBind. + llvmStdFunAttrs :: [LlvmFuncAttr] +-llvmStdFunAttrs = [NoUnwind] ++llvmStdFunAttrs = [NoUnwind, NonLazyBind] + + -- | Convert a list of types to a list of function parameters + -- (each with no parameter attributes)