
Hi, I'm trying to cross-compile GHC as follows: Host: Linux, x86_64, GHC 6.12.1 Target: OpenBSD 4.6 stable, i386 I follow the guide at: http://hackage.haskell.org/trac/ghc/wiki/Building/Porting I downloaded the last stable source tarball (ghc-6.12.1-src.tar.bz2), then ran the following commands: export AUTOCONF_VERSION=2.62 export AUTOMAKE_VERSION=1.9 cp /bin/pwd utils/ghc-pwd/ghc-pwd sh boot ./configure --enable-hc-boot --build=i386-unknown-openbsd --host=i386-unknown-openbsd --target=i386-unknown-openbsd gmake bootstrapping-files The latest fails, with the following trace: http://pastebin.ca/1770926 The following errors are quite interesting: includes/stg/Types.h:103:2: #error GHC untested on this architecture: sizeof(void *) != 4 or 8 includes/rts/Constants.h:156:2: #error unknown SIZEOF_VOID_P Does someone what's going on with this build ? Is there something I can to to help on these issues ? Regards, -- Nicolas Martyanoff http://codemore.org khaelin@gmail.com

On Fri, Jan 29, 2010 at 06:10:52PM +0100, Nicolas Martyanoff wrote:
I'm trying to cross-compile GHC as follows:
Host: Linux, x86_64, GHC 6.12.1 Target: OpenBSD 4.6 stable, i386
IMHO, you shouldn't go that way, because it adds much more complexity than you already have with OpenBSD as host *adn* target. During my last tests back in december, not even OpenBSD/i386 -> OpenBSD/i386 worked with .hc files. That should be fixed first. Then, something like OpenBSD/i386 -> OpenBSD-amd64 (and vice versa) should be done. And if this works, it's questionable wether one should work on cross building with .hc files using differen host an target operating systems or wether it would be more useful to start getting GHC running on other OpenBSD archs.
I follow the guide at: http://hackage.haskell.org/trac/ghc/wiki/Building/Porting
I downloaded the last stable source tarball (ghc-6.12.1-src.tar.bz2), then ran the following commands:
export AUTOCONF_VERSION=2.62 export AUTOMAKE_VERSION=1.9 cp /bin/pwd utils/ghc-pwd/ghc-pwd sh boot ./configure --enable-hc-boot --build=i386-unknown-openbsd --host=i386-unknown-openbsd --target=i386-unknown-openbsd [...]
IIRC there where some discussions (or even patches pushed?) about the build/host/target combo, so you may try to pull ghc sources with darcs (head or the 6.12 branch).
The latest fails, with the following trace: http://pastebin.ca/1770926
The following errors are quite interesting: includes/stg/Types.h:103:2: #error GHC untested on this architecture: sizeof(void *) != 4 or 8 includes/rts/Constants.h:156:2: #error unknown SIZEOF_VOID_P
Your build is (re)creating includes/ghcautoconf.h -- this looks very wrong to me, since ghcautoconf.h is supposed to be created by a former configure / make bootstrapping-files on the target platform and then used on the host for creating the .hc files. Ciao, Kili

Quoth Nicolas Martyanoff
The latest fails, with the following trace: http://pastebin.ca/1770926
Can you look at the include files, at the locations where all these errors crop up? like, includes/stg/Types.h:118: error: syntax error before '*' token This probably means some type identifier used at that point hasn't been declared, or macro defined or whatever. You'd have to see what it is, and maybe it will be more obvious what went wrong. But of course Matthias is right, the configuration of build and target hosts you propose to use probably isn't going to work. The idea is that you do this configure step on the OpenBSD host, right? and then transplant this configuration (a couple of .h files, etc.) to the build host and proceed to build the .hc files. That means the build host has to be a lot like the target host, or that build will be radically misconfigured. Same hardware architecture, at a minimum. Donn

On 10-01-29 11:54, Donn Cave wrote:
Quoth Nicolas Martyanoff
, ... The latest fails, with the following trace: http://pastebin.ca/1770926
Can you look at the include files, at the locations where all these errors crop up? like, includes/stg/Types.h:118: error: syntax error before '*' token
This probably means some type identifier used at that point hasn't been declared, or macro defined or whatever. You'd have to see what it is, and maybe it will be more obvious what went wrong. It seems that SIZEOF_VOID_P isn't defined anywhere.
But of course Matthias is right, the configuration of build and target hosts you propose to use probably isn't going to work. The idea is that you do this configure step on the OpenBSD host, right? and then transplant this configuration (a couple of .h files, etc.) to the build host and proceed to build the .hc files. That means the build host has to be a lot like the target host, or that build will be radically misconfigured. Same hardware architecture, at a minimum.
All right, I'll try again with the last darcs version when I get access to a i386 Linux machine. In the mean time, I'll try to run a GHC 6.6 -> 6.10 -> 6.12 build chain, 6.6 being the latest version available in OpenBSD's ports. Thank you for your help ! Regards, -- Nicolas Martyanoff http://codemore.org khaelin@gmail.com

On Fri, Jan 29, 2010 at 09:42:27PM +0100, Nicolas Martyanoff wrote:
This probably means some type identifier used at that point hasn't been declared, or macro defined or whatever. You'd have to see what it is, and maybe it will be more obvious what went wrong. It seems that SIZEOF_VOID_P isn't defined anywhere.
It's defined in includes/ghcautoconf.h (which is created during configure and make bootstrapping-files on the target platform).
All right, I'll try again with the last darcs version when I get access to a i386 Linux machine.
You don't need any linux machine for this. The current darcs port for OpenBSD may be a little bit outdated, but it still works.
In the mean time, I'll try to run a GHC 6.6 -> 6.10 -> 6.12 build chain, 6.6 being the latest version available in OpenBSD's ports.
I sent you a (admittedly horrible) script to do this chain. Use it. If it doesn't work, sent complaints.

Quoth Nicolas Martyanoff
It seems that SIZEOF_VOID_P isn't defined anywhere.
I guess it's immaterial if you aren't going to pursue the port strategy any farther, but from a cursory look, this would happen at the point where the configuration log says "checking size of void *". That's failing because of an autoconf error, or a C compiler configuration issue, I would guess. Donn

Why cross compile when we already have a native GHC on OpenBSD/x86_64 .. use that to build the source directly. khaelin:
Hi,
I'm trying to cross-compile GHC as follows:
Host: Linux, x86_64, GHC 6.12.1 Target: OpenBSD 4.6 stable, i386
I follow the guide at: http://hackage.haskell.org/trac/ghc/wiki/Building/Porting
I downloaded the last stable source tarball (ghc-6.12.1-src.tar.bz2), then ran the following commands:
export AUTOCONF_VERSION=2.62 export AUTOMAKE_VERSION=1.9 cp /bin/pwd utils/ghc-pwd/ghc-pwd sh boot ./configure --enable-hc-boot --build=i386-unknown-openbsd --host=i386-unknown-openbsd --target=i386-unknown-openbsd gmake bootstrapping-files
The latest fails, with the following trace: http://pastebin.ca/1770926
The following errors are quite interesting: includes/stg/Types.h:103:2: #error GHC untested on this architecture: sizeof(void *) != 4 or 8 includes/rts/Constants.h:156:2: #error unknown SIZEOF_VOID_P
Does someone what's going on with this build ? Is there something I can to to help on these issues ?
Regards,
-- Nicolas Martyanoff http://codemore.org khaelin@gmail.com
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (4)
-
Don Stewart
-
Donn Cave
-
Matthias Kilian
-
Nicolas Martyanoff