Ticket #5733 (closed bug: fixed)

Opened 17 months ago

Last modified 17 months ago

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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

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

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

Change History

Changed 17 months 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.

Changed 17 months ago by igloo

  • priority changed from normal to highest
  • difficulty set to Unknown
  • milestone set to 7.4.1

Changed 17 months ago by nomeata

For your convenience, the patch in git-format.

Changed 17 months ago by simonmar

  • owner set to simonmar

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

Changed 17 months 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(-)

Changed 17 months ago by simonmar

  • status changed from new to merge

Changed 17 months ago by simonmar

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

Changed 17 months 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(-)

Changed 17 months 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

Changed 17 months ago by igloo

  • status changed from merge to closed
  • resolution set to fixed

Merged as 3c629f8e28b721819bcd5d2618b84f7ef4502817, b9cbe8ca889b7bd8cc297110aa531a6fc52e6580, 94409efb55f120b43eceab96449c4b2debdbd948 respectively.

Note: See TracTickets for help on using tickets.