RE: References to the Rts in unregisterised first build of ghc 6.4

On 27 June 2005 17:53, Michiel Buddingh' wrote:
On Mon, Jun 27, 2005 at 01:00:01PM +0100, Simon Marlow wrote:
On 26 June 2005 18:28, Michiel Buddingh' wrote:
I was able to generate a set of .hc files on a linux-i386 host, but (as was expected) the rtc failed to build.
Where exactly did the RTS build fail? Can you post the error message? We do need the .hc files generated from the RTS .cmm source files.
Adjustor.c:106:27: machine/pal.h: No such file or directory Adjustor.c: In function createAdjustor': Adjustor.c:403: error: PAL_imb' undeclared (first use in this function) Adjustor.c:403: error: (Each undeclared identifier is reported only once Adjustor.c:403: error: for each function it appears in.)
I didn't take a look at this before, but I suspect machine/pal.h might even be specific to OSF/1.
Ok, I suggest you do a 'make -k' in ghc/rts. The .cmm files should at least generate .hc files, that you can take to the target machine.
Other alterations (in reverse order)
Edited out the -mieee gcc flag from /ghc/compiler/main/DriverFlags.hs (gcc-i386 doesn't understand it, and even on Alpha, removing it probably wouldn't break the build process itself)
Ok, I assume you'll discover in due course whether you need this on Alpha or not.
Commented out:
#if alpha_TARGET_ARCH checkFEDArgs arg_tys = check (integral_args <= 32) err where integral_args = sum [ machRepByteWidth rep | (rep,hint) <- map typeMachRepRep arg_tys, hint /= FloatHint ] err = ptext SLIT("On Alpha, I can only handle 4 non-floating-point arguments to foreign export dynamic")
from TcForeign.lhs. typeMachRepRep was nowhere to be found (not in ghc-6.4, or any earlier released version), and I wasn't able to figure out what, exactly, it does. It seemed like an RTS thing, so I decided to comment it out, and the build proceded. Not sure if that was such a wise idea now.
That looks like a sanity check that has bitrotted. You can ignore it until you need to get 'foreign import "wrapper"' working.
Commented out:
import PrimRep ( getPrimRepSize, isFloatingRep )
from the same file. The file isn't included with ghc anymore, and the imported functions weren't used.
More bitrot. Please send us patches when you've got the compiler bootstrapped. Cheers, SImon

On Tue, Jun 28, 2005 at 12:14:08PM +0100, Simon Marlow wrote:
On 27 June 2005 17:53, Michiel Buddingh' wrote:
Commented out:
#if alpha_TARGET_ARCH checkFEDArgs arg_tys = check (integral_args <= 32) err where integral_args = sum [ machRepByteWidth rep | (rep,hint) <- map typeMachRepRep arg_tys, hint /= FloatHint ] err = ptext SLIT("On Alpha, I can only handle 4 non-floating-point arguments to foreign export dynamic")
from TcForeign.lhs. typeMachRepRep was nowhere to be found (not in ghc-6.4, or any earlier released version), and I wasn't able to figure out what, exactly, it does. It seemed like an RTS thing, so I decided to comment it out, and the build proceded. Not sure if that was such a wise idea now.
That looks like a sanity check that has bitrotted. You can ignore it until you need to get 'foreign import "wrapper"' working.
This works (or at least compiles!) on Linux/Alpha: --- ghc6-6.4.orig/ghc/compiler/typecheck/TcForeign.lhs +++ ghc6-6.4/ghc/compiler/typecheck/TcForeign.lhs @@ -29,8 +29,8 @@ import ErrUtils ( Message ) import Id ( Id, mkLocalId, mkExportedLocalId ) #if alpha_TARGET_ARCH -import PrimRep ( getPrimRepSize, isFloatingRep ) import Type ( typePrimRep ) +import SMRep ( argMachRep, primRepToCgRep, primRepHint ) #endif import OccName ( mkForeignExportOcc ) import Name ( Name, NamedThing(..), mkExternalName ) @@ -52,7 +52,7 @@ import Bag ( consBag ) #if alpha_TARGET_ARCH -import MachOp ( machRepByteWidth ) +import MachOp ( machRepByteWidth, MachHint(FloatHint) ) #endif \end{code} @@ -185,10 +185,10 @@ checkFEDArgs arg_tys = check (integral_args <= 32) err where - integral_args = sum [ machRepByteWidth rep - | (rep,hint) <- map typeMachRepRep arg_tys, - hint /= FloatHint ] - err = ptext SLIT("On Alpha, I can only handle 4 non-floating-point arguments to foreign export dynamic") + integral_args = sum [ (machRepByteWidth . argMachRep . primRepToCgRep) prim_rep + | prim_rep <- map typePrimRep arg_tys, + primRepHint prim_rep /= FloatHint ] + err = ptext SLIT("On Alpha, I can only handle 32 bytes of non-floating-point arguments to foreign export dynamic") #else checkFEDArgs arg_tys = returnM () #endif Thanks Ian
participants (2)
-
Ian Lynagh
-
Simon Marlow