Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 6352
Alias:
Product:
Component:
Status: RESOLVED
Resolution: DUPLICATE of bug 10155
Assigned To: George Shapovalov <george@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Ole Tange <bugs.gentoo.org@tange.dk>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
ghc output from emerge ghc text/plain Ole Tange 2002-08-12 04:48 0000 89.84 KB Details
ghc output from emerge ghc (the fooX are mine) text/plain Ole Tange 2002-08-20 17:20 0000 89.98 KB Details
ghc emerge of ghc 5.02.3 application/octet-stream Ole Tange 2002-08-21 03:55 0000 23.49 KB Details
strace strace of genprimopcode text/plain Ole Tange 2002-08-21 07:54 0000 2.17 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 6352 depends on: 5318 Show dependency tree
Bug 6352 blocks: 12836
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2002-08-12 04:43 0000

    

------- Comment #1 From Ole Tange 2002-08-12 04:47:28 0000 -------
(OK, I probably never get used to Konquerors default of submitting a form when 
pressing enter in a textfield). 
 
emerge \=dev-lang/ghc-5.04 
 
fails. The output is attached. 
 

------- Comment #2 From Ole Tange 2002-08-12 04:48:13 0000 -------
Created an attachment (id=3011) [details]
output from emerge ghc

------- Comment #3 From Ole Tange 2002-08-14 10:00:24 0000 -------
I rsynced a new version. Same problem: 
/usr/sbin/ebuild.sh: $: command not found 
/usr/sbin/ebuild.sh: $: command not found 
/usr/sbin/ebuild.sh: $: command not found 
/usr/sbin/ebuild.sh: $: command not found 
configure: WARNING: If you wanted to set the --build type, don't use --host. 
    If a cross compiler is detected then cross compile mode will be used. 
configure: WARNING: If you wanted to set the --build type, don't use --host. 
    If a cross compiler is detected then cross compile mode will be used. 
configure.in:1088: warning: AC_TRY_RUN called without default to allow cross 
compiling 
fptools configure script wizard sez: autoconf-2.50 or later should produce no 
warnings 
if you are using 2.13 or earlier you may get a (harmless) warning message. 
configure: warning: CFLAGS=-mcpu=i686 -O2 -pipe: invalid host type 
configure: warning: host_alias=i686-pc-linux-gnu: invalid host type 
configure: error: can only configure for one host and one target at a time 
make[1]: *** [configure] Error 1 
make: *** [configure] Error 2 
 
!!! ERROR: The ebuild did not complete successfully. 
!!! Function build_stage2, Line 11, Exitcode 2 
!!! (no error message) 
 
 

------- Comment #4 From George Shapovalov 2002-08-16 20:56:17 0000 -------
Hi Ole

Thanks for the bug report.

Could you please provide some more information:
your gcc version
C[XX]FLAGS you are using
your CHOST setting (as specified in make.conf or command line)
are you building for the same architecture?
Anything else that might seem relevant.

George

------- Comment #5 From Ole Tange 2002-08-20 17:00:40 0000 -------
rsynced to new version. Same problem. 
 
# gcc --version 
2.95.3 
# grep FLAGS /etc/make.conf 
CFLAGS="-mcpu=i686 -O2 -pipe" 
CXXFLAGS="-mcpu=i686 -O2 -pipe" 
 
I have found 1 bug: in the ebuild you have a comment starting with $ not # 

------- Comment #6 From Ole Tange 2002-08-20 17:09:38 0000 -------
wow! fixing the $ made thing get a lot better. 
 
Now I get: 
 
/usr/bin/ghc -o ghc-pkg.bin -ldl -cpp -DPKG_TOOL -DWANT_PRETTY -package lang 
-package util -package text -O       Main.o Package.o ParsePkgConfLite.o 
/usr/i686-pc-linux-gnu/bin/ld: cannot find -lgmp 
collect2: ld returned 1 exit status 
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 
`/hda6/var/tmp/portage/ghc-5.04/work/stage2-build/ghc' 
make: *** [all] Error 1 
 
!!! ERROR: The ebuild did not complete successfully. 
!!! Function build_stage2, Line 11, Exitcode 2 
!!! (no error message) 
 
!!! emerge aborting on  /usr/portage/dev-lang/ghc/ghc-5.04.ebuild . 
 
If GHC depends on GMP it should say so. 
 
I added: 
 
  >=dev-libs/gmp-1.0.0 
 
and it gets a lot further now. 
 
 
 
 
 

------- Comment #7 From Ole Tange 2002-08-20 17:20:12 0000 -------
Created an attachment (id=3244) [details]
output from emerge ghc (the fooX are mine)

------- Comment #8 From George Shapovalov 2002-08-20 23:01:35 0000 -------
Hi Ole.

Thanks for more testing and reports!
I think gmp dependency was indeed overlooked. As for the $ instead of # I am
quite lost - the ebuild was tested more than once (by me and its author) and
built just fine. Admittedly this is not a crytical bug and may have been just
lost in the output. I did both these corrections to the ebuild.

As for the problem you experience while building the package: do you have some
version of ghc already installed? Or do you by chance define or have GHC
variable defined?
Looks like your build does not start at stage1 but rather tries to go to stage2
immediately. If you have ghc installed than it probably does not behave the way
new source expects it. If you do not have ghc installed such behavior is most
likely caused by GHC variable defined somewhere in your login scripts (in this
case you may force the correct build by unexporting the GHC var).
Please let me know which of these situations do you have (and if you do have ghc
installed, what is the active version and how it was built).

Thanks!

George

------- Comment #9 From Ole Tange 2002-08-21 02:26:24 0000 -------
I have ghc installed. The version is app. 1 month older than this bugreport. I 
do not remember how it was compiled. Chances are though that is was compiled 
with the same settings. 
 
Do you want me to de-install ghc to see if it helps? 

------- Comment #10 From George Shapovalov 2002-08-21 03:36:37 0000 -------
Hi Ole.

>I have ghc installed. The version is app. 1 month older than this bugreport.
Does this mean that you have ghc-5.02.3 installed via "emerge ghc" when previous
version was the latest one? Or did you install ghc yourself prior to trying it
through gentoo? Related to this: did you try to use previous ebuild (5.02.3) and
 if yes, did you have any problems with it?
Also do you have GHC variable defined anywhere (as misset GHC var can cause some
problems with the ebuild)?

>Do you want me to de-install ghc to see if it helps? 
  Sorry, I forgot to mention this. Yes, you can deinstall your present version
and then emerge ghc from scratch. This should build and give you working ghc
thus relieving your problem (but if it doesn't please let me know). However this
does not resolve the issue with ebuild, as apparently it fails under certain
conditions :( (namely preinstalled ghc of some older version). I think I will
have to ask ebuild author to help me here, as I am just overlooking various dev
categories and not really a ghc guru :/.
  Temporary solution may be to force full build (all three stages) independently
of existing ghc on the system. Though it would be nice to make ebuild use
preinstalled ghc as it can save quite some time during the build.


Sven:
Sorry for bothering you again. It seems that the ebuild of ghc-5.04 that you
submitted and I processed (bug #5318) has some problems if ghc is already
installed on the system. Could you please take a look at this bug?


George

------- Comment #11 From Ole Tange 2002-08-21 03:54:36 0000 -------
# epm -q ghc
ghc-5.02.3

I have never tried installing it manually (without emerge). I had no problems with 
previous versions. I have not manually set GHC-variable and it seems not to be set.

I have tried re-installing ghc-5.02.3. It did not work. See attached.

------- Comment #12 From Ole Tange 2002-08-21 03:55:28 0000 -------
Created an attachment (id=3251) [details]
emerge of ghc 5.02.3

------- Comment #13 From Sven Moritz Hallberg 2002-08-21 07:00:22 0000 -------
George, you have overlooked to change the patch files' extensions to .bz2 after
changing to bzcat in ghc-5.02.3.ebuild. Please fix. That must be the cause of
your last build failure (the patch adds support for the --without-happy
configure option).

As for the failure of the GHC 5.04 build before, I'm not yet quite sure what's
causing it. The error message says that the genprimopcode program (it's written
in Haskell and built along with the compiler) returned error code 139. This is
strange, because the program code doesn't say anything about exit codes at all.
Also the output doesn't contain any textual error indication from genprimopcode.
So it looks to me as if the program actually ran successfully but the compiler
which was used to build it did something wrong that makes genprimopcode return
this strange exit code. My GHC 5.02.3, however, compiles main=return() to a
program which indeed returns ExitSuccess.

Ole, can you please try to run the genprimopcode command manually and check its
exit status? The genprimopcode program should be in
/var/tmp/portage/ghc-5.04/work/stage2-build/ghc/utils/genprimopcode. From there try

$ ./genprimopcode --data-decl < ../../compiler/prelude/primops.txt > /dev/null
$ echo $?

If the last command prints 139, we've isolated the source of the bug.

(It should be in /var/tmp/portage/ghc-5.04/work/ghc-5.

------- Comment #14 From Ole Tange 2002-08-21 07:48:41 0000 -------
Hmm... sorry: 
 
# cd /var/tmp/portage/ghc-5.04/work/stage2-build/ghc/utils/genprimopcodemedi 
genprimopcode # 
medi genprimopcode # ./genprimopcode --data-decl < 
../../compiler/prelude/primops.txt > /dev/null 
medi genprimopcode # echo $? 
0 
medi genprimopcode # 
 

------- Comment #15 From Ole Tange 2002-08-21 07:54:07 0000 -------
I have found "something":  
  
medi compiler # pwd  
/hda6/var/tmp/portage/ghc-5.04/work/stage3-build/ghc/compiler  
  
medi compiler # ../utils/genprimopcode/genprimopcode --data-decl          <  
prelude/primops.txt > primop-data-decl.hs-incl  
Segmentation fault  
  
# echo $?  
139 
 
an strace of genprimopcode is attached.  
  

------- Comment #16 From Ole Tange 2002-08-21 07:54:36 0000 -------
Created an attachment (id=3253) [details]
strace of genprimopcode

------- Comment #17 From Ole Tange 2002-08-21 08:05:21 0000 -------
hmmm.... it seems stage2 is OK. But stage3 is bad. 
 
Right now I am thinking: Is sandbox the problem?  
I don't remember how to disable sandbox, and 'man emerge' is not helpful on 
that either. 

------- Comment #18 From Sven Moritz Hallberg 2002-08-21 08:59:26 0000 -------
Oh, sorry I overlooked your build was already at stage 3. I have no idea now
what's causing the strange segfault. I still have the complete build dirs of my
last build of GHC 5.04 around in /var/tmp/portage, and genprimopcode works in
all of them.

I've sent a message to glasgow-haskell-users@haskell.org asking for assistance
in this issue.

------- Comment #19 From Sven Moritz Hallberg 2002-08-23 10:41:59 0000 -------
Quoting Simon Marlow <simonmar@microsoft.com>'s reply to my message:

---
I'm afraid nothing springs to mind - but I do recall that genprimopcode
is perhaps the first Haskell binary to be executed in a bootstrapped
tree, so it could be just that the stage 2 compiler is building
consistently broken binaries.  That should be easy to verify.

The next stage is to try to debug it.  Compile up the runtime system (in
the compiler tree that is generating broken code) with the debugging
options (see mk/config.mk for details).  Compile up something that
crashes, investigate with gdb, and we'll take it from there.

Cheers,
        Simon
---

I hope this helps.

------- Comment #20 From Ole Tange 2002-08-24 04:16:14 0000 -------
If I am not to waste an enormous lot of time doing the wrong things I will need 
a more explicit guide on what to do. 

A couple of shell commands would be nice. 

------- Comment #21 From Andres Loeh (RETIRED) 2002-12-06 06:52:02 0000 -------
I have a general (maybe stupid) question about the GHC ebuild: Wouldn't it be 
better to take a binary version of GHC (AFAIK available for both Intel and 
SPARC) to rebuild the source distribution once with personal settings? No 
building from HC-files would be necessary, and it might be less sensitive to 
differences in gcc-versions ... 

------- Comment #22 From Ole Tange 2002-12-06 06:59:41 0000 -------
I would very much like to see Gentoo work on all possible platforms with as 
small changes as possible. The only way I can see this done is by compiling as 
much as possible from source. By using the .hc-files I am sure it will be much 
easier to port GHC to, say, ARM. 
 
 

------- Comment #23 From George Shapovalov 2003-02-09 02:00:04 0000 -------

*** This bug has been marked as a duplicate of 10155 ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug