#1843: ghc 6.8.1 broken on Mac OS X Leopard PPC
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:         
     Type:  bug       |         Status:  new    
 Priority:  high      |      Milestone:  6.8.2  
Component:  Compiler  |        Version:  6.8.1  
 Severity:  critical  |     Resolution:         
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  powerpc
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Comment (by thorkilnaur):

 I have investigated further and now have definite evidence that the
 sequence
 {{{
   lis r,hi16(s+k)
   ori r,r,lo16(s+k)
 }}}
 (where s is a symbol and k is a literate constant) used to bring the value
 s+k into register r is sometimes handled errorneously by (the Xcode 3.0
 coming with) Mac OS X 10.5 Leopard. In contrast to (the Xcode 2 that comes
 with) 10.4 Tiger that doesn't have this problem.

 The evidence indicates that the object code is produced correctly by
 Leopard (or at least in consistence with the object code produced by
 Tiger), but that the linker fails to process the relocation related to
 hi16(s+k) correctly, not only producing the confusing "unknown scattered
 relocation type 4" message, but also, in fact, generating incorrect code.
 Thus explaining the failure to run any amount of code that has been
 prepared in this manner.

 I intend to report this problem to Apple. In the meantime, there are
 fortunately some work-arounds:

  1. Use the sequence
 {{{
   lis r,ha16(s+k)
   la r,lo16(s+k)(r)
 }}}
  suggested by !ChrisKuklewicz above
  17. To retain the lis hi16 + ori lo16 combination, use
 {{{
 t = s+k
   lis r,hi16(t)
   ori r,r,lo16(t)
 }}}
  defining a new symbol t to hold the desired value for hi16.

 Both of these methods work, as far as I can tell.

 Best regards
 Thorkil

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1843#comment:22>
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