Skip to content
Snippets Groups Projects
Commit 35799dda authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

hadrian: Don't --export-dynamic on Darwin

When fixing #17962 I neglected to consider that --export-dynamic is only
supported on ELF platforms.
parent 54ca66a7
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ module Oracles.Setting (
-- ** Target platform things
anyTargetPlatform, anyTargetOs, anyTargetArch, anyHostOs,
isElfTarget,
ArmVersion(..),
targetArmVersion,
ghcWithInterpreter, useLibFFIForAdjustors
......@@ -231,6 +232,13 @@ anyTargetArch = matchSetting TargetArch
anyHostOs :: [String] -> Action Bool
anyHostOs = matchSetting HostOs
-- | Check whether the target OS uses the ELF object format.
isElfTarget :: Action Bool
isElfTarget = anyTargetOs
[ "linux", "freebsd", "dragonfly", "openbsd", "netbsd", "solaris2", "kfreebsdgnu"
, "haiku", "linux-android"
]
-- | Check whether the host OS supports the @-rpath@ linker option when
-- using dynamic linking.
--
......
......@@ -127,7 +127,12 @@ packageArgs = do
-- refer to the RTS. This is harmless if you don't use it (adds a bit
-- of overhead to startup and increases the binary sizes) but if you
-- need it there's no alternative.
, package iserv ? mconcat
--
-- The Solaris linker does not support --export-dynamic option. It also
-- does not need it since it exports all dynamic symbols by default
, package iserv
? expr isElfTarget
? notM (expr $ anyTargetOs ["freebsd", "solaris2"])? mconcat
[ builder (Ghc LinkHs) ? arg "-optl-Wl,--export-dynamic" ]
-------------------------------- haddock -------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment