]> code.ossystems Code Review - openembedded-core.git/commitdiff
glibc-testing: Specify location of c++ header files
authorJuro Bystricky <juro.bystricky@intel.com>
Thu, 26 Mar 2015 15:14:31 +0000 (08:14 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 29 Mar 2015 22:07:17 +0000 (23:07 +0100)
Glibc test suite contains several c++ files. They are built
with g++ -nostdinc. In this case the location of c++ include files
needs to be specified explicitly, or the programs may fail to build.

The header locations are assumed to be:
    sysroot/usr/include/c++/<version>
    sysroot/usr/include/c++/<version>/<machine>

The new code parses "configparms" to get the actual CXX and sysroot
used for the glibc test suite, then it queries CXX to determine
CXX <version> and CXX <machine>. With the known values for <version>
and <machine> the code composes a new value for c++-sysincludes
and appends "configparms" with that value.

[YOCTO #7081]

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/glibc/glibc-testing.inc

index ec16fe1fde01b473ccc7f2690918bfbdfc39a7a5..fd1af3992277cd3e0452bd61efddb63e41b5d8c8 100644 (file)
@@ -65,9 +65,26 @@ then
 fi
        echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms
        echo "# definitions that come from ${B}/config.make" >> ${B}/configparms
-
        fgrep tcbootstrap ${B}/config.make > ${B}/configparms
        sed -i -e "s/\-tcbootstrap//g" ${B}/configparms
+
+# g++ uses flag -nostdinc, so the locations of system include headers must be explicitly specified
+# If the locations are not already specified in config.make, then we provide the following locations:
+#    <sysroot>/usr/include/c++/<g++ version>
+#    <sysroot>/usr/include/c++/<g++ version>/<machine>
+
+cxxincludes=\`cat ${B}/config.make | gawk '\$1 == "c++-sysincludes"' | gawk -F"=" '{print \$2}' | sed "s/[ \t]\?//g"\`
+
+if [ -z "\$cxxincludes" ]; then
+  sysroot=\`cat ${B}/configparms | sed -n "/CXX/p" | sed -e "s/^.*--sysroot=//"\`
+  cxx=\`cat ${B}/configparms | gawk '\$1 ~ /^CXX/' | gawk -F"=" '{print \$2}' | gawk '{print \$1}'\`
+  cxxmachine=\`\$cxx -dumpmachine\`
+  cxxversion=\`\$cxx -dumpversion\`
+  # pass the new value of c++-sysincludes via configparms
+  echo "# c++-sysincludes added:" >> ${B}/configparms
+  echo "c++-sysincludes = -isystem \$sysroot/usr/include/c++/\$cxxversion -isystem \$sysroot/usr/include/c++/\$cxxversion/\$cxxmachine" >> ${B}/configparms
+fi
+
 wrapper="${S}/scripts/cross-test-ssh.sh \$target"
 localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4"
 make tests-clean