Glasgow Haskell on different versions of Linux

Dear Haskellers, since version 6.2 we have 2 binary distributions for (generic) linux: for glibc 2.2 and glibc 2.3 Unfortunately our network has machines with both of this glibc versions. The problem seems to be related with the inclusion of "ctype.h". Is it possible to produce a GHC binary for glibc 2.3 that does not depend on ctype.h? I think such a binary (produced under glibc 2.3) would be executable also under linux with glibc 2.2 Currently ctype.h triggers the error under glibc 2.2 (if the glibc 2.3 binarias are used): /lib/i686/libc.so.6: version `GLIBC_2.3' not found (required by lib/i386-unknown-linux/ghc-6.2.1) and prevents linking under glibc 2.3 (if the glibc 2.2 release is used) Cheers Christian

2004-06-08T14:17:22 Christian Maeder:
since version 6.2 we have 2 binary distributions for (generic) linux: for glibc 2.2 and glibc 2.3
If it were possible to construct and ship a statically-linked ghc, that might be ideal; it should be portable across a wide range of Linuxes, regardless of what libc they have installed. Would even work on my Linux, which has no glibc at all, only uClibc (and so far I've been unsuccessful in my attempts to boostrap ghc in, boo-hoo). -Bennett

Christian Maeder wrote:
since version 6.2 we have 2 binary distributions for (generic) linux: for glibc 2.2 and glibc 2.3
Maybe this is no longer necessary. I've produced an installation (under glibc 2.2) that runs under glibc 2.2 and glibc 2.3. As also Volker Stolz suggested I've changed, after calling ./configure, a line in "mk/config.h" from #define HAVE_CTYPE_H 1 to /* #undef HAVE_CTYPE_H */ I'll try the same trick under glibc 2.3 later. Christian P.S. What is "ctype.h" good for?

Christian Maeder wrote:
As also Volker Stolz suggested I've changed, after calling ./configure, a line in "mk/config.h" from
#define HAVE_CTYPE_H 1
to
/* #undef HAVE_CTYPE_H */
with maeder@davinci -> rpm -q glibc glibc-2.3.3-97 maeder@davinci -> rpm -q gcc gcc-3.3.3-41 "make" (in ghc-6.2.1) fails (in ghc/GC.c) with: GC.c: In function `threadLazyBlackHole': GC.c:4049: warning: use of cast expressions as lvalues is deprecated make[2]: *** [GC.o] Fehler 1 Any explanations (too many warnings?) or suggestions Christian

Christian Maeder wrote:
maeder@davinci -> rpm -q gcc gcc-3.3.3-41
"make" (in ghc-6.2.1) fails (in ghc/GC.c) with:
GC.c: In function `threadLazyBlackHole': GC.c:4049: warning: use of cast expressions as lvalues is deprecated make[2]: *** [GC.o] Fehler 1
The actual error not messed up by warnings is: ../../ghc/compiler/ghc-inplace -optc-O -optc-w -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wbad-function-cast -optc-I../includes -optc-I. -optc-Iparallel -optc-DCOMPILING_RTS -optc-fomit-frame-pointer -H16m -O -O2 -static -c GC.c -o GC.o GC.c:1663: error: conflicting types for `evacuate' GC.c:145: error: previous declaration of `evacuate' make[2]: *** [GC.o] Fehler 1

Christian Maeder wrote:
The actual error not messed up by warnings is:
../../ghc/compiler/ghc-inplace -optc-O -optc-w -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wbad-function-cast -optc-I../includes -optc-I. -optc-Iparallel -optc-DCOMPILING_RTS -optc-fomit-frame-pointer -H16m -O -O2 -static -c GC.c -o GC.o GC.c:1663: error: conflicting types for `evacuate' GC.c:145: error: previous declaration of `evacuate' make[2]: *** [GC.o] Fehler 1
Sorry for answering my own question (or posing the question in the first place) this problem is fixed in the latest ghc/rts/GC.c by: // Use a register argument for evacuate, if available. #if __GNUC__ >= 2 #define REGPARM1 __attribute__((regparm(1))) #else #define REGPARM1 #endif Christian

I wrote:
since version 6.2 we have 2 binary distributions for (generic) linux: for glibc 2.2 and glibc 2.3
Maybe this is no longer necessary. I've produced an installation (under glibc 2.2) that runs under glibc 2.2 and glibc 2.3.
I've now also successfully installed ghc-6.2.1 from source under glibc 2.3 that works under glibc 2.2, too.
As also Volker Stolz suggested I've changed, after calling ./configure, a line in "mk/config.h" from
#define HAVE_CTYPE_H 1
to
/* #undef HAVE_CTYPE_H */
I'll try the same trick under glibc 2.3 later.
Yes, that basically did it. Thus the glibc 2.3 version (without ctype.h) should be sufficient as binary distribution in the future. Christian
participants (2)
-
Bennett Todd
-
Christian Maeder