Re: Bug#191033: hugs98_98.200211-1(unstable/ia64): FTBFS: undefined reference to `main'

Isaac Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
Greetings.

The Debian autobuilders were unable to build hugs on a few platforms,
and I tried building Hugs from the distribution tarball and got
similar results on ia64 (on both Debian and Redhat).  Here's what
information I have.  Please let me know if I can get more information
for you.

The error looks like this:
./ffihugs -N +G -W +L"../lib/exts/Storable_aux.c" HugsStorable
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x41): undefined reference to `main'
collect2: ld returned 1 exit status
runhugs: Error occurred
Reading file "/house/ijones/tmp//lib/hugs/lib/exts/HugsStorable.hs":
ERROR "/house/ijones/tmp//lib/hugs/lib/exts/HugsStorable.hs" - Error
while running compilation command 'gcc  -D__HUGS__ "-I/house/ijones/tmp//lib/hugs/include""/house/ijones/tmp//lib/hugs/lib/exts/HugsStorable.c" -o "/house/ijones/tmp//lib/hugs/lib/exts/HugsStorable.so" ../lib/exts/Storable_aux.c' 

This seems to have something to do with the "MKDLL_CMD" macro (in
src/config.h) getting a bad value for these platforms.  In particular,
on ia64, it reads: define MKDLL_CMD "gcc "

whereas on i386, it reads:
#define MKDLL_CMD "gcc -shared"



This is what looks like the relevant configure output on ia64:
checking if '/LD' builds loadable libraries... 
checking if '/LD /ML /nologo' builds loadable libraries... 
checking if '-shared' builds loadable libraries... 
checking if '-bundle' builds loadable libraries... 
checking if '-bundle -lc' builds loadable libraries... 
checking if '-r' builds loadable libraries... 

And the same configure output on i386:
checking if '/LD' builds loadable libraries...
checking if '/LD /ML /nologo' builds loadable libraries...
checking if '-shared' builds loadable libraries... -shared
checking if '-bundle' builds loadable libraries... (cached) -shared
checking if '-bundle -lc' builds loadable libraries... (cached) -shared
checking if '-r' builds loadable libraries... (cached) -shared

It also fails with similar output on hppa and alpha.  Complete build
logs for a variety of architectures can be found here (where you can
see that the previous release was able to build on these
architectures): http://buildd.debian.org/build.php?arch=&pkg=hugs98

However, when I alter config.h by hand to include the -shared flag,
and rerun make;make install (without rerunning configure) I get this
output:

./ffihugs +N +G -W +L"../libraries/Hugs/Storable_aux.c" Hugs.Storable
./ffihugs +N +G -W Foreign.Marshal.Alloc
runhugs: Error occurred
Reading file "/house/ijones/tmp//lib/hugs/libraries/Foreign/Marshal/Alloc.hs":
Reading file "/house/ijones/tmp//lib/hugs/libraries/Foreign/C/Types.hs":
Reading file "/house/ijones/tmp//lib/hugs/libraries/Foreign/C/TypesISO.hs":
Reading file "/house/ijones/tmp//lib/hugs/libraries/Foreign/Storable.hs":
Reading file "/house/ijones/tmp//lib/hugs/libraries/Control/Monad.hs":
Reading file "/house/ijones/tmp//lib/hugs/libraries/Hugs/Storable.hs":
Reading file "/house/ijones/tmp//lib/hugs/libraries/Foreign/Storable.hs":
Reading file "/house/ijones/tmp//lib/hugs/libraries/Foreign/C/TypesISO.hs":
Type checking
ERROR "/house/ijones/tmp//lib/hugs/libraries/Foreign/C/TypesISO.hs":41 - Implementation of .&. requires extra context
*** Expected type   : Bits CPtrdiff => CPtrdiff -> CPtrdiff -> CPtrdiff
*** Missing context : Bits Int64

Let me know if I can offer any more help.


peace,

isaac
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.