Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 144028 - dev-haskell/gtk2hs does not build with glibc-2.4-r3
Summary: dev-haskell/gtk2hs does not build with glibc-2.4-r3
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Haskell Language team
Depends on:
Reported: 2006-08-15 11:22 UTC by Santiago Gala
Modified: 2007-07-29 22:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Santiago Gala 2006-08-15 11:22:32 UTC
./tools/c2hs/c2hsLocal +RTS -RTS -C-I/usr/include/glib-2.0 -C-I/usr/lib/glib-2.0/include -C-I/usr/include/pango-1.0 -C-I/usr/include/gtk-2.0 -C-I/usr/lib/gtk-2.0/include -C-I/usr/include/cairo -C-I/usr/include/atk-1.0 --cppopts='-include "gtk2hs-config.h"' --precomp=gtk/gtk.precomp gtk/gtk.h
c2hsLocal: Error in C header file.

/usr/include/bits/libio-ldbl.h:24: (column 30) [FATAL]
  >>> Syntax error!
  The symbol `_IO_vfscanf' does not fit here.

make[2]: *** [gtk/gtk.precomp] Error 1

First it gives this error, due to some breakage due to changes in glibc-2.4 headers, and later it fails about 

ghc-6.4.2: can't find file `gtk/Graphics/UI/Gtk/Pango/Types.hs'
    Failed to load interface for `Graphics.UI.Gtk.General.General':
        Could not find module `Graphics.UI.Gtk.General.General':
          use -v to see a list of the files searched for

according to talk in irc:// , this must be fixed in the c2hs code.
Comment 1 Santiago Gala 2006-08-15 11:24:46 UTC
The offending lines in gtk.i are:

# 1 "/usr/include/bits/libio-ldbl.h" 1 3 4
# 24 "/usr/include/bits/libio-ldbl.h" 3 4
extern __typeof (_IO_vfscanf) _IO_vfscanf __asm ("" "__nldbl_" "_IO_vfscanf");
extern __typeof (_IO_vfprintf) _IO_vfprintf __asm ("" "__nldbl_" "_IO_vfprintf");
# 539 "/usr/include/libio.h" 2 3 4
# 73 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4

Comment 2 Duncan Coutts (RETIRED) gentoo-dev 2006-10-04 16:04:43 UTC
Thanks. It's a problem in the bundled c2hs. I'll investigate a fix.
Comment 3 Duncan Coutts (RETIRED) gentoo-dev 2007-01-08 22:30:49 UTC
Santiago, if you're in the mood for testing, would you mind trying this pre-release tarball? I think I've fixed it.
Comment 4 Santiago Gala 2007-04-21 10:06:06 UTC
I couldn't try till now, so I had to try 0.9.11

I got a different error:

make[3]: Entering directory `/var/tmp/portage/dev-haskell/gtk2hs-0.9.11/work/gtk2hs-0.9.11'
./tools/c2hs/c2hsLocal +RTS -RTS -C-I/usr/include/glib-2.0 -C-I/usr/lib64/glib-2.0/include --cppopts='-include "gtk2hs-config.h"' --precomp=glib/glib.precomp glib-object.h
In file included from /usr/include/glib-2.0/glib/gstring.h:32,
                 from /usr/include/glib-2.0/glib/giochannel.h:32,
                 from /usr/include/glib-2.0/glib.h:47,
                 from /usr/include/glib-2.0/gobject/gtype.h:26,
                 from /usr/include/glib-2.0/gobject/gboxed.h:26,
                 from /usr/include/glib-2.0/glib-object.h:25:
/usr/include/glib-2.0/glib/gutils.h:381:1: warning: "GLIB_CHECK_VERSION" redefined
In file included from <command line>:1:
./gtk2hs-config.h:140:1: warning: this is the location of the previous definition
c2hsLocal: Error in C header file.

/usr/include/glib-2.0/glib/gutils.h:278: (column 26) [FATAL] 
  >>> Syntax error!
  The symbol `__extension__' does not fit here.

make[3]: *** [glib/glib.precomp] Error 1
make[3]: Leaving directory `/var/tmp/portage/dev-haskell/gtk2hs-0.9.11/work/gtk2hs-0.9.11'
make[2]: *** [glib/System/Glib/Types.hs] Error 2

The line contains a reference to G_UNLIKELY that looks like gets expended into something containing __extension__
Comment 5 Duncan Coutts (RETIRED) gentoo-dev 2007-04-21 11:42:58 UTC
Cheers. In the mean time I've fixed up c2hs so it can parse absolutely everything (the whole kernel and system packages). Unfortunately Gtk2Hs is using a fork of c2hs so some more work is required to get Gtk2Hs fixed.
Comment 6 Duncan Coutts (RETIRED) gentoo-dev 2007-07-11 14:05:57 UTC
It's fixed upstream hopefully now. Just waiting for a final 0.9.12 release.
If you want to try the pre-release tarball, it's here:
Comment 7 Duncan Coutts (RETIRED) gentoo-dev 2007-07-27 21:09:46 UTC
gtk2hs-0.9.12 is in portage. Hopefully this fixes the problem.
Can someone please test and confirm?

It works for me, but then I never experienced the original problem.
Comment 8 Santiago Gala 2007-07-29 21:51:44 UTC
Builds for me now, the bug was about it not building.

Last build was glibc-2.5-* and gcc-4.2, so it seems this version is prepared for the close future :)

Comment 9 Duncan Coutts (RETIRED) gentoo-dev 2007-07-29 22:01:14 UTC
Excellent, thanks Santiago :-)
I'll close the bug then.