Opened 8 years ago

Closed 8 years ago

#5733 closed bug (fixed)

Build failure on kfreebsd: Don't know if OSUnknown is elf

Reported by: nomeata Owned by: simonmar
Priority: highest Milestone: 7.4.1
Component: Compiler Version: 7.3
Keywords: Cc:
Operating System: FreeBSD Architecture: Unknown/Multiple
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Hi,

the 7.4.1 release candidate failed to build on the two Debian ports based on the freebsd kernel; previous versions built fine. It would be great if arm support would not be dropped, if it can be helped:

"inplace/bin/ghc-stage1"   -H32m -O -lffi -optl-pthread    -package-name ghc-prim-0.2.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/dist-install/build -Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/.    -optP-include -optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h -package rts-1.0  -package-name ghc-prim -XHaskell98 -XCPP -XMagicHash -XForeignFunctionInterface -XUnliftedFFITypes -XUnboxedTuples -XEmptyDataDecls -XNoImplicitPrelude -O2  -no-user-package-conf -rtsopts     -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -hisuf hi -osuf  o -hcsuf hc -c libraries/ghc-prim/./GHC/Magic.hs -o libraries/ghc-prim/dist-install/build/GHC/Magic.o
ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 7.4.0.20111219 for x86_64-unknown-kfreebsdgnu):
	Don't know if OSUnknown is elf

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

make[2]: *** [libraries/ghc-prim/dist-install/build/GHC/Magic.o] Error 1
make[2]: *** Waiting for unfinished jobs....
ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 7.4.0.20111219 for x86_64-unknown-kfreebsdgnu):
	Don't know if OSUnknown is elf

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

make[2]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1

Full log at https://buildd.debian.org/status/fetch.php?pkg=ghc&arch=kfreebsd-amd64&ver=7.4.0.20111219-2&stamp=1324640808

To the best of my knowledge, kfreebsd _does_ use the ELF format.

Thanks, Joachim on behalf of the Debian Haskell Team

Attachments (1)

0001-KFreeBSD-is-also-an-ELF-binary.patch (1.8 KB) - added by nomeata 8 years ago.
For your convenience, the patch in git-format.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by nomeata

This patch seems to suffice to have GHC compile successfully on kfreebsd: http://anonscm.debian.org/darcs/pkg-haskell/experimental/ghc/patches/kfreebsd-OS

I’d be grateful if this could be included in 7.4.1, to keep the number of patches in the Debian package down.

comment:2 Changed 8 years ago by igloo

difficulty: Unknown
Milestone: 7.4.1
Priority: normalhighest

Changed 8 years ago by nomeata

For your convenience, the patch in git-format.

comment:3 Changed 8 years ago by simonmar

Owner: set to simonmar

About to run a validate, so I'll include this.

comment:4 Changed 8 years ago by marlowsd@…

commit a8b8d657807ff89fb94aecaefd65b6ab3e3b39e0

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Wed Jan 4 11:39:55 2012 +0000

    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 files changed, 5 insertions(+), 4 deletions(-)

comment:5 Changed 8 years ago by simonmar

Status: newmerge

comment:6 Changed 8 years ago by simonmar

Not finished yet: I will also commit the patch from the ticket.

comment:7 Changed 8 years ago by mail@…

commit 71963675263e5e66fe80c2fba4fa2bbe6c0bed73

Author: Joachim Breitner <mail@joachim-breitner.de>
Date:   Sun Jan 1 02:17:24 2012 +0100

    KFreeBSD is also an ELF binary
    
    Fixes: #5733

 aclocal.m4                 |    5 ++++-
 compiler/utils/Platform.hs |    2 ++
 2 files changed, 6 insertions(+), 1 deletions(-)

comment:8 Changed 8 years ago by simonmar

Ian: note that you also need to merge

commit 659f47d4b676544b9cda77ed7ab0e3cd6c2ed6fd

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Wed Jan 4 13:45:35 2012 +0000

    fix warning

comment:9 Changed 8 years ago by igloo

Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.