#1717: ghc-6.8 configure does not recognise 32bit userland on ppc64
-------------------------------------+--------------------------------------
    Reporter:  [EMAIL PROTECTED]  |        Owner:              
        Type:  bug                   |       Status:  new         
    Priority:  low                   |    Milestone:  6.8 branch  
   Component:  Build System          |      Version:  6.8         
    Severity:  normal                |   Resolution:              
    Keywords:                        |   Difficulty:  Unknown     
          Os:  Linux                 |     Testcase:  normal build
Architecture:  powerpc64             |  
-------------------------------------+--------------------------------------
Comment (by guest):

 > This clearly isn't a serious problem

 agreed.

 > `uname -m` on your system claims `ppc64`, so that's what GHC uses as its
 target by default

 I would argue that `uname -m` is the the wrong source of information for
 determining the target.
 Since GHC produces assembly code (either directly or via C) that is
 intended to link against at least certain libraries, it should take care
 that it is compatible with those.

 For example, compiling some floating-point primitives cbits together with
 some dummy `main()` will link against `libm`; then one could use `ldd` to
 find out which `libm` is used, and `file` to find out more about that:

 {{{
  $ file -L /lib/libm.so.6
 /lib/libm.so.6: ELF 32-bit MSB shared object, PowerPC or cisco 4500,
 version 1 (SYSV), for GNU/Linux 2.6.9, stripped
 }}}

 Probably something in `binutils` gives a more precise interface to the
 information we need here --- the best I could find quickly is `readelf`:

 {{{
  $ readelf -h /lib/libm.so.6
 ELF Header:
   Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
   Class:                             ELF32
   Data:                              2's complement, big endian
   Version:                           1 (current)
   OS/ABI:                            UNIX - System V
   ABI Version:                       0
   Type:                              DYN (Shared object file)
   Machine:                           PowerPC
   Version:                           0x1
   Entry point address:               0xde50
   Start of program headers:          52 (bytes into file)
   Start of section headers:          697360 (bytes into file)
   Flags:                             0x0
   Size of this header:               52 (bytes)
   Size of program headers:           32 (bytes)
   Number of program headers:         10
   Size of section headers:           40 (bytes)
   Number of section headers:         31
   Section header string table index: 30
 }}}

 Wolfram

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1717#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to