summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-01-04 11:39:55 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-01-04 13:05:45 +0000
commita8b8d657807ff89fb94aecaefd65b6ab3e3b39e0 (patch)
tree08da85222b1b651fe2ada139e09313d9d3e0c390 /compiler/utils
parent8387f0198e7a925d9d0754b2befb021ffa1307d7 (diff)
downloadhaskell-a8b8d657807ff89fb94aecaefd65b6ab3e3b39e0.tar.gz
osElfTarget should default to False (#5733)
Another portabilty regression: before Platform we used to use elf_OBJ_FORMAT: #if linux_TARGET_OS || freebsd_TARGET_OS || openbsd_TARGET_OS || solaris2_TARGET_OS #define elf_OBJ_FORMAT 1 #endif which defaults to undefined on unknown platforms. Defaulting to non-ELF is correct, it just means that we won't rely on ELF-specific functionality. I've added a comment to explain that.
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Platform.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index 68f46e74c5..10b19fe5e4 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -14,8 +14,6 @@ module Platform (
where
-import Panic
-
-- | Contains enough information for the native code generator to emit
-- code for this platform.
data Platform
@@ -89,5 +87,8 @@ osElfTarget OSNetBSD = True
osElfTarget OSSolaris2 = True
osElfTarget OSDarwin = False
osElfTarget OSMinGW32 = False
-osElfTarget OSUnknown = panic "Don't know if OSUnknown is elf"
-
+osElfTarget OSUnknown = False
+ -- Defaulting to False is safe; it means don't rely on any
+ -- ELF-specific functionality. It is important to have a default for
+ -- portability, otherwise we have to answer this question for every
+ -- new platform we compile on (even unreg).