diff mbox series

[V2] gcc-runtime: Move content from gcclibdir into libdir

Message ID 20190813152835.12578-1-raj.khem@gmail.com
State Accepted
Commit e9e5744ba8b0d43c8b874d365f83071ce20bf0a1
Headers show
Series [V2] gcc-runtime: Move content from gcclibdir into libdir | expand

Commit Message

Khem Raj Aug. 13, 2019, 3:28 p.m. UTC
OE does not use the traditional /usr/lib/gcc prefix to store gcc-runtime
it basically is moved into libdir, however some newer files were
installed by newer versions of gcc especially libgomp ( omp.h openacc.h )
into gcclibdir, so we have content in both directories, this confuses
other tools which are trying to guess the gcc installation and its
runtime location, since now we have two directories, the tools either
choose one or other and we get inconsistent behavior, e.g. clang for
aarch64 uses /usr/lib but same clang for riscv64 chose /usr/lib/gcc

This change ensures that OE ends up with single valid location for gcc
runtime files

Move more common bits into common inc file

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
v2: Divert packaging to use new path in whole recipe

 meta/recipes-devtools/gcc/gcc-runtime.inc    | 18 +++++++++++++++---
 meta/recipes-devtools/gcc/gcc-runtime_8.3.bb | 10 ----------
 meta/recipes-devtools/gcc/gcc-runtime_9.1.bb | 10 ----------
 3 files changed, 15 insertions(+), 23 deletions(-)

-- 
2.22.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Martin Jansa Aug. 16, 2019, noon UTC | #1
Hi,

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).

Now the header file is included in RSS:
lib32-recipe-sysroot/usr/lib/arm-oemllib32-linux-gnueabi/9.2.0/include/omp.h
but no longer found in default search dirs.

Is this expected or should gcc be adjusted to search for it automatically?

Looking at the default search paths I see:

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"
ignoring nonexistent directory "/not/exist/usr/include/c++/9.2.0"
ignoring nonexistent directory
"/not/exist/usr/include/c++/9.2.0/arm-oemllib32-linux-gnueabi"
ignoring nonexistent directory "/not/exist/usr/include/c++/9.2.0/backward"
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"
ignoring nonexistent directory
"/not/exist/usr/lib/gcc/arm-oemllib32-linux-gnueabi/9.2.0/include"
ignoring nonexistent directory "/not/exist/usr/local/include"
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"
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"
ignoring nonexistent directory "/not/exist/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 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
 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
End of search list.

On Tue, Aug 13, 2019 at 5:29 PM Khem Raj <raj.khem@gmail.com> wrote:

> OE does not use the traditional /usr/lib/gcc prefix to store gcc-runtime

> it basically is moved into libdir, however some newer files were

> installed by newer versions of gcc especially libgomp ( omp.h openacc.h )

> into gcclibdir, so we have content in both directories, this confuses

> other tools which are trying to guess the gcc installation and its

> runtime location, since now we have two directories, the tools either

> choose one or other and we get inconsistent behavior, e.g. clang for

> aarch64 uses /usr/lib but same clang for riscv64 chose /usr/lib/gcc

>

> This change ensures that OE ends up with single valid location for gcc

> runtime files

>

> Move more common bits into common inc file

>

> Signed-off-by: Khem Raj <raj.khem@gmail.com>

> ---

> v2: Divert packaging to use new path in whole recipe

>

>  meta/recipes-devtools/gcc/gcc-runtime.inc    | 18 +++++++++++++++---

>  meta/recipes-devtools/gcc/gcc-runtime_8.3.bb | 10 ----------

>  meta/recipes-devtools/gcc/gcc-runtime_9.1.bb | 10 ----------

>  3 files changed, 15 insertions(+), 23 deletions(-)

>

> diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc

> b/meta/recipes-devtools/gcc/gcc-runtime.inc

> index a5c2600d7f..22c1d78dd1 100644

> --- a/meta/recipes-devtools/gcc/gcc-runtime.inc

> +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc

> @@ -17,6 +17,12 @@ EXTRA_OECONF_PATHS = "\

>  EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"

>  EXTRA_OECONF_append = " --cache-file=${B}/config.cache"

>

> +# Disable ifuncs for libatomic on arm conflicts -march/-mcpu

> +EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "

> +

> +# Building with thumb enabled on armv6t fails

> +ARM_INSTRUCTION_SET_armv6 = "arm"

> +

>  RUNTIMELIBITM = "libitm"

>  RUNTIMELIBITM_arc = ""

>  RUNTIMELIBITM_mipsarch = ""

> @@ -77,6 +83,11 @@ do_install () {

>                 cd ${B}/${TARGET_SYS}/$d/

>                 oe_runmake 'DESTDIR=${D}'

> MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install

>         done

> +       if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then

> +               install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include

> +               mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/*

> ${D}${libdir}/${TARGET_SYS}/${BINV}/include

> +               rmdir --ignore-fail-on-non-empty -p

> ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include

> +       fi

>         rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir

>         rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir

>         rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir

> @@ -205,7 +216,7 @@ FILES_libssp-dev = "\

>      ${libdir}/libssp*.so \

>      ${libdir}/libssp*_nonshared.a \

>      ${libdir}/libssp*.la \

> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \

> +    ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \

>  "

>  SUMMARY_libssp-dev = "GNU stack smashing protection library - development

> files"

>  FILES_libssp-staticdev = "${libdir}/libssp*.a"

> @@ -214,7 +225,7 @@ SUMMARY_libssp-staticdev = "GNU stack smashing

> protection library - static devel

>  FILES_libquadmath = "${libdir}/libquadmath*.so.*"

>  SUMMARY_libquadmath = "GNU quad-precision math library"

>  FILES_libquadmath-dev = "\

> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \

> +    ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \

>      ${libdir}/libquadmath*.so \

>      ${libdir}/libquadmath.la \

>  "

> @@ -239,7 +250,8 @@ FILES_libgomp-dev = "\

>      ${libdir}/libgomp*${SOLIBSDEV} \

>      ${libdir}/libgomp*.la \

>      ${libdir}/libgomp.spec \

> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \

> +    ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \

> +    ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \

>  "

>  SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library -

> development files"

>  FILES_libgomp-staticdev = "${libdir}/libgomp*.a"

> diff --git a/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb

> b/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb

> index a1c7a76d0b..dd430b57eb 100644

> --- a/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb

> +++ b/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb

> @@ -1,12 +1,2 @@

>  require recipes-devtools/gcc/gcc-${PV}.inc

>  require gcc-runtime.inc

> -

> -# Disable ifuncs for libatomic on arm conflicts -march/-mcpu

> -EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "

> -

> -FILES_libgomp-dev += "\

> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \

> -"

> -

> -# Building with thumb enabled on armv6t fails

> -ARM_INSTRUCTION_SET_armv6 = "arm"

> diff --git a/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb

> b/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb

> index a1c7a76d0b..dd430b57eb 100644

> --- a/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb

> +++ b/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb

> @@ -1,12 +1,2 @@

>  require recipes-devtools/gcc/gcc-${PV}.inc

>  require gcc-runtime.inc

> -

> -# Disable ifuncs for libatomic on arm conflicts -march/-mcpu

> -EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "

> -

> -FILES_libgomp-dev += "\

> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \

> -"

> -

> -# Building with thumb enabled on armv6t fails

> -ARM_INSTRUCTION_SET_armv6 = "arm"

> --

> 2.22.0

>

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

>
<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 &quot;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&quot;<br>ignoring nonexistent directory &quot;/not/exist/usr/include/c++/9.2.0&quot;<br>ignoring nonexistent directory &quot;/not/exist/usr/include/c++/9.2.0/arm-oemllib32-linux-gnueabi&quot;<br>ignoring nonexistent directory &quot;/not/exist/usr/include/c++/9.2.0/backward&quot;<br>ignoring duplicate directory &quot;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&quot;<br>ignoring nonexistent directory &quot;/not/exist/usr/lib/gcc/arm-oemllib32-linux-gnueabi/9.2.0/include&quot;<br>ignoring nonexistent directory &quot;/not/exist/usr/local/include&quot;<br>ignoring duplicate directory &quot;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&quot;<br>ignoring nonexistent directory &quot;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&quot;<br>ignoring nonexistent directory &quot;/not/exist/usr/include&quot;<br>#include &quot;...&quot; search starts here:<br>#include &lt;...&gt; 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 &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt; 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 &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt;<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 = &quot;\<br>
 EXTRA_OECONF_append_linuxstdbase = &quot; --enable-clocale=gnu&quot;<br>
 EXTRA_OECONF_append = &quot; --cache-file=${B}/config.cache&quot;<br>
<br>
+# Disable ifuncs for libatomic on arm conflicts -march/-mcpu<br>
+EXTRA_OECONF_append_arm = &quot; libat_cv_have_ifunc=no &quot;<br>
+<br>
+# Building with thumb enabled on armv6t fails<br>
+ARM_INSTRUCTION_SET_armv6 = &quot;arm&quot;<br>
+<br>
 RUNTIMELIBITM = &quot;libitm&quot;<br>
 RUNTIMELIBITM_arc = &quot;&quot;<br>
 RUNTIMELIBITM_mipsarch = &quot;&quot;<br>
@@ -77,6 +83,11 @@ do_install () {<br>
                cd ${B}/${TARGET_SYS}/$d/<br>
                oe_runmake &#39;DESTDIR=${D}&#39; 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 = &quot;\<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>
 &quot;<br>
 SUMMARY_libssp-dev = &quot;GNU stack smashing protection library - development files&quot;<br>
 FILES_libssp-staticdev = &quot;${libdir}/libssp*.a&quot;<br>
@@ -214,7 +225,7 @@ SUMMARY_libssp-staticdev = &quot;GNU stack smashing protection library - static devel<br>
 FILES_libquadmath = &quot;${libdir}/libquadmath*.so.*&quot;<br>
 SUMMARY_libquadmath = &quot;GNU quad-precision math library&quot;<br>
 FILES_libquadmath-dev = &quot;\<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>
 &quot;<br>
@@ -239,7 +250,8 @@ FILES_libgomp-dev = &quot;\<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>
 &quot;<br>
 SUMMARY_libgomp-dev = &quot;GNU OpenMP parallel programming library - development files&quot;<br>
 FILES_libgomp-staticdev = &quot;${libdir}/libgomp*.a&quot;<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 = &quot; libat_cv_have_ifunc=no &quot;<br>
-<br>
-FILES_libgomp-dev += &quot;\<br>
-    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \<br>
-&quot;<br>
-<br>
-# Building with thumb enabled on armv6t fails<br>
-ARM_INSTRUCTION_SET_armv6 = &quot;arm&quot;<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 = &quot; libat_cv_have_ifunc=no &quot;<br>
-<br>
-FILES_libgomp-dev += &quot;\<br>
-    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \<br>
-&quot;<br>
-<br>
-# Building with thumb enabled on armv6t fails<br>
-ARM_INSTRUCTION_SET_armv6 = &quot;arm&quot;<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>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj Aug. 16, 2019, 3:08 p.m. UTC | #2
On Fri, Aug 16, 2019 at 5:00 AM Martin Jansa <martin.jansa@gmail.com> wrote:
>

> Hi,

>

> 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).

>

> Now the header file is included in RSS:

> lib32-recipe-sysroot/usr/lib/arm-oemllib32-linux-gnueabi/9.2.0/include/omp.h

> but no longer found in default search dirs.

>

> Is this expected or should gcc be adjusted to search for it automatically?

>


It should have adjusted automatically but these headers are searhed
relative to its own install and not sysroot reelative
so it might have to be addressed. Does it work with normal (
non-multilib ) case ?

> Looking at the default search paths I see:

>

> 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"

> ignoring nonexistent directory "/not/exist/usr/include/c++/9.2.0"

> ignoring nonexistent directory "/not/exist/usr/include/c++/9.2.0/arm-oemllib32-linux-gnueabi"

> ignoring nonexistent directory "/not/exist/usr/include/c++/9.2.0/backward"

> 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"

> ignoring nonexistent directory "/not/exist/usr/lib/gcc/arm-oemllib32-linux-gnueabi/9.2.0/include"

> ignoring nonexistent directory "/not/exist/usr/local/include"

> 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"

> 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"

> ignoring nonexistent directory "/not/exist/usr/include"

> #include "..." search starts here:

> #include <...> search starts here:

>  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

>  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

> End of search list.

>

> On Tue, Aug 13, 2019 at 5:29 PM Khem Raj <raj.khem@gmail.com> wrote:

>>

>> OE does not use the traditional /usr/lib/gcc prefix to store gcc-runtime

>> it basically is moved into libdir, however some newer files were

>> installed by newer versions of gcc especially libgomp ( omp.h openacc.h )

>> into gcclibdir, so we have content in both directories, this confuses

>> other tools which are trying to guess the gcc installation and its

>> runtime location, since now we have two directories, the tools either

>> choose one or other and we get inconsistent behavior, e.g. clang for

>> aarch64 uses /usr/lib but same clang for riscv64 chose /usr/lib/gcc

>>

>> This change ensures that OE ends up with single valid location for gcc

>> runtime files

>>

>> Move more common bits into common inc file

>>

>> Signed-off-by: Khem Raj <raj.khem@gmail.com>

>> ---

>> v2: Divert packaging to use new path in whole recipe

>>

>>  meta/recipes-devtools/gcc/gcc-runtime.inc    | 18 +++++++++++++++---

>>  meta/recipes-devtools/gcc/gcc-runtime_8.3.bb | 10 ----------

>>  meta/recipes-devtools/gcc/gcc-runtime_9.1.bb | 10 ----------

>>  3 files changed, 15 insertions(+), 23 deletions(-)

>>

>> diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc

>> index a5c2600d7f..22c1d78dd1 100644

>> --- a/meta/recipes-devtools/gcc/gcc-runtime.inc

>> +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc

>> @@ -17,6 +17,12 @@ EXTRA_OECONF_PATHS = "\

>>  EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"

>>  EXTRA_OECONF_append = " --cache-file=${B}/config.cache"

>>

>> +# Disable ifuncs for libatomic on arm conflicts -march/-mcpu

>> +EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "

>> +

>> +# Building with thumb enabled on armv6t fails

>> +ARM_INSTRUCTION_SET_armv6 = "arm"

>> +

>>  RUNTIMELIBITM = "libitm"

>>  RUNTIMELIBITM_arc = ""

>>  RUNTIMELIBITM_mipsarch = ""

>> @@ -77,6 +83,11 @@ do_install () {

>>                 cd ${B}/${TARGET_SYS}/$d/

>>                 oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install

>>         done

>> +       if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then

>> +               install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include

>> +               mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include

>> +               rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include

>> +       fi

>>         rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir

>>         rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir

>>         rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir

>> @@ -205,7 +216,7 @@ FILES_libssp-dev = "\

>>      ${libdir}/libssp*.so \

>>      ${libdir}/libssp*_nonshared.a \

>>      ${libdir}/libssp*.la \

>> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \

>> +    ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \

>>  "

>>  SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"

>>  FILES_libssp-staticdev = "${libdir}/libssp*.a"

>> @@ -214,7 +225,7 @@ SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static devel

>>  FILES_libquadmath = "${libdir}/libquadmath*.so.*"

>>  SUMMARY_libquadmath = "GNU quad-precision math library"

>>  FILES_libquadmath-dev = "\

>> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \

>> +    ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \

>>      ${libdir}/libquadmath*.so \

>>      ${libdir}/libquadmath.la \

>>  "

>> @@ -239,7 +250,8 @@ FILES_libgomp-dev = "\

>>      ${libdir}/libgomp*${SOLIBSDEV} \

>>      ${libdir}/libgomp*.la \

>>      ${libdir}/libgomp.spec \

>> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \

>> +    ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \

>> +    ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \

>>  "

>>  SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"

>>  FILES_libgomp-staticdev = "${libdir}/libgomp*.a"

>> diff --git a/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb b/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb

>> index a1c7a76d0b..dd430b57eb 100644

>> --- a/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb

>> +++ b/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb

>> @@ -1,12 +1,2 @@

>>  require recipes-devtools/gcc/gcc-${PV}.inc

>>  require gcc-runtime.inc

>> -

>> -# Disable ifuncs for libatomic on arm conflicts -march/-mcpu

>> -EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "

>> -

>> -FILES_libgomp-dev += "\

>> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \

>> -"

>> -

>> -# Building with thumb enabled on armv6t fails

>> -ARM_INSTRUCTION_SET_armv6 = "arm"

>> diff --git a/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb b/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb

>> index a1c7a76d0b..dd430b57eb 100644

>> --- a/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb

>> +++ b/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb

>> @@ -1,12 +1,2 @@

>>  require recipes-devtools/gcc/gcc-${PV}.inc

>>  require gcc-runtime.inc

>> -

>> -# Disable ifuncs for libatomic on arm conflicts -march/-mcpu

>> -EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "

>> -

>> -FILES_libgomp-dev += "\

>> -    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \

>> -"

>> -

>> -# Building with thumb enabled on armv6t fails

>> -ARM_INSTRUCTION_SET_armv6 = "arm"

>> --

>> 2.22.0

>>

>> --

>> _______________________________________________

>> Openembedded-core mailing list

>> Openembedded-core@lists.openembedded.org

>> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Anuj Mittal Aug. 22, 2019, 4:11 a.m. UTC | #3
On Fri, 2019-08-16 at 08:08 -0700, Khem Raj wrote:
> On Fri, Aug 16, 2019 at 5:00 AM Martin Jansa <martin.jansa@gmail.com>

> wrote:

> > Hi,

> > 

> > 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).

> > 

> > Now the header file is included in RSS:

> > lib32-recipe-sysroot/usr/lib/arm-oemllib32-linux-

> > gnueabi/9.2.0/include/omp.h

> > but no longer found in default search dirs.

> > 

> > Is this expected or should gcc be adjusted to search for it

> > automatically?

> > 

> 

> It should have adjusted automatically but these headers are searhed

> relative to its own install and not sysroot reelative

> so it might have to be addressed. Does it work with normal (

> non-multilib ) case ?


It's not working for me as well. It's easy to reproduce when using
find_package(OpenMP) with cmake.

The search paths also don't list this new path and are looking for
headers in old one. Would the path in patch "0020-Ensure-target-gcc-
headers-can-be-included.patch" have to be adjusted as well to include
this new location?

Thanks,

Anuj
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj Aug. 22, 2019, 4:40 a.m. UTC | #4
On Wed, Aug 21, 2019 at 9:11 PM Mittal, Anuj <anuj.mittal@intel.com> wrote:
>

> On Fri, 2019-08-16 at 08:08 -0700, Khem Raj wrote:

> > On Fri, Aug 16, 2019 at 5:00 AM Martin Jansa <martin.jansa@gmail.com>

> > wrote:

> > > Hi,

> > >

> > > 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).

> > >

> > > Now the header file is included in RSS:

> > > lib32-recipe-sysroot/usr/lib/arm-oemllib32-linux-

> > > gnueabi/9.2.0/include/omp.h

> > > but no longer found in default search dirs.

> > >

> > > Is this expected or should gcc be adjusted to search for it

> > > automatically?

> > >

> >

> > It should have adjusted automatically but these headers are searhed

> > relative to its own install and not sysroot reelative

> > so it might have to be addressed. Does it work with normal (

> > non-multilib ) case ?

>

> It's not working for me as well. It's easy to reproduce when using

> find_package(OpenMP) with cmake.

>

> The search paths also don't list this new path and are looking for

> headers in old one. Would the path in patch "0020-Ensure-target-gcc-

> headers-can-be-included.patch" have to be adjusted as well to include

> this new location?

>


there is patch posted already to fix this
https://patchwork.openembedded.org/patch/164057/

> Thanks,

>

> Anuj

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index a5c2600d7f..22c1d78dd1 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -17,6 +17,12 @@  EXTRA_OECONF_PATHS = "\
 EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
 EXTRA_OECONF_append = " --cache-file=${B}/config.cache"
 
+# Disable ifuncs for libatomic on arm conflicts -march/-mcpu
+EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "
+
+# Building with thumb enabled on armv6t fails
+ARM_INSTRUCTION_SET_armv6 = "arm"
+
 RUNTIMELIBITM = "libitm"
 RUNTIMELIBITM_arc = ""
 RUNTIMELIBITM_mipsarch = ""
@@ -77,6 +83,11 @@  do_install () {
 		cd ${B}/${TARGET_SYS}/$d/
 		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
 	done
+	if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include ]; then
+		install -d ${D}${libdir}/${TARGET_SYS}/${BINV}/include 
+		mv ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/* ${D}${libdir}/${TARGET_SYS}/${BINV}/include
+		rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include
+	fi
 	rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
 	rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
 	rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
@@ -205,7 +216,7 @@  FILES_libssp-dev = "\
     ${libdir}/libssp*.so \
     ${libdir}/libssp*_nonshared.a \
     ${libdir}/libssp*.la \
-    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
+    ${libdir}/${TARGET_SYS}/${BINV}/include/ssp \
 "
 SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
 FILES_libssp-staticdev = "${libdir}/libssp*.a"
@@ -214,7 +225,7 @@  SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static devel
 FILES_libquadmath = "${libdir}/libquadmath*.so.*"
 SUMMARY_libquadmath = "GNU quad-precision math library"
 FILES_libquadmath-dev = "\
-    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
+    ${libdir}/${TARGET_SYS}/${BINV}/include/quadmath* \
     ${libdir}/libquadmath*.so \
     ${libdir}/libquadmath.la \
 "
@@ -239,7 +250,8 @@  FILES_libgomp-dev = "\
     ${libdir}/libgomp*${SOLIBSDEV} \
     ${libdir}/libgomp*.la \
     ${libdir}/libgomp.spec \
-    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
+    ${libdir}/${TARGET_SYS}/${BINV}/include/omp.h \
+    ${libdir}/${TARGET_SYS}/${BINV}/include/openacc.h \
 "
 SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
 FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb b/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb
index a1c7a76d0b..dd430b57eb 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_8.3.bb
@@ -1,12 +1,2 @@ 
 require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-runtime.inc
-
-# Disable ifuncs for libatomic on arm conflicts -march/-mcpu
-EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "
-
-FILES_libgomp-dev += "\
-    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \
-"
-
-# Building with thumb enabled on armv6t fails
-ARM_INSTRUCTION_SET_armv6 = "arm"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb b/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb
index a1c7a76d0b..dd430b57eb 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_9.1.bb
@@ -1,12 +1,2 @@ 
 require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-runtime.inc
-
-# Disable ifuncs for libatomic on arm conflicts -march/-mcpu
-EXTRA_OECONF_append_arm = " libat_cv_have_ifunc=no "
-
-FILES_libgomp-dev += "\
-    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \
-"
-
-# Building with thumb enabled on armv6t fails
-ARM_INSTRUCTION_SET_armv6 = "arm"