[GHC] #13696: rts/linker/ElfTypes.h does not compile on most of UNREG arches (and some registerised arches)

GHC ghc-devs at haskell.org
Sun May 14 08:55:49 UTC 2017


#13696: rts/linker/ElfTypes.h does not compile on most of UNREG arches (and some
registerised arches)
-------------------------------------+-------------------------------------
        Reporter:  slyfox            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by slyfox:

@@ -25,1 +25,1 @@
- '''powerpc''' (arm_HOST_ARCH), '''hppa'' (hppa_HOST_ARCH), '''m68k'''
+ '''powerpc''' (arm_HOST_ARCH), '''hppa''' (hppa_HOST_ARCH), '''m68k'''

New description:

 Builds fail as:

 {{{
       rts_dist_HC rts/dist/build/RtsStartup.o
         rts/linker/ElfTypes.h:23:4: error:
              error: #error "Unsupported arch!"
 }}}

 The code that fails in '''rts/linker/ElfTypes.h''':
 {{{#!c
 #  define ELF_TARGET_AMD64 /* Used inside <elf.h> on Solaris 11 */
 #if defined(powerpc64_HOST_ARCH) || defined(powerpc64le_HOST_ARCH) \
  || defined(ia64_HOST_ARCH) || defined(aarch64_HOST_ARCH) \
  || defined(x86_64_HOST_ARCH)
 #  define ELF_64BIT
 #elif defined(sparc_HOST_ARCH) || defined(i386_HOST_ARCH) \
  || defined(arm_HOST_ARCH)
 #  define ELF_32BIT
 #else
 #  error "Unsupported arch!"
 #endif
 }}}

 Note it's a whitelist of architectures. It fails at least on
 '''powerpc''' (arm_HOST_ARCH), '''hppa''' (hppa_HOST_ARCH), '''m68k'''
 (m68k_HOST_ARCH). '''mips''', '''mips64''', '''alpha''', '''s390x''',
 '''sparc64'''.

 It does not look like keeping a whitelist is scalable here.

 How about using
 {{{#!c
 #if defined(__LP64__) || defined (_LP64)
 }}}
 as a proxy for ELF64 and maintain a list of arches that are exception
 instead?

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13696#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list