Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40128 - ghc 6.2 fails to build using ghc 6.0.1
Summary: ghc 6.2 fails to build using ghc 6.0.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Andres Loeh (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-01 14:00 UTC by Fredrik Andersson
Modified: 2004-02-20 05:22 UTC (History)
1 user (show)

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


Attachments
patch to configure script to work around ArSupportsInput issue (ghc-6.2-configure.patch,902 bytes, patch)
2004-02-16 00:29 UTC, Sam Yates
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fredrik Andersson 2004-02-01 14:00:03 UTC
ghc 6.2 fails to build using ghc 6.0.1. After some time into the build process it fails with this error message:

/var/tmp/portage/ghc-6.2/work/ghc-6.2/libraries/readline/libHSreadline.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
<<ghc: 4301700 bytes, 2 GCs, 130212/130212 avg/max bytes residency (1 samples), 5M in use, 0.00 INIT (0.00 elapsed), 0.02 MUT (0.78 elapsed), 0.00 GC (0.01 elapsed) :ghc>>
make[1]: *** [stage2/ghc-6.2] Error 1
make[1]: Leaving directory `/var/tmp/portage/ghc-6.2/work/ghc-6.2/ghc/compiler'
make: *** [stage2] Error 2

!!! ERROR: dev-lang/ghc-6.2 failed.
!!! Function src_compile, Line 101, Exitcode 2
!!! make failed


Reproducible: Always
Steps to Reproduce:
1. emerge -u ghc

Actual Results:  
Build process starts and then fails

Expected Results:  
Built ghc

Portage 2.0.50_pre21 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20040117-r0,
2.4.24-ck1)
=================================================================
System uname: 2.4.24-ck1 i686 AMD Athlon(tm) XP 2400+
Gentoo Base System version 1.4.3.12
Autoconf: sys-devel/autoconf-2.59
Automake: sys-devel/automake-1.7.8
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -mmmx -msse -m3dnow -mfpmath=sse -O3 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon-xp -mmmx -msse -m3dnow -mfpmath=sse -O3 -funroll-loops
-pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aalib alsa apm arts avi berkdb cdr crypt cups directfb dvd
emacs encode encoder esd fbcon foomaticdb gdbm gif gpm gtk gtk2 imlib joystick
jpeg libg++ libwww mad mikmod mmx motif mozilla mpeg ncurses nls oggvorbis
opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell sse
ssl svga tcltk tcpd tetex truetype usb x86 xml2 xmms xv zlib"
Comment 1 George Shapovalov (RETIRED) gentoo-dev 2004-02-02 13:47:16 UTC
Hm, now ghc developed incompatibility within the same major number :(.

Andres: I think we do need to resort to that plan you had - to do a local bootstrapping off hte ghc-bin after all. Although it might be possible to do a check for the installed version, but that its a nightmare to track what builds with what and what fails... Anyway, that's up to you to decide ;).

Frederik:
meanwhile, if you want the update, you can 
1. create a binary backup of the installed ghc (use quickpkg, its either part of portage or gentoolkit)
2. emerge ghc-bin  and then
3 emerg ghc

This should make you rolling..

George
Comment 2 Andres Loeh (RETIRED) gentoo-dev 2004-02-02 14:35:01 UTC
This needs to be checked in more detail. I myself have succesfully built ghc-6.2
from ghc-6.0.1, if I remember at all correctly, so this should not be a general
problem. I would like to run some tests myself, but I am "absent" for the next two
weeks, and will only have access to a suitably powerful machine after that.

In the meantime, I'd appreciate any additional experiences you could provide.
For instance, does building with the ghc-6.2 binary version, as George suggested,
really work for you?

George: actually, my plan *was* to check for the version installed, and the GHC people
usually try to support building a GHC with an older GHC for quite some time backward.
On the other hand, I've discovered that since 6.0 bootstrapping from .hc files is supported again, too; there just aren't any prebuilt .hc files to download, so I have to
find out how to build them myself. I will investigate that, too, once I am back.
Comment 3 Andres Loeh (RETIRED) gentoo-dev 2004-02-03 06:20:10 UTC
I tried to remotely build ghc-6.2 with ghc-6.0.1 again, and it succeeded.

My guess is that this is a problem not caused by ghc-6.0.1, but by gcc-3.3 ...
I'll try to find more information.

ks
Comment 4 Fredrik Andersson 2004-02-07 07:45:59 UTC
I did an emerge of ghc-bin 6.2 and try to build ghc 6.2. Got the same error...
Comment 5 Sam Yates 2004-02-15 17:23:47 UTC
I'm getting the same error on link, but it seems that the problem is that the archive is not being built correctly.

The reason is that the make file is trying to do:
/usr/bin/ar q    libHSreadline.a -input libHSreadline.a.list

And we get:
/usr/bin/ar: creating libHSreadline.a
/usr/bin/ar: '-input': No such file

This seems to be because configure believes ar can accept the -input option, which in truth it can not.

This in turn is because of the lines in the configure script:
if $ArCmd conftest.a -input /dev/null >/dev/null 2>/dev/null; then
    ArSupportsInput='-input'
else
    ArSupportsInput=''
fi

ar, when it sees a file in the argument list that doesn't exist, merely reports the fact on stderr, but does not actually fail. The exit value is 0.

I'm going to try forcing ArSupportsInput to '' in the configure script and rebuild, but ghc does take a while!
Comment 6 Sam Yates 2004-02-16 00:15:06 UTC
Update:

Replaced the offending lines in the configure script, and now ghc 6.2 builds fine. I'm convinced it was the culprit.

The patch for the configure script is trivial, but I'll pop it in as an attachment. There's probably a better way to do it.
Comment 7 Sam Yates 2004-02-16 00:29:17 UTC
Created attachment 25704 [details, diff]
patch to configure script to work around ArSupportsInput issue
Comment 8 Andres Loeh (RETIRED) gentoo-dev 2004-02-19 01:19:08 UTC
Thank you very much for the analysis. I would really like to find out why
I cannot reproduce this, though. Do you use a strange version of "ar", somehow?

On my machine, the test in the configure script fails as intended, and a simple
shell command such as

if ar q whatever.a -input /dev/null; then echo yes; else echo no; fi

shows

ar: -input: No such file or directory
no

You seem to indicate that on your machine it would show "yes". Do I understand
you correctly?

ks
Comment 9 Sam Yates 2004-02-19 20:16:17 UTC
The version of ar on this machine does indeed behave differently. Weird!
Running the same example ...

phaenna% if ar q whatever.a -input /dev/null; then echo yes; else echo no; fi
ar: creating whatever.a
ar: '-input': No such file
ar: Warning: '/dev/null' is not an ordinary file
yes
phaenna% ar --version
GNU ar 2.14.90.0.8 20040114
Copyright 2003 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
Comment 10 Andres Loeh (RETIRED) gentoo-dev 2004-02-20 05:22:27 UTC
Ah, okay. I can reproduce that now, after upgrading to
binutils-2.14.90.0.8-r1 (I previously had the stable version).

I would almost say that this is buggy behaviour from "ar", but
as I don't know enough about binutils, and manually forcing
ArSupportsInput to be empty seems safe, I have fixed it in CVS.

I have not used your patch, but added the variable setting to
mk/build.mk, which should override configure's detected setting.
This way, it seems to be more likely that it will work with other
ghc versions.

It still compiles on my machine, now using the new binutils, so I
hope it is okay.

Thank you very much for your help. I'm closing the bug.