<html>
<head>
</head>
<body class='hmmessage'><div dir='ltr'>

<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<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++, <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 <br>/elf/tst-unique3lib.cc <br>/elf/tst-unique3lib2.cc. <br><br>They all fail with an error:<br><br>&nbsp;fatal error: cstdio: No such file or directory<br>&nbsp;#include &lt;cstdio&gt;<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++ <br>compiler at all.&nbsp; 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 <br>the headers are not detected. I "fixed" this&nbsp; by adding the following to git/configure:<br><br>@@ -5184,6 +5197,14 @@<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test "x$cxxheaders" != x &amp;&amp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"<br>&nbsp;&nbsp;&nbsp;&nbsp; done<br>+&nbsp;&nbsp;&nbsp; if test -z "$CXX_SYSINCLUDES"; then<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cxxversion=`$CXX -dumpversion` <br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cxxmachine=`$CXX -dumpmachine` <br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXX_SYSINCLUDES=" -isystem $sysheaders/c++/$cxxversion \<br>+-isystem $sysheaders/c++/$cxxversion/$cxxmachine"<br>+&nbsp;&nbsp;&nbsp; { $as_echo "$as_me:${as_lineno-$LINENO}: guessing CXX_SYSINCLUDES: $CXX_SYSINCLUDES" &gt;&amp;5<br>+$as_echo_n "guessing CXX_SYSINCLUDE: $CXX_SYSINCLUDES... " &gt;&amp;6; }<br>+&nbsp;&nbsp;&nbsp; fi<br>&nbsp;&nbsp; fi<br>&nbsp;fi<br><br>After the core-image-minimal is built, by the time the test suite is run, g++ is present, <br>but CXX_SYSINCLUDES&nbsp; is still not correct (unless the "fix" above is applied). However, <br>not all c++ tests require c++ headers,&nbsp; so some will build correctly. I tested the "fix" <br>successfully with qemux86-64, qemumips and qemuarm. <br>(qemuarm exposed some additional problems though).<br><br>The "fix" is just a proof of concept: with correct CXX system header paths all <br>the offending programs build correctly. But this "fix" only works when re-building <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 <br>some of the tests in the testsuite.&nbsp; <a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=7003%29" target="_blank"></a>Probably worth noting is that glibc cannot DEPEND on <br>g++&nbsp; due to circular dependencies.<br><br>The proper way to fix this would be to initialize CXX_SYSINCLUDES before building/running the test suite <br>and not before building the glibc.<br>A suitable place for this seems to be recipes-core/glibc/glibc-testing.inc<br><br>Any thoughts?<br><br>Thanks<br><br>Juro<br><br><br></div>
                                               </div></body>
</html>