<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>I filed a bug report <br><a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=7081" target="_blank">https://bugzilla.yoctoproject.org/show_bug.cgi?id=7081</a><br><br>I also proposed a fix. The fix is quite safe, it does not affect glibc build,<br>only modifies the testing script glibc-testing.inc. <br>Incidentally, I believe there is a tiny bug in glibc-testing.inc:<br><br>fgrep tcbootstrap ${B}/config.make > ${B}/configparms<br><br>should be <br><br>fgrep tcbootstrap ${B}/config.make >> ${B}/configparms<br><br>Otherwise the just entered comments in configparms get immediately wiped-out.<br><br>Juro<br><div><hr id="stopSpelling">Subject: Re: [OE-core] Problems running glibc test suite...<br>From: raj.khem@gmail.com<br>Date: Tue, 9 Dec 2014 09:39:55 -0800<br>CC: openembedded-core@lists.openembedded.org<br>To: jurobystricky@hotmail.com<br><br><br><div><blockquote><div>On Dec 9, 2014, at 9:08 AM, Juro Bystricky <<a href="mailto:jurobystricky@hotmail.com">jurobystricky@hotmail.com</a>> wrote:</div><br class="ecxApple-interchange-newline"><div><div dir="ltr" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div dir="ltr">I tried to run the glibc test suite and encountered various problems.<br>I build glibc as a part of core-image-minimal with libgcc and libstdc++,<span class="ecxApple-converted-space"> </span><br>both additional libraries are needed by the glibc test suite.<br><br>By far most tests run just fine, but there are several tests that fail<br>to build at all. The offenders are:<br><br>/elf/tst-unique3cc<br>/elf/tst-unique4cc<span class="ecxApple-converted-space"> </span><br>/elf/<a href="http://tst-unique3lib.cc/" target="_blank">tst-unique3lib.cc</a><span class="ecxApple-converted-space"> </span><br>/elf/<a href="http://tst-unique3lib2.cc/" target="_blank">tst-unique3lib2.cc</a>.<span class="ecxApple-converted-space"> </span><br><br>They all fail with an error:<br><br> fatal error: cstdio: No such file or directory<br> #include <cstdio><br><br>The obvious reason is that the c++ header files were not found by the g++.<br>g++ was invoked with -nostdinc flag, and in that case the path to system include<br>files must be specified explicitly.<br><br>The failed build is a consequence of a series of unfortunate events.<br><br>First, when building the glibc for the first time, configure cannot find g++<span class="ecxApple-converted-space"> </span><br>compiler at all. config.log states:<br><br>line 1594: arm-poky-linux-gnueabi-g++: command not found<br>configure:3165: $? = 127<br><br>Secondly, the g++ (which is not found) is then used to determine the location of the<br>include headers, resulting in<br>CXX_SYSINCLUDES=''<br><br>Thirdly, even if g++ is found (it is found when re-building glibc, see below),<br>the algorithm used to detect the CXX_SYSINCLUDES does not seem to work and<span class="ecxApple-converted-space"> </span><br>the headers are not detected. I "fixed" this by adding the following to git/configure:<br><br>@@ -5184,6 +5197,14 @@<br> test "x$cxxheaders" != x &&<br> CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"<br> done<br>+ if test -z "$CXX_SYSINCLUDES"; then<br>+ cxxversion=`$CXX -dumpversion`<span class="ecxApple-converted-space"> </span><br>+ cxxmachine=`$CXX -dumpmachine`<span class="ecxApple-converted-space"> </span><br>+ CXX_SYSINCLUDES=" -isystem $sysheaders/c++/$cxxversion \<br>+-isystem $sysheaders/c++/$cxxversion/$cxxmachine"<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: guessing CXX_SYSINCLUDES: $CXX_SYSINCLUDES" >&5<br>+$as_echo_n "guessing CXX_SYSINCLUDE: $CXX_SYSINCLUDES... " >&6; }<br>+ fi<br> fi<br> fi<br><br>After the core-image-minimal is built, by the time the test suite is run, g++ is present,<span class="ecxApple-converted-space"> </span><br>but CXX_SYSINCLUDES is still not correct (unless the "fix" above is applied). However,<span class="ecxApple-converted-space"> </span><br>not all c++ tests require c++ headers, so some will build correctly. I tested the "fix"<span class="ecxApple-converted-space"> </span><br>successfully with qemux86-64, qemumips and qemuarm.<span class="ecxApple-converted-space"> </span><br>(qemuarm exposed some additional problems though).<br><br>The "fix" is just a proof of concept: with correct CXX system header paths all<span class="ecxApple-converted-space"> </span><br>the offending programs build correctly. But this "fix" only works when re-building<span class="ecxApple-converted-space"> </span><br>glibc after the core-image-minimal is built.<br><br>The g++ compiler is not needed for glibc at all, it is only needed to build<span class="ecxApple-converted-space"> </span><br>some of the tests in the testsuite. <span class="ecxApple-converted-space"> </span><a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=7003%29" target="_blank"></a>Probably worth noting is that glibc cannot DEPEND on<span class="ecxApple-converted-space"> </span><br>g++ due to circular dependencies.<br></div></div></div></blockquote><div><br></div><div>thats right. glibc is built using a bootstapped cross compiler where we disable c++ support. This is to solve the catch-22 that glibc and gcc have. hence the reason why you miss most of c++ probes.</div><br><blockquote><div><div dir="ltr" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div dir="ltr"><br>The proper way to fix this would be to initialize CXX_SYSINCLUDES before building/running the test suite<span class="ecxApple-converted-space"> </span><br>and not before building the glibc.<br>A suitable place for this seems to be recipes-core/glibc/glibc-testing.inc<br></div></div></div></blockquote><div><br></div><div>yes. Running the test suites should be done after gcc-cross is built and staged. I would not prefer to doubly build glibc</div><div>thats just waste of build time. </div><br><blockquote><div><div dir="ltr" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div dir="ltr"><br>Any thoughts?<br><br>Thanks<br><br>Juro<br><br><br></div></div><span style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline !important;">--<span class="ecxApple-converted-space"> </span></span><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><span style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline !important;">_______________________________________________</span><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><span style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline !important;">Openembedded-core mailing list</span><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><a href="mailto:Openembedded-core@lists.openembedded.org" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">Openembedded-core@lists.openembedded.org</a><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a></div></blockquote></div><br></div>                                            </div></body>
</html>