Cygwin cross compiler
Stephen Weeks
MLton@sourcelight.com
Wed, 13 Mar 2002 15:09:44 -0800
--vIDI9dORkA
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit
> I'm using a 2.2 kernel. I just installed the latest public MLton version
> from your homepage - that's the best I have to compile with for now I
> guess. Then I tried make inside runtime/ in the source for the
> experimental
> release with the new gc.c - and now I get:
>
> gc.c: 1063, 1067, 1068, 1071: structure has no field named 'mem_unit'
>
> Should I modify something in gc.c?
Whoops. I forgot you would be *compiling* on a 2.2 kernel, not just
running on one. There is no mem_unit for you. Here is a slightly
modified gc.c. All you need to do is change the single occurrence of
sbuf.mem_unit to 1 and you should be able to compile.
> gc.c: 1058: warning 'tmp' might be used uninitialized in this function
Weird. I don't get that error.
--vIDI9dORkA
Content-Type: application/octet-stream
Content-Disposition: attachment;
filename="gc.c"
Content-Transfer-Encoding: base64
LyogQ29weXJpZ2h0IChDKSAxOTk3LTE5OTkgTkVDIFJlc2VhcmNoIEluc3RpdHV0ZS4KICog
UGxlYXNlIHNlZSB0aGUgZmlsZSBMSUNFTlNFIGZvciBsaWNlbnNlIGluZm9ybWF0aW9uLgog
Ki8KCiNpbmNsdWRlICJnYy5oIgojaW5jbHVkZSA8ZXJybm8uaD4KI2luY2x1ZGUgPGZjbnRs
Lmg+CiNpbmNsdWRlIDxtYXRoLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KI2luY2x1ZGUgPHN5
cy9tbWFuLmg+CiNpbmNsdWRlIDxzeXMvcmVzb3VyY2UuaD4KI2luY2x1ZGUgPHN5cy90aW1l
cy5oPgojaW5jbHVkZSA8dGltZS5oPgojaWYgKGRlZmluZWQgKF9fbGludXhfXykpCiNpbmNs
dWRlIDx2YWx1ZXMuaD4KI2VuZGlmCgojZGVmaW5lIE1FVEVSIEZBTFNFICAvKiBEaXNwbGF5
cyBkaXN0cmlidXRpb24gb2Ygb2JqZWN0IHNpemVzIGF0IHByb2dyYW0gZXhpdC4g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