Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143141 - dev-lang/hugs98-2006.9 version bump
Summary: dev-lang/hugs98-2006.9 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
: 159110 197224 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-07 14:12 UTC by Anakim Border
Modified: 2008-01-26 20:30 UTC (History)
4 users (show)

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


Attachments
ebuild (hugs98-2006.5.ebuild,2.96 KB, text/plain)
2006-08-07 14:13 UTC, Anakim Border
Details
find patch (hugs98-2006.5-find.patch,577 bytes, patch)
2006-08-07 14:13 UTC, Anakim Border
Details | Diff
full compilation log, showing runhugs internal error (compile.log,34.86 KB, text/plain)
2006-08-08 14:15 UTC, Anakim Border
Details
the new ebuild. Works for me. (hugs98-2006.9.ebuild,3.06 KB, text/plain)
2007-10-27 17:40 UTC, Gasper Azman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anakim Border 2006-08-07 14:12:58 UTC
I've upgraded the existing ebuild to work with hugs98-plus-May2006 (2006.5).

Please note that hugs is really strict about CFLAGs; the compilation breaks even when using something as innocent as -march. I've added an ewarn-ing about that.
Comment 1 Anakim Border 2006-08-07 14:13:33 UTC
Created attachment 93693 [details]
ebuild
Comment 2 Anakim Border 2006-08-07 14:13:52 UTC
Created attachment 93694 [details, diff]
find patch
Comment 3 Duncan Coutts (RETIRED) gentoo-dev 2006-08-08 05:10:22 UTC
(In reply to comment #0)
> I've upgraded the existing ebuild to work with hugs98-plus-May2006 (2006.5).

Thanks Anakim.

> Please note that hugs is really strict about CFLAGs; the compilation breaks
> even when using something as innocent as -march. I've added an ewarn-ing about
> that.

Hmm, that's not so good as many arches really do need to use that (or -mcpu). Sparc is an exmple of this.

Perhaps you/we can investigate what's going on with flags like -march. I'm afraid I've not had time to look yet, how does it break with -march?
Comment 4 Anakim Border 2006-08-08 14:14:55 UTC
> Perhaps you/we can investigate what's going on with flags like -march. I'm
> afraid I've not had time to look yet, how does it break with -march?

I'm attaching the full compilation log.

It seems like -march is interfering with the build of "runhugs". As soon as the resulting executable is run, it stops with an "INTERNAL ERROR: discrArity".

There's no trace of such a problem in the Hugs bug tracker (http://hackage.haskell.org/trac/hugs)

Searching the sources, I found the definition of the discrArity function (src/compiler.c, line 1544):

Int discrArity(d)                      /* Find arity of discriminator      */
Cell d; {
    switch (whatIs(d)) {
        case NAME      : return name(d).arity;
        case TUPLE     : return tupleOf(d);
        case CHARCELL  : return 0;
#if TREX
        case AP        : switch (whatIs(fun(d))) {
#if NPLUSK
                             case ADDPAT : return 1;
#endif
                             case EXT    : return 2;
                             default     : return 0;
                         }
#else
#if NPLUSK
        case AP        : return (whatIs(fun(d))==ADDPAT) ? 1 : 0;
#else
        case AP        : return 0;      /* must be an Int or Double lit    */
#endif
#endif
    }
    internal("discrArity");
    return 0;/*NOTREACHED*/
}

internal() gets called because whatIs(d) it's returning an unexpected value. One could trace through that function with a debugger and compare its behavior with and without -march...

As a last note, something I forgot to mention erlier. I'm actually using gcc 4.1.1; unfortunately at this time I have no way to test the ebuild on an older 3.something version.
Comment 5 Anakim Border 2006-08-08 14:15:53 UTC
Created attachment 93794 [details]
full compilation log, showing runhugs internal error
Comment 6 Duncan Coutts (RETIRED) gentoo-dev 2006-08-08 15:16:22 UTC
Thanks very much Anakim for your detailed report.
Comment 7 Lennart Kolmodin (RETIRED) gentoo-dev 2006-08-11 12:23:07 UTC
Hi Anakim,

which CFLAGS and and platform where you using when it broke?

I just successfully compiled your ebuild on x86 with
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
Comment 8 Anakim Border 2006-09-09 06:35:38 UTC
> which CFLAGS and and platform where you using when it broke?

Portage 2.1-r2 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r4 i686)
=================================================================
System uname: 2.6.17-gentoo-r4 i686 AMD Athlon(tm) XP
Gentoo Base System version 1.12.4
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -msse -O2 -pipe -fomit-frame-pointer -ftracer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="-march=athlon-xp -msse -O2 -pipe -fomit-frame-pointer -ftracer"

Since -ftracer is not completely safe, I disabled it before emerging hugs. But even that was not enough: I had to trim CFLAGS down to "-O2".
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2006-12-26 03:31:19 UTC
*** Bug 159110 has been marked as a duplicate of this bug. ***
Comment 10 Elias Pipping (RETIRED) gentoo-dev 2007-06-13 17:20:08 UTC
Does the problem described above still exist in hugs98-plus-Sep2006?
Comment 11 Anakim Border 2007-06-14 17:55:07 UTC
> Does the problem described above still exist in hugs98-plus-Sep2006?

I was able to compile hugs98-plus-Sep2006 successfully without changing CFLAGS. Seems like the problem has been fixed.

Comment 12 Jakub Moc (RETIRED) gentoo-dev 2007-10-27 17:31:37 UTC
*** Bug 197224 has been marked as a duplicate of this bug. ***
Comment 13 Gasper Azman 2007-10-27 17:40:07 UTC
Created attachment 134498 [details]
the new ebuild. Works for me.

I posted this in the bug that was just marked duplicate, but since no-one reads duplicate bugs, I'm reposting the new ebuild here.

The change from 2005.3-r2 ebuild is basically this:

diff /usr/portage/dev-lang/hugs98/hugs98-2005.3-r2.ebuild /usr/local/portage/dev-lang/hugs98/hugs98-2006.9.ebuild --unified
--- /usr/portage/dev-lang/hugs98/hugs98-2005.3-r2.ebuild        2007-07-22 11:35:34.000000000 +0200
+++ /usr/local/portage/dev-lang/hugs98/hugs98-2006.9.ebuild     2007-10-27 18:54:01.745041793 +0200
@@ -31,14 +31,15 @@
 HUGS_MONTH=$(transform_month ${HUGS_MONTH_NR})
 MY_PV="${HUGS_MONTH}$(get_major_version )"
 MY_P="${PN}-${MY_PV}"
+MY_DIR=$(printf "%4d-%02d" $(get_major_version) ${HUGS_MONTH_NR})
 S=${WORKDIR}/${MY_P}
 DESCRIPTION="The Hugs98 Haskell interpreter"
-SRC_URI="http://cvs.haskell.org/Hugs/downloads/${MY_PV}/${MY_P}.tar.gz
-                http://cvs.haskell.org/Hugs/downloads/${MY_PV}/${MY_P}-patch.gz"
+SRC_URI="http://cvs.haskell.org/Hugs/downloads/${MY_DIR}/${MY_P}.tar.gz"
+#               http://cvs.haskell.org/Hugs/downloads/${MY_DIR}/${MY_P}-patch.gz"
 HOMEPAGE="http://www.haskell.org/hugs/"

 SLOT="0"
-KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd"
+KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 sparc ~x86 ~x86-fbsd"
 LICENSE="as-is"

 RDEPEND="
@@ -55,9 +56,9 @@
 src_unpack() {
        base_src_unpack
        cd ${S}
-       epatch ${WORKDIR}/${MY_P}-patch
-       epatch ${FILESDIR}/${P}-openal.patch
-       epatch ${FILESDIR}/${P}-find.patch
+#      epatch ${WORKDIR}/${MY_P}-patch
+#      epatch ${FILESDIR}/${P}-openal.patch
+#      epatch ${FILESDIR}/${P}-find.patch

        if ! use X; then
                sed -i -e 's/X11//' -e 's/HGL//' "${S}/Makefile" \
Comment 14 Duncan Coutts (RETIRED) gentoo-dev 2008-01-26 20:30:59 UTC
Now in portage.