From a8b8d657807ff89fb94aecaefd65b6ab3e3b39e0 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 4 Jan 2012 11:39:55 +0000 Subject: 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. --- compiler/utils/Platform.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'compiler/utils') 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). -- cgit v1.2.1