[jhc] Is a full POSIX env required for cross-compiling?

Korcan Hussein korcan_h at hotmail.com
Sat Jul 24 18:40:51 EDT 2010


Hello, I've managed to get a hello world Haskell program working on the Wii (homebrew), cross-compiling JHC compiling the C code using devkitPPC (http://wiibrew.org/wiki/DevkitPPC). Unfortunately I had to hack the generated C code to get this working because devkitPPC doesn't seems to fully support POSIX standards, there where two headers missing from devkitPPC that the C code referenced which was sys/select.h and sys/utsname.h, I was also having problems with __WORDSIZE not being defined even though in my targets.ini I've explicated stated the bit-size, byte-ordering, etc. so I added this define to my targets.ini definition.

The headers that was missing the actual functions that depended on those headers didn't seem completely essential code so I commented out the includes and problematic code, I also changed the value of the define JHC_isPosix to 0.

Of-course this isn't ideal, the proper solution would be for me (or devkitpro) to implement those missing headers but does jhc require a full implementation of posix standard? is it possible to use jhc cross compiling with non-posix platforms?

I also added some other code to the generated C code to setup the Wii, prepare the system for console output, etc but this has nothing to do with jhc and of-course this stuff would need a FFI binding, I just did this for testing purposes.




 		 	   		  
_________________________________________________________________
http://clk.atdmt.com/UKM/go/197222280/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now


More information about the jhc mailing list