[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Simon Marlow-7
On 17/01/13 14:00, Simon Peyton-Jones wrote:
> Would it be worth transferring that comment into the building guide (a cross-compiling page perhaps). The distinction is subtle and the information is useful
>
> There is http://hackage.haskell.org/trac/ghc/wiki/CrossCompilation
> but I'm not sure it has this info

Oh yes, I plan to fix the wiki.  It needs more than just an update for
this change though... the CrossCompilation page is really a design
document, not a user guide, we need some proper documentation.

Cheers,
        Simon


> Simon
>
> | -----Original Message-----
> | From: ghc-commits-bounces at haskell.org [mailto:ghc-commits-
> | bounces at haskell.org] On Behalf Of Simon Marlow
> | Sent: 17 January 2013 12:57
> | To: ghc-commits at haskell.org
> | Subject: [commit: ghc] master: Tidy up cross-compiling (109a1e5)
> |
> | Repository : ssh://darcs.haskell.org//srv/darcs/ghc
> |
> | On branch  : master
> |
> | http://hackage.haskell.org/trac/ghc/changeset/109a1e53287f50103e8a5b5922
> | 75940b6e3dbb53
> |
> | >---------------------------------------------------------------
> |
> | commit 109a1e53287f50103e8a5b592275940b6e3dbb53
> | Author: Simon Marlow <marlowsd at gmail.com>
> | Date:   Thu Jan 17 11:52:15 2013 +0000
> |
> |     Tidy up cross-compiling
> |
> |     We have two cases:
> |      1. building a cross-compiler
> |      2. compiling GHC to run on a foreign platform
> |
> |     These two are done with almost the same setup: (1) is the stage 1
> |     compiler, and (2) is the stage 2 compiler, when CrossCompiling=YES.
> |
> |     The only difference between (1) and (2) is that you if you set up
> | the
> |     build for (1), then it stops before stage 2 and you can 'make
> | install'
> |     to install stage 1.
> |
> |     Unfortunately, (2) didn't work, and the build system code needed
> | some
> |     tidying up.
> |
> |     Change to the way the build is set up:
> |
> |     Before
> |     ------
> |
> |     To build a cross-compiler:
> |       ./configure --target=<..>
> |
> |     To compile a foreign GHC:
> |       ./configure --host=<..> --target=<..>
> |
> |     Now
> |     ---
> |
> |     To build a cross-compiler:
> |       ./configure --target=<..>
> |       And set "Stage1Only=YES" in mk/build.mk
> |
> |     To compile a foreign GHC:
> |       ./configure --target=<..>
> |
> |  aclocal.m4                  |   28 ++++++++----
> |  compiler/ghc.mk             |   99 ++++++++++++++++++++----------------
> | ------
> |  configure.ac                |   35 ++++-----------
> |  ghc.mk                      |   10 ++--
> |  ghc/ghc.mk                  |    2 +-
> |  libraries/primitive         |    1 -
> |  libraries/vector            |    1 -
> |  mk/config.mk.in             |   27 +++++++-----
> |  rules/build-package-data.mk |    7 +++-
> |  settings.in                 |    1 +
> |  utils/ghc-pkg/ghc.mk        |    4 +-
> |  11 files changed, 107 insertions(+), 108 deletions(-)
> |
> |
> | Diff suppressed because of size. To see it, use:
> |
> |     git show 109a1e53287f50103e8a5b592275940b6e3dbb53
> |
> | _______________________________________________
> | ghc-commits mailing list
> | ghc-commits at haskell.org
> | http://www.haskell.org/mailman/listinfo/ghc-commits
>



Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Simon Marlow-7
On 17/01/13 14:08, Simon Marlow wrote:

> On 17/01/13 14:00, Simon Peyton-Jones wrote:
>> Would it be worth transferring that comment into the building guide (a
>> cross-compiling page perhaps). The distinction is subtle and the
>> information is useful
>>
>> There is http://hackage.haskell.org/trac/ghc/wiki/CrossCompilation
>> but I'm not sure it has this info
>
> Oh yes, I plan to fix the wiki.  It needs more than just an update for
> this change though... the CrossCompilation page is really a design
> document, not a user guide, we need some proper documentation.

Ok, new wiki page is here:

http://hackage.haskell.org/trac/ghc/wiki/Building/CrossCompiling

Please edit away.  In particular I haven't investigated cross-compiling
with LLVM, so if someone could add some info about that that would be great.

I've also updated most of the old design doc:

http://hackage.haskell.org/trac/ghc/wiki/CrossCompilation

Cheers,
        Simon




Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Stephen Paul Weber
Somebody claiming to be Simon Marlow wrote:
>Ok, new wiki page is here:
>http://hackage.haskell.org/trac/ghc/wiki/Building/CrossCompiling

Is:

--with-gcc=<gcc> --with-ld=<ld> --with-nm=<nm> --with-objdump=<objdump>

Necessary?  I guess if the given tools are not on PATH with the normal
cross-compiling prefix?

>Please edit away.  In particular I haven't investigated cross-compiling
>with LLVM

That's a bit broken right now (since GHC doesn't pass through the target to
LLVM), but otherwise just involves having an LLVM that supports the target
on PATH.

Also:

cabal --with-ghc=<cross-ghc> --with-ld=<ld> ...

What does this do?  So far I've been careful to use a seperate ~/.cabal-blah
directory to not entangle my two cabals.  Will it handle things nicely?  Do
you need to tell it where to find ghc-pkg, or will --with-ghc work for that?  
Maybe I can switch to just a script/alias instead of a whole config file :)

--
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130118/90244c51/attachment.pgp>

Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Simon Marlow-7
On 18/01/13 15:25, Stephen Paul Weber wrote:

> Somebody claiming to be Simon Marlow wrote:
>> Ok, new wiki page is here:
>> http://hackage.haskell.org/trac/ghc/wiki/Building/CrossCompiling
>
> Is:
>
> --with-gcc=<gcc> --with-ld=<ld> --with-nm=<nm> --with-objdump=<objdump>
>
> Necessary?  I guess if the given tools are not on PATH with the normal
> cross-compiling prefix?

Right, I didn't know that autoconf would automatically look for the
tools as <platform>-tool.  I'll update the docs.

>> Please edit away.  In particular I haven't investigated
>> cross-compiling with LLVM
>
> That's a bit broken right now (since GHC doesn't pass through the target
> to LLVM), but otherwise just involves having an LLVM that supports the
> target on PATH.
>
> Also:
>
> cabal --with-ghc=<cross-ghc> --with-ld=<ld> ...
>
> What does this do?  So far I've been careful to use a seperate
> ~/.cabal-blah directory to not entangle my two cabals.  Will it handle
> things nicely?  Do you need to tell it where to find ghc-pkg, or will
> --with-ghc work for that? Maybe I can switch to just a script/alias
> instead of a whole config file :)

Ah, in my case the GHC I built was called ghc-7.7.20130116, so it didn't
clash with anything else in .cabal.  You could also configure your cabal
to put the arch/os in the directory name.

Cheers,
        Simon






Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Stephen Paul Weber
Somebody claiming to be Simon Marlow wrote:
>On 18/01/13 15:25, Stephen Paul Weber wrote:
>>Somebody claiming to be Simon Marlow wrote:
>Right, I didn't know that autoconf would automatically look for the tools
>as <platform>-tool.  I'll update the docs.

Cool.  Looks good.

>>cabal --with-ghc=<cross-ghc> --with-ld=<ld> ...
>>
>Ah, in my case the GHC I built was called ghc-7.7.20130116, so it didn't
>clash with anything else in .cabal.  You could also configure your cabal to
>put the arch/os in the directory name.

~/.cabal/bin ?

Nothing in ~/.cabal looks prefixed to me, by default.  Maybe my cabal is
just old.

Do I need to tell it where to find ghc-pkg, or does that not matter?

--
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130118/fb806462/attachment.pgp>

Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Simon Marlow-7
On 18/01/13 16:17, Stephen Paul Weber wrote:

> Somebody claiming to be Simon Marlow wrote:
>> On 18/01/13 15:25, Stephen Paul Weber wrote:
>>> Somebody claiming to be Simon Marlow wrote:
>> Right, I didn't know that autoconf would automatically look for the
>> tools as <platform>-tool.  I'll update the docs.
>
> Cool.  Looks good.
>
>>> cabal --with-ghc=<cross-ghc> --with-ld=<ld> ...
>>>
>> Ah, in my case the GHC I built was called ghc-7.7.20130116, so it
>> didn't clash with anything else in .cabal.  You could also configure
>> your cabal to put the arch/os in the directory name.
>
> ~/.cabal/bin ?

I'm thinking mainly about libraries here, yes if you want to build
binaries then there needs to be a prefix on the bin dir too.

> Nothing in ~/.cabal looks prefixed to me, by default.  Maybe my cabal is
> just old.

The defaults are:

install-dirs user
   -- prefix: /home/simonmar/.cabal
   -- bindir: $prefix/bin
   -- libdir: $prefix/lib
   -- libsubdir: $pkgid/$compiler
   -- libexecdir: $prefix/libexec
   -- datadir: $prefix/share
   -- datasubdir: $pkgid
   -- docdir: $datadir/doc/$pkgid
   -- htmldir: $docdir/html
   -- haddockdir: $htmldir

that is, libs go in .cabal/lib/$pkgid/$compiler by default.

I just discovered that cabal isn't using the target $arch/$os though, so
I've filed a bug: https://github.com/haskell/cabal/issues/1184

> Do I need to tell it where to find ghc-pkg, or does that not matter?

No, cabal will find it.

Cheers,
        Simon



Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Stephen Paul Weber
In reply to this post by Simon Marlow-7
Somebody claiming to be Simon Marlow wrote:
>On 17/01/13 14:08, Simon Marlow wrote:
>Ok, new wiki page is here:
>
>http://hackage.haskell.org/trac/ghc/wiki/Building/CrossCompiling

This is my report on using these instructions to build for
i486-pc-nto-qnx8.0.0

TL;DR: Needs one GHC patch and one base patch, has to use integer-simple,
and make install still does not work.  Otherwise works fine.

Needs the patch to add QNX as a supported OS (first patch from
<http://www.haskell.org/pipermail/cvs-ghc/2012-December/079078.html>) to
even try to configure, which is expected.  After applying that patch:

./configure --target=i486-pc-nto-qnx8.0.0 --prefix="${QNX_HOST}/usr"

succeeds.  Copied build.mk.sample to build.mk and added:

Stage1Only = YES

as instructed.  Uncommented the "quick" build type.  Type "make" and get:

$ make
+ test -f mk/config.mk.old
+ cp -p mk/config.mk mk/config.mk.old
touch -r mk/config.mk.old mk/config.mk
+ test -f mk/project.mk.old
+ cp -p mk/project.mk mk/project.mk.old
touch -r mk/project.mk.old mk/project.mk
+ test -f compiler/ghc.cabal.old
+ cp -p compiler/ghc.cabal compiler/ghc.cabal.old
touch -r compiler/ghc.cabal.old compiler/ghc.cabal
===--- building phase 0
make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds
libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/package-data.mk: No such file or directory
libraries/Cabal/Cabal/ghc.mk:3: libraries/Cabal/Cabal/dist-boot/package-data.mk: No such file or directory
libraries/binary/ghc.mk:3: libraries/binary/dist-boot/package-data.mk: No such file or directory
libraries/bin-package-db/ghc.mk:3: libraries/bin-package-db/dist-boot/package-data.mk: No such file or directory
libraries/hoopl/ghc.mk:3: libraries/hoopl/dist-boot/package-data.mk: No such file or directory
libraries/transformers/ghc.mk:3: libraries/transformers/dist-boot/package-data.mk: No such file or directory
compiler/ghc.mk:439: compiler/stage1/package-data.mk: No such file or directory
utils/hsc2hs/ghc.mk:15: utils/hsc2hs/dist/package-data.mk: No such file or directory
ghc/ghc.mk:109: ghc/stage1/package-data.mk: No such file or directory
libraries/dph/ghc.mk:123: *** dph_th_deps(v): libraries/dph/dph-base_dist-install_GHCI_LIB not defined!.  Stop.
make: *** [all] Error 2

So, I have commented out the dph libraries from ./packages
I think this is still expected behaviour.  Should something about this
possibility be added to the wiki page?

The next thing to happen is I run into
<http://hackage.haskell.org/trac/ghc/ticket/7519>, so I apply the patch from
there and continue.

building integer-gmp fails with:

cd libraries/integer-gmp/gmp; (set -o igncr 2>/dev/null) && set -o igncr;
export SHELLOPTS; \
            PATH=`pwd`:$PATH; \
            export PATH; \
            cd gmpbuild && \
            CC=/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
NM=/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-nm
AR=/usr/bin/ar /bin/sh configure \
                  --enable-shared=no \
                  --host=i386-unknown-linux --build=i386-unknown-linux
checking build system type... i386-unknown-linux-gnu
checking host system type... i386-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=32
checking whether
/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
is gcc... yes
checking compiler
/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
-m32 -O2 -pedantic -fomit-frame-pointer ... no, program does not run
checking compiler
/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
-O2 -pedantic -fomit-frame-pointer ... no, program does not run
configure: error: could not find a working compiler, see config.log for
details
make[1]: *** [libraries/integer-gmp/gmp/gmp.h] Error 1
make: *** [all] Error 2

I'm not sure why it does not get the target right, but I can work around
this by adding the following to build.mk:

INTEGER_LIBRARY=integer-simple

So I do this and continue, which leads me to:

make[1]: *** No rule to make target `libraries/integer-gmp/dist-install/build/GHC/Integer.hi', needed by `libraries/base/dist-install/build/GHC/Base.o'.  Stop.
make: *** [all] Error 2

Oh, it didn't switch.  Hmm.

cd libraries/base && make clean && cd -

Then I get:

libraries/base/GHC/Base.lhs:124:1:
     Bad interface file: /home/singpolyma/src/ghc-qnx-nto-i486/libraries/integer-simple/dist-install/build/GHC/Integer.hi
         Something is amiss; requested module  integer-simple-0.1.1.0:GHC.Integer differs from name found in the interface file integer-simple:GHC.Integer
make[1]: *** [libraries/base/dist-install/build/GHC/Base.o] Error 1
make: *** [all] Error 2

Okay, fine:

make clean

I didn't want to do that, because of how long this all takes, but I have
done it.  So I continue... and get the same thing again.

cd libraries/integer-simple && make clean && cd -

Same thing.  What?  I delete my entire GHC source repo and copy from a
pristine copy.  Apply the two patches and two additions to mk/build.mk from
above.  Comment out dph stuff from ./packages.  Ok, trying again.  Ah!  
Good!  Now I get <http://hackage.haskell.org/trac/ghc/ticket/7490>, which is
expected.  So I just type make again to continue.

Success!  I type `make install` which results in:

Installing library in
/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/transformers-0.3.0.0
"/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/bin/ghc-pkg" --force --global-package-db "/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/package.conf.d" update rts/package.conf.install
/bin/sh: 1: /home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/bin/ghc-pkg: not found
make[1]: *** [install_packages] Error 127
make: *** [install] Error 2

Which I have reported before.

So, there it is.  I will try with arm-unknown-nto-qnx8.0.0 (uses LLVM) next.

--
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph


Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Stephen Paul Weber
Somebody claiming to be Stephen Paul Weber wrote:

>Somebody claiming to be Simon Marlow wrote:
>>On 17/01/13 14:08, Simon Marlow wrote:
>>Ok, new wiki page is here:
>>
>>http://hackage.haskell.org/trac/ghc/wiki/Building/CrossCompiling
>
>TL;DR: Needs one GHC patch and one base patch, has to use integer-simple,
>and make install still does not work.  Otherwise works fine.
>
>So, there it is.  I will try with arm-unknown-nto-qnx8.0.0 (uses LLVM) next.

Start with a pristine GHC checkout.  Apply the QNX patch to GHC< and the
CLK_TCK patch to base.  Set up as in the wiki page, and also use
integer-simple (see previous email).

./configure --target=arm-unknown-nto-qnx8.0.0eabi --prefix="${QNX_HOST}/usr"

This eventually results in:

/tmp/ghc5601_0/ghc5601_0.bc:1085:0:
      Error: bad instruction `addl $28,%esp'

/tmp/ghc5601_0/ghc5601_0.bc:1086:0:  Error: bad instruction `ret'

/tmp/ghc5601_0/ghc5601_0.bc:1090:0:
      Error: unrecognized symbol type ""
make[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1
make: *** [all] Error 2

And much similar output.  This is because during cross-compiling, the triple
is not passed through to LLVM, so LLVM assumes it is compiling for native.  
I have mentioned this before, but have now filed it as
<http://hackage.haskell.org/trac/ghc/ticket/7608>.

Apply the following as a hack:

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 9e8556f..bcc1aa9 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1393,7 +1393,8 @@ runPhase LlvmOpt input_fn dflags
      liftIO $ SysTools.runLlvmOpt dflags
                 ([ SysTools.FileOption "" input_fn,
                      SysTools.Option "-o",
-                    SysTools.FileOption "" output_fn]
+                    SysTools.FileOption "" output_fn
+                    , SysTools.Option "-mtriple=arm-unknown-nto-qnx8.0.0eabi"]
                  ++ optFlag
                  ++ [SysTools.Option tbaa]
                  ++ map SysTools.Option lo_opts)

I then hit <http://hackage.haskell.org/trac/ghc/ticket/7490>, which is
expected.  Type make again to continue.

By the way, lots of:

when making flags consistent: Warning:
     No native code generator, so using LLVM

I assume there's some sort of option I can set so that it expects this.

Success!  make install still fails with:

Installing library in
/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/transformers-0.3.0.0
"/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/bin/ghc-pkg" --force --global-package-db "/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/package.conf.d" update rts/package.conf.install
/bin/sh: 1: /home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/bin/ghc-pkg: not found
make[1]: *** [install_packages] Error 127
make: *** [install] Error 2

--
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph


Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Simon Marlow-7
In reply to this post by Stephen Paul Weber
On 19/01/13 00:44, Stephen Paul Weber wrote:

> Needs the patch to add QNX as a supported OS (first patch from
> <http://www.haskell.org/pipermail/cvs-ghc/2012-December/079078.html>) to
> even try to configure, which is expected.  After applying that patch:

I'll get that patch committed.

> ./configure --target=i486-pc-nto-qnx8.0.0 --prefix="${QNX_HOST}/usr"
>
> succeeds.  Copied build.mk.sample to build.mk and added:
>
> Stage1Only = YES
>
> as instructed.  Uncommented the "quick" build type.  Type "make" and get:
>
> $ make
> + test -f mk/config.mk.old
> + cp -p mk/config.mk mk/config.mk.old
> touch -r mk/config.mk.old mk/config.mk
> + test -f mk/project.mk.old
> + cp -p mk/project.mk mk/project.mk.old
> touch -r mk/project.mk.old mk/project.mk
> + test -f compiler/ghc.cabal.old
> + cp -p compiler/ghc.cabal compiler/ghc.cabal.old
> touch -r compiler/ghc.cabal.old compiler/ghc.cabal
> ===--- building phase 0
> make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds
> libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/package-data.mk: No such
> file or directory
> libraries/Cabal/Cabal/ghc.mk:3:
> libraries/Cabal/Cabal/dist-boot/package-data.mk: No such file or directory
> libraries/binary/ghc.mk:3: libraries/binary/dist-boot/package-data.mk:
> No such file or directory
> libraries/bin-package-db/ghc.mk:3:
> libraries/bin-package-db/dist-boot/package-data.mk: No such file or
> directory
> libraries/hoopl/ghc.mk:3: libraries/hoopl/dist-boot/package-data.mk: No
> such file or directory
> libraries/transformers/ghc.mk:3:
> libraries/transformers/dist-boot/package-data.mk: No such file or directory
> compiler/ghc.mk:439: compiler/stage1/package-data.mk: No such file or
> directory
> utils/hsc2hs/ghc.mk:15: utils/hsc2hs/dist/package-data.mk: No such file
> or directory
> ghc/ghc.mk:109: ghc/stage1/package-data.mk: No such file or directory
> libraries/dph/ghc.mk:123: *** dph_th_deps(v):
> libraries/dph/dph-base_dist-install_GHCI_LIB not defined!.  Stop.
> make: *** [all] Error 2
>
> So, I have commented out the dph libraries from ./packages
> I think this is still expected behaviour.  Should something about this
> possibility be added to the wiki page?

Yes, you need to omit the dph packages when getting the subrepos.  I've
added that to the page.

> The next thing to happen is I run into
> <http://hackage.haskell.org/trac/ghc/ticket/7519>, so I apply the patch
> from there and continue.
>
> building integer-gmp fails with:
>
> cd libraries/integer-gmp/gmp; (set -o igncr 2>/dev/null) && set -o
> igncr; export SHELLOPTS; \
>          PATH=`pwd`:$PATH; \
>          export PATH; \
>          cd gmpbuild && \
>
> CC=/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
> NM=/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-nm
> AR=/usr/bin/ar /bin/sh configure \
>            --enable-shared=no \
>            --host=i386-unknown-linux --build=i386-unknown-linux
> checking build system type... i386-unknown-linux-gnu
> checking host system type... i386-unknown-linux-gnu
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for a thread-safe mkdir -p... /bin/mkdir -p
> checking for gawk... no
> checking for mawk... mawk
> checking whether make sets $(MAKE)... yes
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking ABI=32
> checking whether
> /home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
> is gcc... yes
> checking compiler
> /home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
> -m32 -O2 -pedantic -fomit-frame-pointer ... no, program does not run
> checking compiler
> /home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/bin/i486-pc-nto-qnx8.0.0-gcc
> -O2 -pedantic -fomit-frame-pointer ... no, program does not run
> configure: error: could not find a working compiler, see config.log for
> details
> make[1]: *** [libraries/integer-gmp/gmp/gmp.h] Error 1
> make: *** [all] Error 2
>
> I'm not sure why it does not get the target right, but I can work around
> this by adding the following to build.mk:
>
> INTEGER_LIBRARY=integer-simple

Right, I've added this to the page too.

> So I do this and continue, which leads me to:
>
> make[1]: *** No rule to make target
> `libraries/integer-gmp/dist-install/build/GHC/Integer.hi', needed by
> `libraries/base/dist-install/build/GHC/Base.o'.  Stop.
> make: *** [all] Error 2
>
> Oh, it didn't switch.  Hmm.

I believe a 'make distclean' is necessary after changing
INTEGER_LIBRARY, because it gets stuck into GHC's Config.hs early on.  I
ran into exactly this in my build.  Also added this to the page.

> Success!  I type `make install` which results in:
>
> Installing library in
> /home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/transformers-0.3.0.0
>
> "/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/bin/ghc-pkg"
> --force --global-package-db
> "/home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/package.conf.d"
> update rts/package.conf.install
> /bin/sh: 1:
> /home/singpolyma/bbndk/host_10_0_9_404/linux/x86/usr/lib/ghc-7.7.20130118/bin/ghc-pkg:
> not found
> make[1]: *** [install_packages] Error 127
> make: *** [install] Error 2
>

Ok, we should fix 'make install'.  I didn't have much luck with it either.

Cheers,
        Simon




Reply | Threaded
Open this post in threaded view
|

[commit: ghc] master: Tidy up cross-compiling (109a1e5)

Stephen Paul Weber
Somebody claiming to be Simon Marlow wrote:
>On 19/01/13 00:44, Stephen Paul Weber wrote:
>>Needs the patch to add QNX as a supported OS (first patch from
>><http://www.haskell.org/pipermail/cvs-ghc/2012-December/079078.html>) to
>>even try to configure, which is expected.  After applying that patch:
>
>I'll get that patch committed.

Thanks :)

>>So, I have commented out the dph libraries from ./packages
>>I think this is still expected behaviour.  Should something about this
>>possibility be added to the wiki page?
>
>Yes, you need to omit the dph packages when getting the subrepos.  
>I've added that to the page.

Looks good.

>>I'm not sure why it does not get the target right, but I can work around
>>this by adding the following to build.mk:
>>
>>INTEGER_LIBRARY=integer-simple
>
>Right, I've added this to the page too.

Yeah.  It seems like target isn't even being passed through, but it could be
that I just don't have gmp in my toolchain as well.  Not sure.

>Ok, we should fix 'make install'.  I didn't have much luck with it either.

:)

Thanks all!

--
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph