Skip to content

Commit

Permalink
Drop special handling of iOS and Android
Browse files Browse the repository at this point in the history
As far as GHC is concerned, iOS **is** Darwin, and
Android **is** Linux.

Depends on D3352

Reviewers: austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: Ericson2314, ryantrinkle, rwbarton, thomie, erikd

Differential Revision: https://phabricator.haskell.org/D3579
  • Loading branch information
angerman authored and bgamari committed Sep 8, 2017
1 parent be514a6 commit cb4878f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 21 deletions.
10 changes: 2 additions & 8 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,10 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
checkOS() {
case [$]1 in
linux)
linux|linux-android)
test -z "[$]2" || eval "[$]2=OSLinux"
;;
ios)
test -z "[$]2" || eval "[$]2=OSiOS"
;;
darwin)
darwin|ios)
test -z "[$]2" || eval "[$]2=OSDarwin"
;;
solaris2)
Expand Down Expand Up @@ -279,9 +276,6 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
aix)
test -z "[$]2" || eval "[$]2=OSAIX"
;;
linux-android)
test -z "[$]2" || eval "[$]2=OSAndroid"
;;
*)
echo "Unknown OS '[$]1'"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion compiler/main/DriverPipeline.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ linkBinary' staticLink dflags o_files dep_packages = do
-- on x86.
++ (if sLdSupportsCompactUnwind mySettings &&
not staticLink &&
(platformOS platform == OSDarwin || platformOS platform == OSiOS) &&
(platformOS platform == OSDarwin) &&
case platformArch platform of
ArchX86 -> True
ArchX86_64 -> True
Expand Down
1 change: 0 additions & 1 deletion compiler/main/HscTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2602,7 +2602,6 @@ soExt :: Platform -> FilePath
soExt platform
= case platformOS platform of
OSDarwin -> "dylib"
OSiOS -> "dylib"
OSMinGW32 -> "dll"
_ -> "so"

Expand Down
5 changes: 1 addition & 4 deletions compiler/main/SysTools.hs
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,6 @@ getLinkerInfo' dflags = do
-- that doesn't support --version. We can just assume that's
-- what we're using.
return $ DarwinLD []
OSiOS ->
-- Ditto for iOS
return $ DarwinLD []
OSMinGW32 ->
-- GHC doesn't support anything but GNU ld on Windows anyway.
-- Process creation is also fairly expensive on win32, so
Expand Down Expand Up @@ -1488,7 +1485,7 @@ linkDynLib dflags0 o_files dep_packages
++ pkg_lib_path_opts
++ pkg_link_opts
))
_ | os `elem` [OSDarwin, OSiOS] -> do
_ | os == OSDarwin -> do
-------------------------------------------------------------------
-- Making a darwin dylib
-------------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions compiler/utils/Platform.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ data OS
= OSUnknown
| OSLinux
| OSDarwin
| OSiOS
| OSSolaris2
| OSMinGW32
| OSFreeBSD
Expand All @@ -85,7 +84,6 @@ data OS
| OSKFreeBSD
| OSHaiku
| OSQNXNTO
| OSAndroid
| OSAIX
deriving (Read, Show, Eq)

Expand Down Expand Up @@ -131,12 +129,10 @@ osElfTarget OSOpenBSD = True
osElfTarget OSNetBSD = True
osElfTarget OSSolaris2 = True
osElfTarget OSDarwin = False
osElfTarget OSiOS = False
osElfTarget OSMinGW32 = False
osElfTarget OSKFreeBSD = True
osElfTarget OSHaiku = True
osElfTarget OSQNXNTO = False
osElfTarget OSAndroid = True
osElfTarget OSAIX = False
osElfTarget OSUnknown = False
-- Defaulting to False is safe; it means don't rely on any
Expand All @@ -147,19 +143,16 @@ osElfTarget OSUnknown = False
-- | This predicate tells us whether the OS support Mach-O shared libraries.
osMachOTarget :: OS -> Bool
osMachOTarget OSDarwin = True
osMachOTarget OSiOS = True
osMachOTarget _ = False

osUsesFrameworks :: OS -> Bool
osUsesFrameworks OSDarwin = True
osUsesFrameworks OSiOS = True
osUsesFrameworks _ = False

platformUsesFrameworks :: Platform -> Bool
platformUsesFrameworks = osUsesFrameworks . platformOS

osSubsectionsViaSymbols :: OS -> Bool
osSubsectionsViaSymbols OSDarwin = True
osSubsectionsViaSymbols OSiOS = True
osSubsectionsViaSymbols _ = False

0 comments on commit cb4878f

Please sign in to comment.