Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 145466 - dev-lang/ghc-6.4.2 won't compile using gcc-4.1.1 on PPC64
Summary: dev-lang/ghc-6.4.2 won't compile using gcc-4.1.1 on PPC64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
: 170595 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-29 05:11 UTC by Markus Rothe (RETIRED)
Modified: 2008-10-09 07:59 UTC (History)
2 users (show)

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


Attachments
ghc-6.4.2-output.txt (ghc-6.4.2-output.txt,37.68 KB, text/plain)
2006-08-29 05:12 UTC, Markus Rothe (RETIRED)
Details
helloworld-gcc-3.4.s (helloworld-gcc-3.4.s,8.98 KB, text/plain)
2006-10-17 03:04 UTC, Markus Rothe (RETIRED)
Details
helloworld-gcc-4.1.s (helloworld-gcc-4.1.s,9.63 KB, text/plain)
2006-10-17 03:05 UTC, Markus Rothe (RETIRED)
Details
diff-3.4_4.1.diff (diff-3.4_4.1.diff,16.35 KB, text/plain)
2006-10-17 03:05 UTC, Markus Rothe (RETIRED)
Details
helloworld-gcc-4.1.s (helloworld-gcc-4.1.s,10.48 KB, text/plain)
2006-10-18 09:05 UTC, Markus Rothe (RETIRED)
Details
out_from_ghc-asm_4.1.s (out_from_ghc-asm_4.1.s,10.94 KB, text/plain)
2006-10-18 09:06 UTC, Markus Rothe (RETIRED)
Details
Fix regression to old PPC64 tarball (ghc-6.4.2.diff,617 bytes, patch)
2008-10-09 07:59 UTC, Andrew John Hughes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Rothe (RETIRED) gentoo-dev 2006-08-29 05:11:46 UTC
Hello,

I just tried to compile ghc-6.4.2 using gcc-4.1.1, but it failed. it does compile if I use gcc-3.4.6-r2 (current stable one).

please see (not so short) error log I'll attach to this bug.


# emerge --info
Portage 2.1-r2 (default-linux/ppc/ppc64/2006.1/64bit-userland/power5, gcc-4.1.1, glibc-2.4-r3, 2.6.16.9 ppc64)
=================================================================
System uname: 2.6.16.9 ppc64 POWER5 (gr)
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.17
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.16
ACCEPT_KEYWORDS="ppc64"
AUTOCLEAN="yes"
CBUILD="powerpc64-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mtune=power5 -mcpu=power5"
CHOST="powerpc64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /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/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -mtune=power5 -mcpu=power5"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="ppc64 X alsa altivec apache2 apm arts berkdb bitmap-fonts cli cups dlloader dri eds emboss encode esd foomaticdb fortran gcj gdbm gif gnome gpm gstreamer gtk ibm imlib ipv6 isdnlog jpeg kde libg++ libwww mad mikmod motif mp3 mpeg ncurses nls nptl nptlonly objc ogg opengl oss pam pcre pdflib perl png pppd python qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts udev unicode vorbis xml xmms xorg xv zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_evdev kernel_linux userland_GNU video_cards_ati video_cards_dummy video_cards_fbdev video_cards_mga video_cards_nv video_cards_sisusb video_cards_v4l"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Markus Rothe (RETIRED) gentoo-dev 2006-08-29 05:12:19 UTC
Created attachment 95362 [details]
ghc-6.4.2-output.txt
Comment 2 Duncan Coutts (RETIRED) gentoo-dev 2006-10-03 16:52:48 UTC
Sigh. The mangler needs updating for gcc-4.1.1. 
Comment 3 Duncan Coutts (RETIRED) gentoo-dev 2006-10-16 17:57:48 UTC
We have two options. One is to do an unregisterised build. This gives us about a 50% speed hit, but it should work. The other is to fix the mangler. For the latter we'll need someone who knows ppc64 assembly and perl. Any volunteers?
Comment 4 Markus Rothe (RETIRED) gentoo-dev 2006-10-16 22:14:16 UTC
mhh.. let's do an unregisterised build and report this issue upstream, as tgall is the only one from ppc64 team who knows ppc64 assembler, but dunno about his perl knowledge.

Please let me know if I should report this upstream or you, as you might have better connections upstream ;-)
Comment 5 Duncan Coutts (RETIRED) gentoo-dev 2006-10-17 02:10:05 UTC
Aye, we'll take care of that then.
Comment 6 Duncan Coutts (RETIRED) gentoo-dev 2006-10-17 02:20:00 UTC
Could I ask someone to try this and tell me if it works with gcc-4.1.1?

http://haskell.org/~gentoo/gentoo-haskell/dev-lang/ghc/ghc-6.4.2.ebuild

I've made it turn off the regesterised build. If it does, I'll commit.

Note also that ghc-6.6 is out, though I don't have high hopes that it'll fare any better:

http://haskell.org/~gentoo/gentoo-haskell/dev-lang/ghc/ghc-6.6.ebuild
Comment 7 Markus Rothe (RETIRED) gentoo-dev 2006-10-17 03:04:50 UTC
Created attachment 99866 [details]
helloworld-gcc-3.4.s
Comment 8 Markus Rothe (RETIRED) gentoo-dev 2006-10-17 03:05:07 UTC
Created attachment 99867 [details]
helloworld-gcc-4.1.s
Comment 9 Markus Rothe (RETIRED) gentoo-dev 2006-10-17 03:05:24 UTC
Created attachment 99868 [details]
diff-3.4_4.1.diff
Comment 10 Markus Rothe (RETIRED) gentoo-dev 2006-10-17 03:08:02 UTC
you told me this on IRC:

<dcoutts> corsair, so by running: /opt/ghc/lib/ghc-asm helloworld-gcc-x.y.s out.s
<dcoutts> you get the .s file that will really get assembled
<dcoutts> so see if the mangler fails is one thing
<dcoutts> then assemble it with gcc and see if that complains
<dcoutts> and we can work back from there to find roughly what's wrong


and so I did (gcc 3.4 chroot):
(gcc34) power1 ~ # /opt/ghc/lib64/ghc-6.4.2/ghc-asm helloworld.s out_from_ghc-asm_3.4.s
(gcc34) power1 ~ # diff helloworld.s out_from_ghc-asm_3.4.s
(gcc34) power1 ~ #

and gcc-4.1 chroot:

(gcc41) power1 ~ # /opt/ghc/lib64/ghc-6.4.2/ghc-asm helloworld.s out_from_ghc-asm_4.1.s
Warning: retaining unknown function `.L.__stginit_ZCMain' in output from C compiler
Warning: retaining unknown function `.L.__stginit_Main' in output from C compiler
Warning: retaining unknown function `.L.__stginit_Main_' in output from C compiler
Warning: retaining unknown function `.L.ZCMain_main_entry' in output from C compiler
Warning: retaining unknown function `.L.Main_main_entry' in output from C compiler
Warning: retaining unknown function `.L.s1vE_entry' in output from C compiler
Warning: retaining unknown function `.L.r1vz_entry' in output from C compiler
Warning: retaining unknown function `.L.r1vx_entry' in output from C compiler
(gcc41) power1 ~ # diff helloworld.s out_from_ghc-asm_4.1.s
(gcc41) power1 ~ #


Unfortunatly ghc-asm does not rewrite the assembler code as you can see.


P.S.: that unregisterised build is still going on.
Comment 11 Markus Rothe (RETIRED) gentoo-dev 2006-10-17 03:22:50 UTC
the build failed almost the same way it did before:

[...]
Warning: retaining unknown function `.L.r8VW_entry' in output from C compiler
<<ghc: 1105260088 bytes, 3746 GCs, 20930641/38858040 avg/max bytes residency (10 samples), 104M in use, 0.00 INIT (0.00 elapsed), 5.62 MUT (25.77 elapsed), 4.47 GC (4.35 elapsed) :ghc>>
/var/tmp/portage/ghc-6.4.2/temp/ghc.sh -o ghc-pkg.bin -H16m -O -optc-mtune=power5 -opta-mtune=power5 -optc-mcpu=power5 -opta-mcpu=power5 -opta-Wa,--noexecstack -fno-warn-deprecations -cpp -Wall -fno-warn-name-shadowing -fno-warn-unused-matches -i../../lib/compat -ignore-package Cabal -Rghc-timing    -L../../lib/compat -lghccompat   Main.o Version.o
Main.o:(.text+0x0): undefined reference to `__DISCARD__'
Main.o:(.text+0x28): undefined reference to `__DISCARD__'
Main.o:(.text+0x50): undefined reference to `__DISCARD__'
Main.o:(.text+0x160): undefined reference to `__DISCARD__'
Main.o:(.text+0x18c): undefined reference to `__DISCARD__'
Main.o:(.text+0x1b8): more undefined references to `__DISCARD__' follow
collect2: ld returned 1 exit status
<<ghc: 20899560 bytes, 3 GCs, 129792/129792 avg/max bytes residency (1 samples), 15M in use, 0.00 INIT (0.00 elapsed), 0.04 MUT (1.45 elapsed), 0.01 GC (0.02 elapsed) :ghc>>
make[4]: *** [ghc-pkg.bin] Error 1
make[3]: *** [boot] Error 2
make[2]: *** [boot] Error 1
make[1]: *** [boot] Error 1
make[1]: Leaving directory `/var/tmp/portage/ghc-6.4.2/work/ghc-6.4.2/ghc'
make: *** [build] Error 1


I had to build haddock with gcc-3.4 (build failed with a similar message if compiled with gcc-4.1) and ghc-bin itself is also compiled with gcc-3.4. don't know what do do know...
Comment 12 Duncan Coutts (RETIRED) gentoo-dev 2006-10-17 12:19:43 UTC
(In reply to comment #11)
> the build failed almost the same way it did before:

That's because the host ghc is still borked because you're still using gcc-4.1.1.

ghc needs a version of ghc to build. So we need to do an unregisterised build while using gcc-3.x and then try that build with gcc-4.x.
Comment 13 Duncan Coutts (RETIRED) gentoo-dev 2006-10-17 17:50:11 UTC
Oh amd also, because I messed up the change to the ebuild in our overlay. Sorry about that, you'll have to grab it again: 

http://haskell.org/~gentoo/gentoo-haskell/dev-lang/ghc/ghc-6.4.2.ebuild
Comment 14 Markus Rothe (RETIRED) gentoo-dev 2006-10-18 09:04:23 UTC
yes, that ebuild worked. ghc now compiled.
Comment 15 Markus Rothe (RETIRED) gentoo-dev 2006-10-18 09:05:10 UTC
Created attachment 99946 [details]
helloworld-gcc-4.1.s

helloworld.hs now compiled with ghc build with gcc 4.1
Comment 16 Markus Rothe (RETIRED) gentoo-dev 2006-10-18 09:06:58 UTC
Created attachment 99947 [details]
out_from_ghc-asm_4.1.s

I got this with these commands:

(gcc41) power1 ~ # ghc -S helloworld.hs
(gcc41) power1 ~ # /usr/lib64/ghc-6.4.2/ghc-asm helloworld.s out_from_ghc-asm_4.1.s
Warning: retaining unknown function `.L.__stginit_Main_' in output from C compiler
Warning: retaining unknown function `.L.__stginit_Main' in output from C compiler
Warning: retaining unknown function `.L.__stginit_ZCMain' in output from C compiler
Warning: retaining unknown function `.L.ZCMain_main_entry' in output from C compiler
Warning: retaining unknown function `.L.Main_main_entry' in output from C compiler
Warning: retaining unknown function `.L.s1vE_entry' in output from C compiler
Warning: retaining unknown function `.L.r1vz_entry' in output from C compiler
Warning: retaining unknown function `.L.r1vx_entry' in output from C compiler
Comment 17 Markus Rothe (RETIRED) gentoo-dev 2006-12-01 13:00:30 UTC
gcc 4.1 is now stable on ppc64 and so ghc breaks. If I understand the situation we need to do the following:

- add the ebuild to the ebuild to the tree which builds an unregistered build on ppc64
- compile a new ghc-bin package (I don't recall which USE flags should be used..)
- add a new revision of ghc-bin especialy for ppc64 to the tree

comments?
Comment 18 Duncan Coutts (RETIRED) gentoo-dev 2006-12-01 14:48:34 UTC
(In reply to comment #17)
> comments?

Yes. That sounds right.
Comment 19 Markus Rothe (RETIRED) gentoo-dev 2006-12-04 11:20:01 UTC
which USE flags should I use for building the binary again?
Comment 20 Duncan Coutts (RETIRED) gentoo-dev 2006-12-05 03:23:22 UTC
(In reply to comment #19)
> which USE flags should I use for building the binary again?

Turn them all off.

There's a script projects/build-ghc-bin.sh in the Haskell overlay. But basically it just turns off all use flags and uses some ordinary CFLAGS etc.

http://haskell.org/~gentoo/gentoo-haskell/projects/build-ghc-bin.sh
Comment 21 Markus Rothe (RETIRED) gentoo-dev 2007-03-13 09:19:48 UTC
*** Bug 170595 has been marked as a duplicate of this bug. ***
Comment 22 Markus Rothe (RETIRED) gentoo-dev 2007-03-29 15:01:48 UTC
Fixed it. I've added ghc-bin-6.4.2-r1 which includes an unregisterised tarball and also made the ghc ebuilds build unregisterised builds on ppc64.
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2008-02-07 15:33:01 UTC
*** Bug 209260 has been marked as a duplicate of this bug. ***
Comment 24 Andrew John Hughes 2008-10-07 11:47:47 UTC
The ebuild has regressed to this state again with the move from ghc and ghc-bin to ghc with USE="binary".  The -r1 tarball is not being downloaded for ppc64.
Comment 25 Andrew John Hughes 2008-10-09 07:59:54 UTC
Created attachment 167702 [details, diff]
Fix regression to old PPC64 tarball