Bug 29404 - "make check" fails to compile library testcases
Summary: "make check" fails to compile library testcases
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: testsuite-fail
: 42308 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-09 16:53 UTC by Kaveh Ghazi
Modified: 2021-12-15 20:17 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-03-30 17:11:08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaveh Ghazi 2006-10-09 16:53:20 UTC
When I run "make check" on a three-stage bootstrapped tree, I get errors from libiberty's testsuite:

cc -DHAVE_CONFIG_H -g -I.. -I../../../egcc-SVN20061008/libiberty/testsuite/../../include  -DHAVE_CONFIG_H -I.. -o test-pexecute ../../../egcc-SVN20061008/libiberty/testsuite/test-pexecute.c ../libiberty.a
Undefined                       first referenced
 symbol                             in file
__umoddi3                           ../libiberty.a(mkstemps.o)
__udivdi3                           ../libiberty.a(mkstemps.o)
ld: fatal: Symbol referencing errors. No output written to test-pexecute
make[3]: *** [test-pexecute] Error 1


The problem appears to be that the libiberty library was three-staged using the new top-level bootstrap mechanism and therefore was compiled more recently by stage3 gcc, but the testcase driver is compiled and linked against this library with the stage1 compiler (cc).  Therefore symbols from libgcc (if any are needed) won't be resolved.  

We need to use the same compiler for the tests as was used to compile the library we're testing.  That changes depending on whether we use --disable-bootstrap or not.

This will become much more serious if we include other libraries in the GCC tree such as GMP/MPFR where testsuite results are more important.
Comment 1 Jack Howarth 2006-10-09 17:00:14 UTC
What platform are you compiling on?
Comment 2 Andrew Pinski 2006-10-09 17:22:27 UTC
--disable-bootstrap is not really supported and really has not been tested any more besides cross builds.
Comment 3 Kaveh Ghazi 2006-10-09 17:25:41 UTC
(In reply to comment #1)
> What platform are you compiling on?

sorry, it's on sparc-sun-solaris2.10, using vendor's cc for stage1.  You probably won't see this problem if stage1 cc is any version of gcc, whether vendor supplied or user-built, because it'll have it's own copy of compatible libgcc bits.
Comment 4 Kaveh Ghazi 2006-10-09 17:28:12 UTC
(In reply to comment #2)
> --disable-bootstrap is not really supported and really has not been tested any
> more besides cross builds.

Andrew please reread my initial report, I specifically talked about "three-stage bootstrap" and differences between stage1 and stage3 compiler.  This is *not* a --disable-bootstrap related bug.

Perhaps you're referring to my other submission today?
Comment 5 Paolo Bonzini 2007-01-09 16:08:42 UTC
I'll take a look.
Comment 6 Kaveh Ghazi 2007-02-01 04:23:12 UTC
(In reply to comment #5)
> I'll take a look.

Any ideas?
Comment 7 paolo.bonzini@lu.unisi.ch 2007-02-01 06:13:33 UTC
Subject: Re:  "make check" fails to compile library testcases

>> I'll take a look.
> 
> Any ideas?

Sure, I'm just a little busy.
Comment 8 Kaveh Ghazi 2008-02-02 05:19:13 UTC
(In reply to comment #7)
> Subject: Re:  "make check" fails to compile library testcases
> >> I'll take a look.
> > 
> > Any ideas?
> Sure, I'm just a little busy.

It's been a year... :-)
I still see this problem, reconfirming bug.
Comment 9 Kaveh Ghazi 2009-01-17 03:03:45 UTC
Reconfirming...

I can see on a linux-gnu box that it's compiling the libiberty testsuite with stage1 gcc.  That masks the error of missing libgcc bits used in stage3 libiberty, but still it should be using the stage3 xgcc to compile the testcases.  Ditto for mpfr/gmp if you build them in-tree.

gcc -DHAVE_CONFIG_H -g -O2 -I.. -I../../../egcc-SVN20090116/libiberty/testsuite/../../include  -DHAVE_CONFIG_H -I.. -o test-pexecute ../../../egcc-SVN20090116/libiberty/testsuite/test-pexecute.c ../libiberty.a
Comment 10 Kaveh Ghazi 2010-03-30 17:11:08 UTC
Still happens on 4.5 trunk.
Comment 11 Francois-Xavier Coudert 2014-11-15 12:39:40 UTC
*** Bug 42308 has been marked as a duplicate of this bug. ***
Comment 12 Francois-Xavier Coudert 2014-11-15 12:42:59 UTC
Still present on trunk (5.0, end of stage 1).