Compiling GHC

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

Compiling GHC

Chris Witte
I'm tying to compile GHC under mingw (winxp with mingw no cygwin),
everything appears to go OK but when I run make install it fails to
copy some files

cp -rp ./../include/* /usr/local/include/mingw
cp: cannot stat `./../include/*': No such file or directory
make: [install] Error 1 (ignored)
cp -rp ./../lib/gcc-lib/mingw32/3.4.2/* /usr/local/gcc-lib
cp: cannot stat `./../lib/gcc-lib/mingw32/3.4.2/*': No such file or directory
make: [install] Error 1 (ignored)
cp -rp ./../lib/gcc/mingw32/3.4.2/* /usr/local/gcc-lib
cp: cannot stat `./../lib/gcc/mingw32/3.4.2/*': No such file or directory
make: [install] Error 1 (ignored)
cp -rp ./../libexec/gcc/mingw32/3.4.2/* /usr/local/gcc-lib
cp: cannot stat `./../libexec/gcc/mingw32/3.4.2/*': No such file or directory
make: [install] Error 1 (ignored)
cp ./../lib/*.* /usr/local/gcc-lib
cp: cannot stat `./../lib/*.*': No such file or directory
make: [install] Error 1 (ignored)
cp ./gcc.exe /usr/local
cp: cannot stat `./gcc.exe': No such file or directory
make: [install] Error 1 (ignored)
cp ./as.exe /usr/local/gcc-lib
cp: cannot stat `./as.exe': No such file or directory
make: [install] Error 1 (ignored)
cp ./ld.exe /usr/local/gcc-lib
cp: cannot stat `./ld.exe': No such file or directory
make: [install] Error 1 (ignored)
cp ./dllwrap.exe /usr/local/gcc-lib
cp: cannot stat `./dllwrap.exe': No such file or directory
make: [install] Error 1 (ignored)
cp ./dlltool.exe /usr/local/gcc-lib
cp: cannot stat `./dlltool.exe': No such file or directory
make: [install] Error 1 (ignored)
cp /c/ghc/ghc-6.6/bin/../perl.exe /usr/local
cp /c/ghc/ghc-6.6/bin/../perl56.dll /usr/local
for i in ANNOUNCE LICENSE README; do \
       /bin/install -c -m 644    $i /usr/local; \
done


and then when I try and run, say, GHCi I get

$ ghcii.sh
  ___         ___ _
 / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.7.20070323, for
Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... ghc.exe: unable to load package `base'
ghc.exe:
C:/msys/1.0/local/HSbase.o: unknown symbol `_gettimeofday'


any ideas on what could be causing this.


Cheers
Chris Witte
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Ian Lynagh
On Fri, Mar 30, 2007 at 04:36:32PM +1000, Chris Witte wrote:
> I'm tying to compile GHC under mingw (winxp with mingw no cygwin),
>
> Loading package base ... linking ... ghc.exe: unable to load package `base'
> ghc.exe:
> C:/msys/1.0/local/HSbase.o: unknown symbol `_gettimeofday'
>
>
> any ideas on what could be causing this.

What does

    grep -i gettimeofday mk/config.h

say?

If HAVE_GETTIMEOFDAY is defined then either comment it out (between
running configure and running make), or work out why the configure test
is succeeding but it doesn't work when GHC tries to use it.


Thanks
Ian

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Matthew William Cox
In reply to this post by Chris Witte
On Fri, 30 Mar 2007 16:36:32 +1000
"Chris Witte" <[hidden email]> wrote:

> cp: cannot stat `./../libexec/gcc/mingw32/3.4.2/*': No such file or directory

As a first guess, I'd say your paths are set up wrong. Ask this question again on a mingw list.

Matthew Cox
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Esa Ilari Vuokko
In reply to this post by Chris Witte
Hi,

On 3/30/07, Chris Witte <[hidden email]> wrote:
> I'm tying to compile GHC under mingw (winxp with mingw no cygwin),
> everything appears to go OK but when I run make install it fails to
> copy some files

[snip copy errors on make install]

> Loading package base ... linking ... ghc.exe: unable to load package `base'
> ghc.exe:
> C:/msys/1.0/local/HSbase.o: unknown symbol `_gettimeofday'
>
>
> any ideas on what could be causing this.

My guess is that your mingw version is diffrent from the one makefile
assumes.  Atleast that problem I have had in past - using diffrent
mingw than ghc/mingw maintainer.  You can check this by running
in-place scripts and checking if ghci works that way.

You could also try copying neccesary stuff from existing ghc
installation - but that might cause even more wierd errors.

HTH,
Esa Ilari Vuokko
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Chris Witte
In reply to this post by Ian Lynagh
HAVE_GETTIMEOFDAY is defined. I wrote a quick c program to check and I
can use gettimeofday fine. I can't work out why ghc can't find it. How
can I work out where ghc is searching to find it?

Chris.

On 3/30/07, Ian Lynagh <[hidden email]> wrote:

> On Fri, Mar 30, 2007 at 04:36:32PM +1000, Chris Witte wrote:
> > I'm tying to compile GHC under mingw (winxp with mingw no cygwin),
> >
> > Loading package base ... linking ... ghc.exe: unable to load package `base'
> > ghc.exe:
> > C:/msys/1.0/local/HSbase.o: unknown symbol `_gettimeofday'
> >
> >
> > any ideas on what could be causing this.
>
> What does
>
>     grep -i gettimeofday mk/config.h
>
> say?
>
> If HAVE_GETTIMEOFDAY is defined then either comment it out (between
> running configure and running make), or work out why the configure test
> is succeeding but it doesn't work when GHC tries to use it.
>
>
> Thanks
> Ian
>
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Andrew Appleyard
In reply to this post by Chris Witte
On 30/03/2007, at 4:36 pm, Chris Witte wrote:
> cp -rp ./../include/* /usr/local/include/mingw
> cp: cannot stat `./../include/*': No such file or directory

The source paths for these copies are derived from the path of the  
gcc binary ($GccDir).  Did you call configure with '--with-gcc=C:/
Mingw/bin/gcc.exe'?  I received those errors when I forgot to do that.

> Loading package base ... linking ... ghc.exe: unable to load  
> package `base'
> ghc.exe:
> C:/msys/1.0/local/HSbase.o: unknown symbol `_gettimeofday'

I think that 'gettimeofday' is statically linked into the ghc  
executable, so it's just that GHCi doesn't know about it.  Adding a:

   Sym(gettimeofday) \

line to the RTS_MINGW_ONLY_SYMBOLS #define in rts/Linker.c (from line  
265) seemed to fix the problem for me.

I'm not sure if this is a GHCi bug or something else being awry.  
'gettimeofday' was added to the mingwex library in mingw-
runtime-3.10, which was released in July last year, so I would have  
expected this problem to have come up before now...

Regards,
Andrew.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Chris Witte
On 4/11/07, Andrew Appleyard <[hidden email]> wrote:

> The source paths for these copies are derived from the path of the
> gcc binary ($GccDir).  Did you call configure with '--with-gcc=C:/
> Mingw/bin/gcc.exe'?  I received those errors when I forgot to do that.


Yep that fixed that. Thanks.


> I think that 'gettimeofday' is statically linked into the ghc
> executable, so it's just that GHCi doesn't know about it.  Adding a:
>
>    Sym(gettimeofday) \
>
> line to the RTS_MINGW_ONLY_SYMBOLS #define in rts/Linker.c (from line
> 265) seemed to fix the problem for me.
>
> I'm not sure if this is a GHCi bug or something else being awry.
> 'gettimeofday' was added to the mingwex library in mingw-
> runtime-3.10, which was released in July last year, so I would have
> expected this problem to have come up before now...

I made this change but I still get the error
unknown symbol `_gettimeofday'
I'm using mingw 5.1.3 which as far as i can tell should use the 3.11 runtime.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Andrew Appleyard
On 11/04/2007, at 7:52 pm, Chris Witte wrote:
> I made this change but I still get the error
> unknown symbol `_gettimeofday'
> I'm using mingw 5.1.3 which as far as i can tell should use the  
> 3.11 runtime.

Ensure that HAVE_GETTIMEOFDAY is defined in mk/config.h.

Also, I discovered that changes to Linker.c don't make it into  
ghc.exe if you just do a 'make' in the base directory.  You need to  
make the RTS, then link ghc with the new RTS.  The following commands  
work for me (more typing, but a lot faster than making clean):

   make -C rts
   rm compiler/stage2/ghc.exe
   make -C compiler stage=2
   make install

Hope that helps.

Regards,
Andrew.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Chris Witte
Awesome that works!
Thanks for your help.

Well that works for the ghc-6.7.20070402 tar ball but if I try and
pull down the darcs head it fails to make with

make[1]: Entering directory `/c/cwitte/source/ghc/libraries'
rm -f -f stamp/configure.library.*.base
cd base && setup/Setup configure \
                      \
                     --prefix=/usr/local \
                     --with-compiler=../../compiler/ghc-inplace.bat \
                     --with-hc-pkg=../../utils/ghc-pkg/ghc-pkg-inplace.bat \
                     --with-hsc2hs=../../utils/hsc2hs/hsc2hs-inplace.bat \
                     --with-ld=/mingw/bin/ld \
                     --datasubdir=ghc \
                     --haddock-args="--use-contents=../index.html
--use-index=../doc-index.html" \
                     --configure-option=--with-cc=c:/mingw/bin/gcc.exe
The system cannot find the path specified.
make[1]: *** [stamp/configure.library.build.base] Error 1
make[1]: Leaving directory `/c/cwitte/source/ghc/libraries'
make: *** [stage1] Error 2

I wonder what has changed between then and now to cause this.

On 4/12/07, Andrew Appleyard <[hidden email]> wrote:

> On 11/04/2007, at 7:52 pm, Chris Witte wrote:
> > I made this change but I still get the error
> > unknown symbol `_gettimeofday'
> > I'm using mingw 5.1.3 which as far as i can tell should use the
> > 3.11 runtime.
>
> Ensure that HAVE_GETTIMEOFDAY is defined in mk/config.h.
>
> Also, I discovered that changes to Linker.c don't make it into
> ghc.exe if you just do a 'make' in the base directory.  You need to
> make the RTS, then link ghc with the new RTS.  The following commands
> work for me (more typing, but a lot faster than making clean):
>
>    make -C rts
>    rm compiler/stage2/ghc.exe
>    make -C compiler stage=2
>    make install
>
> Hope that helps.
>
> Regards,
> Andrew.
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Compiling GHC

Andrew Appleyard
On 13/04/2007, at 11:03 am, Chris Witte wrote:
> Well that works for the ghc-6.7.20070402 tar ball but if I try and
> pull down the darcs head it fails to make with
> ...
> I wonder what has changed between then and now to cause this.

Not sure about that one, I was building ghc-6.6.  Darcs should be  
able to help you find the changes, of course which ones are causing  
the problem is another story...

Regards,
Andrew.


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe