<div dir="ltr">Hi,<div><br></div><div>I have an app which includes omp.h from gomp, it used to find it without adding any -I for that (with just -fopenmp to enable openmp).</div><div><br></div><div>Now the header file is included in RSS:</div><div>lib32-recipe-sysroot/usr/lib/arm-oemllib32-linux-gnueabi/9.2.0/include/omp.h<br></div><div>but no longer found in default search dirs.</div><div><br></div><div>Is this expected or should gcc be adjusted to search for it automatically?</div><div><br></div><div>Looking at the default search paths I see:</div><div><br></div><div>ignoring nonexistent directory "BUILD/work/machine-oemllib32-linux-gnueabi/lib32-component/2.0.0-76-r7/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/../../lib/arm-oemllib32-linux-gnueabi/gcc/arm-oemllib32-linux-gnueabi/9.2.0/../../../../../arm-oemllib32-linux-gnueabi/include"<br>ignoring nonexistent directory "/not/exist/usr/include/c++/9.2.0"<br>ignoring nonexistent directory "/not/exist/usr/include/c++/9.2.0/arm-oemllib32-linux-gnueabi"<br>ignoring nonexistent directory "/not/exist/usr/include/c++/9.2.0/backward"<br>ignoring duplicate directory "BUILD/work/machine-oemllib32-linux-gnueabi/lib32-component/2.0.0-76-r7/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/../../lib/arm-oemllib32-linux-gnueabi/gcc/../../../lib/arm-oemllib32-linux-gnueabi/gcc/arm-oemllib32-linux-gnueabi/9.2.0/include"<br>ignoring nonexistent directory "/not/exist/usr/lib/gcc/arm-oemllib32-linux-gnueabi/9.2.0/include"<br>ignoring nonexistent directory "/not/exist/usr/local/include"<br>ignoring duplicate directory "BUILD/work/machine-oemllib32-linux-gnueabi/lib32-component/2.0.0-76-r7/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/../../lib/arm-oemllib32-linux-gnueabi/gcc/../../../lib/arm-oemllib32-linux-gnueabi/gcc/arm-oemllib32-linux-gnueabi/9.2.0/include-fixed"<br>ignoring nonexistent directory "BUILD/work/machine-oemllib32-linux-gnueabi/lib32-component/2.0.0-76-r7/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/../../lib/arm-oemllib32-linux-gnueabi/gcc/../../../lib/arm-oemllib32-linux-gnueabi/gcc/arm-oemllib32-linux-gnueabi/9.2.0/../../../../../arm-oemllib32-linux-gnueabi/include"<br>ignoring nonexistent directory "/not/exist/usr/include"<br>#include "..." search starts here:<br>#include <...> search starts here:<br> BUILD/work/machine-oemllib32-linux-gnueabi/lib32-component/2.0.0-76-r7/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/../../lib/arm-oemllib32-linux-gnueabi/gcc/arm-oemllib32-linux-gnueabi/9.2.0/include<br> BUILD/work/machine-oemllib32-linux-gnueabi/lib32-component/2.0.0-76-r7/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/../../lib/arm-oemllib32-linux-gnueabi/gcc/arm-oemllib32-linux-gnueabi/9.2.0/include-fixed<br>End of search list.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 13, 2019 at 5:29 PM Khem Raj <<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">OE does not use the traditional /usr/lib/gcc prefix to store gcc-runtime<br>
it basically is moved into libdir, however some newer files were<br>
installed by newer versions of gcc especially libgomp ( omp.h openacc.h )<br>
into gcclibdir, so we have content in both directories, this confuses<br>
other tools which are trying to guess the gcc installation and its<br>
runtime location, since now we have two directories, the tools either<br>
choose one or other and we get inconsistent behavior, e.g. clang for<br>
aarch64 uses /usr/lib but same clang for riscv64 chose /usr/lib/gcc<br>
<br>
This change ensures that OE ends up with single valid location for gcc<br>
runtime files<br>
<br>
Move more common bits into common inc file<br>
<br>
Signed-off-by: Khem Raj <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><br>
---<br>
v2: Divert packaging to use new path in whole recipe<br>
<br>
meta/recipes-devtools/gcc/gcc-runtime.inc | 18 +++++++++++++++---<br>
meta/recipes-devtools/gcc/<a href="http://gcc-runtime_8.3.bb" rel="noreferrer" target="_blank">gcc-runtime_8.3.bb</a> | 10 ----------<br>
meta/recipes-devtools/gcc/<a href="http://gcc-runtime_9.1.bb" rel="noreferrer" target="_blank">gcc-runtime_9.1.bb</a> | 10 ----------<br>
3 files changed, 15 insertions(+), 23 deletions(-)<br>
<br>
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
index a5c2600d7f..22c1d78dd1 100644<br>
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc<br>
@@ -17,6 +17,12 @@ EXTRA_OECONF_PATHS = "\<br>
EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"<br>
EXTRA_OECONF_append = " --cache-file=${B}/config.cache"<br>
<br>
+# Disable ifuncs for libatomic on arm conflicts -march/-mcpu<br>
+EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "<br>
+<br>
+# Building with thumb enabled on armv6t fails<br>
+ARM_INSTRUCTION_SET_armv6 = "arm"<br>
+<br>
RUNTIMELIBITM = "libitm"<br>
RUNTIMELIBITM_arc = ""<br>
RUNTIMELIBITM_mipsarch = ""<br>
@@ -77,6 +83,11 @@ do_install () {<br>
cd ${B}/${TARGET_SYS}/$d/<br>
oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install<br>
done<br>
+ if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then<br>
+ install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include <br>
+ mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include<br>
+ rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include<br>
+ fi<br>
rm -rf ${D}${infodir}/<a href="http://libgomp.info" rel="noreferrer" target="_blank">libgomp.info</a> ${D}${infodir}/dir<br>
rm -rf ${D}${infodir}/<a href="http://libitm.info" rel="noreferrer" target="_blank">libitm.info</a> ${D}${infodir}/dir<br>
rm -rf ${D}${infodir}/<a href="http://libquadmath.info" rel="noreferrer" target="_blank">libquadmath.info</a> ${D}${infodir}/dir<br>
@@ -205,7 +216,7 @@ FILES_libssp-dev = "\<br>
${libdir}/libssp*.so \<br>
${libdir}/libssp*_nonshared.a \<br>
${libdir}/libssp*.la \<br>
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \<br>
+ ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \<br>
"<br>
SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"<br>
FILES_libssp-staticdev = "${libdir}/libssp*.a"<br>
@@ -214,7 +225,7 @@ SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static devel<br>
FILES_libquadmath = "${libdir}/libquadmath*.so.*"<br>
SUMMARY_libquadmath = "GNU quad-precision math library"<br>
FILES_libquadmath-dev = "\<br>
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \<br>
+ ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \<br>
${libdir}/libquadmath*.so \<br>
${libdir}/<a href="http://libquadmath.la" rel="noreferrer" target="_blank">libquadmath.la</a> \<br>
"<br>
@@ -239,7 +250,8 @@ FILES_libgomp-dev = "\<br>
${libdir}/libgomp*${SOLIBSDEV} \<br>
${libdir}/libgomp*.la \<br>
${libdir}/libgomp.spec \<br>
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \<br>
+ ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \<br>
+ ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \<br>
"<br>
SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"<br>
FILES_libgomp-staticdev = "${libdir}/libgomp*.a"<br>
diff --git a/meta/recipes-devtools/gcc/<a href="http://gcc-runtime_8.3.bb" rel="noreferrer" target="_blank">gcc-runtime_8.3.bb</a> b/meta/recipes-devtools/gcc/<a href="http://gcc-runtime_8.3.bb" rel="noreferrer" target="_blank">gcc-runtime_8.3.bb</a><br>
index a1c7a76d0b..dd430b57eb 100644<br>
--- a/meta/recipes-devtools/gcc/<a href="http://gcc-runtime_8.3.bb" rel="noreferrer" target="_blank">gcc-runtime_8.3.bb</a><br>
+++ b/meta/recipes-devtools/gcc/<a href="http://gcc-runtime_8.3.bb" rel="noreferrer" target="_blank">gcc-runtime_8.3.bb</a><br>
@@ -1,12 +1,2 @@<br>
require recipes-devtools/gcc/gcc-${PV}.inc<br>
require gcc-runtime.inc<br>
-<br>
-# Disable ifuncs for libatomic on arm conflicts -march/-mcpu<br>
-EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "<br>
-<br>
-FILES_libgomp-dev += "\<br>
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \<br>
-"<br>
-<br>
-# Building with thumb enabled on armv6t fails<br>
-ARM_INSTRUCTION_SET_armv6 = "arm"<br>
diff --git a/meta/recipes-devtools/gcc/<a href="http://gcc-runtime_9.1.bb" rel="noreferrer" target="_blank">gcc-runtime_9.1.bb</a> b/meta/recipes-devtools/gcc/<a href="http://gcc-runtime_9.1.bb" rel="noreferrer" target="_blank">gcc-runtime_9.1.bb</a><br>
index a1c7a76d0b..dd430b57eb 100644<br>
--- a/meta/recipes-devtools/gcc/<a href="http://gcc-runtime_9.1.bb" rel="noreferrer" target="_blank">gcc-runtime_9.1.bb</a><br>
+++ b/meta/recipes-devtools/gcc/<a href="http://gcc-runtime_9.1.bb" rel="noreferrer" target="_blank">gcc-runtime_9.1.bb</a><br>
@@ -1,12 +1,2 @@<br>
require recipes-devtools/gcc/gcc-${PV}.inc<br>
require gcc-runtime.inc<br>
-<br>
-# Disable ifuncs for libatomic on arm conflicts -march/-mcpu<br>
-EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "<br>
-<br>
-FILES_libgomp-dev += "\<br>
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \<br>
-"<br>
-<br>
-# Building with thumb enabled on armv6t fails<br>
-ARM_INSTRUCTION_SET_armv6 = "arm"<br>
-- <br>
2.22.0<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>