* [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature
@ 2022-07-23 14:54 Khem Raj
2022-07-23 14:54 ` [PATCH 2/3] gcc-runtime: Use static dummy libstdc++ Khem Raj
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Khem Raj @ 2022-07-23 14:54 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
Ignore the rmdir cmd if using usrmerge distro feature since the
intention is to delete /lib or /lib64 but not libdir under /usr and
base_libdir = libdir when usrmerge is enabled in distro
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-devtools/gcc/libgcc-common.inc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
index 148c9f85a7c..9d4fd41f975 100644
--- a/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -44,10 +44,14 @@ do_install () {
}
do_install:append:libc-baremetal () {
- rmdir ${D}${base_libdir}
+ if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
+ rmdir ${D}${base_libdir}
+ fi
}
do_install:append:libc-newlib () {
- rmdir ${D}${base_libdir}
+ if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
+ rmdir ${D}${base_libdir}
+ fi
}
# No rpm package is actually created but -dev depends on it, avoid dnf error
--
2.37.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] gcc-runtime: Use static dummy libstdc++
2022-07-23 14:54 [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature Khem Raj
@ 2022-07-23 14:54 ` Khem Raj
2022-07-23 14:54 ` [PATCH 3/3] gcc-runtime: Use --with-target-subdir for baremetal targets Khem Raj
2022-07-24 11:47 ` [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature Peter Kjellerstedt
2 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2022-07-23 14:54 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
some standalone targets e.g. riscv64-elf disable shared linking for
baremetal ELF ABI in ld, therefore lets make it a static library
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-devtools/gcc/gcc-runtime.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index b63280ab3a4..15f4175214b 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -54,7 +54,7 @@ do_configure () {
# libstdc++ isn't built yet so CXX would error not able to find it which breaks stdc++'s configure
# tests. Create a dummy empty lib for the purposes of configure.
mkdir -p ${WORKDIR}/dummylib
- ${CC} -x c /dev/null -nostartfiles -shared -o ${WORKDIR}/dummylib/libstdc++.so
+ ${CC} -x c /dev/null -nostartfiles -nostdlib -nostdinc -static -o ${WORKDIR}/dummylib/libstdc++.a
for d in libgcc ${RUNTIMETARGET}; do
echo "Configuring $d"
rm -rf ${B}/${TARGET_SYS}/$d/
--
2.37.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] gcc-runtime: Use --with-target-subdir for baremetal targets
2022-07-23 14:54 [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature Khem Raj
2022-07-23 14:54 ` [PATCH 2/3] gcc-runtime: Use static dummy libstdc++ Khem Raj
@ 2022-07-23 14:54 ` Khem Raj
2022-07-25 20:17 ` [OE-core] " Ross Burton
2022-07-24 11:47 ` [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature Peter Kjellerstedt
2 siblings, 1 reply; 7+ messages in thread
From: Khem Raj @ 2022-07-23 14:54 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
This disables tests for runtime system specific functions like fcntl
there is no other change seen
+configure:77372: checking for fcntl
+configure:77372: result: yes
In libsttdc++ configure log outputs.
[YOCTO #14803]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-devtools/gcc/gcc-runtime.inc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 15f4175214b..91b74c732bd 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -16,7 +16,8 @@ EXTRA_OECONF_PATHS = "\
EXTRA_OECONF:append:linuxstdbase = " --enable-clocale=gnu"
EXTRA_OECONF:append = " --cache-file=${B}/config.cache"
-EXTRA_OECONF:append:libc-newlib = " --with-newlib"
+EXTRA_OECONF:append:libc-newlib = " --with-newlib --with-target-subdir"
+EXTRA_OECONF:append:libc-baremetal = " --with-target-subdir"
# Disable ifuncs for libatomic on arm conflicts -march/-mcpu
EXTRA_OECONF:append:arm = " libat_cv_have_ifunc=no "
--
2.37.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature
2022-07-23 14:54 [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature Khem Raj
2022-07-23 14:54 ` [PATCH 2/3] gcc-runtime: Use static dummy libstdc++ Khem Raj
2022-07-23 14:54 ` [PATCH 3/3] gcc-runtime: Use --with-target-subdir for baremetal targets Khem Raj
@ 2022-07-24 11:47 ` Peter Kjellerstedt
2022-07-24 13:51 ` Khem Raj
2 siblings, 1 reply; 7+ messages in thread
From: Peter Kjellerstedt @ 2022-07-24 11:47 UTC (permalink / raw)
To: Khem Raj, openembedded-core
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Khem Raj
> Sent: den 23 juli 2022 16:54
> To: openembedded-core@lists.openembedded.org
> Cc: Khem Raj <raj.khem@gmail.com>
> Subject: [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature
>
> Ignore the rmdir cmd if using usrmerge distro feature since the
> intention is to delete /lib or /lib64 but not libdir under /usr and
> base_libdir = libdir when usrmerge is enabled in distro
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/recipes-devtools/gcc/libgcc-common.inc | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
> index 148c9f85a7c..9d4fd41f975 100644
> --- a/meta/recipes-devtools/gcc/libgcc-common.inc
> +++ b/meta/recipes-devtools/gcc/libgcc-common.inc
> @@ -44,10 +44,14 @@ do_install () {
> }
>
> do_install:append:libc-baremetal () {
> - rmdir ${D}${base_libdir}
> + if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
Since the goal is to avoid deleting ${libdir} in case it happens to match
${base_libdir}, I recommend to change the tests to instead be:
if [ "${base_libdir}" != "${libdir}" ]; then
> + rmdir ${D}${base_libdir}
> + fi
> }
> do_install:append:libc-newlib () {
> - rmdir ${D}${base_libdir}
> + if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
> + rmdir ${D}${base_libdir}
> + fi
> }
>
> # No rpm package is actually created but -dev depends on it, avoid dnf error
> --
> 2.37.1
//Peter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature
2022-07-24 11:47 ` [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature Peter Kjellerstedt
@ 2022-07-24 13:51 ` Khem Raj
2022-07-24 14:38 ` Peter Kjellerstedt
0 siblings, 1 reply; 7+ messages in thread
From: Khem Raj @ 2022-07-24 13:51 UTC (permalink / raw)
To: Peter Kjellerstedt; +Cc: openembedded-core
Hi Peter
Thanks for the review.
On Sun, Jul 24, 2022 at 7:47 AM Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
>
> > -----Original Message-----
> > From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Khem Raj
> > Sent: den 23 juli 2022 16:54
> > To: openembedded-core@lists.openembedded.org
> > Cc: Khem Raj <raj.khem@gmail.com>
> > Subject: [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature
> >
> > Ignore the rmdir cmd if using usrmerge distro feature since the
> > intention is to delete /lib or /lib64 but not libdir under /usr and
> > base_libdir = libdir when usrmerge is enabled in distro
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > meta/recipes-devtools/gcc/libgcc-common.inc | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
> > index 148c9f85a7c..9d4fd41f975 100644
> > --- a/meta/recipes-devtools/gcc/libgcc-common.inc
> > +++ b/meta/recipes-devtools/gcc/libgcc-common.inc
> > @@ -44,10 +44,14 @@ do_install () {
> > }
> >
> > do_install:append:libc-baremetal () {
> > - rmdir ${D}${base_libdir}
> > + if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
>
> Since the goal is to avoid deleting ${libdir} in case it happens to match
> ${base_libdir}, I recommend to change the tests to instead be:
>
> if [ "${base_libdir}" != "${libdir}" ]; then
>
I don't see much benefit of doing this since our usecase is guarded by
distro feature and I found it more readable
having said that I am fine to change it as well, other option would be
to use rmdir --ignore-fail-on-non-empty and avoid
the check but that will make it generic and we might not see some
unwanted files sneaking into base_libdir so erroring out
is a good check.
> > + rmdir ${D}${base_libdir}
> > + fi
> > }
> > do_install:append:libc-newlib () {
> > - rmdir ${D}${base_libdir}
> > + if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
> > + rmdir ${D}${base_libdir}
> > + fi
> > }
> >
> > # No rpm package is actually created but -dev depends on it, avoid dnf error
> > --
> > 2.37.1
>
> //Peter
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature
2022-07-24 13:51 ` Khem Raj
@ 2022-07-24 14:38 ` Peter Kjellerstedt
0 siblings, 0 replies; 7+ messages in thread
From: Peter Kjellerstedt @ 2022-07-24 14:38 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
> -----Original Message-----
> From: Khem Raj <raj.khem@gmail.com>
> Sent: den 24 juli 2022 15:52
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds
> with usrmerge distro feature
>
> Hi Peter
>
> Thanks for the review.
>
> On Sun, Jul 24, 2022 at 7:47 AM Peter Kjellerstedt
> <peter.kjellerstedt@axis.com> wrote:
> >
> > > -----Original Message-----
> > > From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Khem Raj
> > > Sent: den 23 juli 2022 16:54
> > > To: openembedded-core@lists.openembedded.org
> > > Cc: Khem Raj <raj.khem@gmail.com>
> > > Subject: [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds
> with usrmerge distro feature
> > >
> > > Ignore the rmdir cmd if using usrmerge distro feature since the
> > > intention is to delete /lib or /lib64 but not libdir under /usr and
> > > base_libdir = libdir when usrmerge is enabled in distro
> > >
> > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > ---
> > > meta/recipes-devtools/gcc/libgcc-common.inc | 8 ++++++--
> > > 1 file changed, 6 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc
> b/meta/recipes-devtools/gcc/libgcc-common.inc
> > > index 148c9f85a7c..9d4fd41f975 100644
> > > --- a/meta/recipes-devtools/gcc/libgcc-common.inc
> > > +++ b/meta/recipes-devtools/gcc/libgcc-common.inc
> > > @@ -44,10 +44,14 @@ do_install () {
> > > }
> > >
> > > do_install:append:libc-baremetal () {
> > > - rmdir ${D}${base_libdir}
> > > + if
> ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
> >
> > Since the goal is to avoid deleting ${libdir} in case it happens to
> match
> > ${base_libdir}, I recommend to change the tests to instead be:
> >
> > if [ "${base_libdir}" != "${libdir}" ]; then
> >
>
> I don't see much benefit of doing this since our usecase is guarded by
> distro feature and I found it more readable
We already have corresponding tests in other places where we want to
avoid removing ${libdir} if it happens to match ${base_libdir}, e.g.,
in the glibc-package.inc file.
The benefit I see with comparing the two variables rather than relying
on the distro feature is that the test isn't really related to usrmerge,
it only happens to coincide. I.e., if I would manually configure my
system so that ${base_libdir} == ${libdir} without setting usrmerge,
the test here would still do the right thing (things would probably
break in other places though, but that is a different story).
> having said that I am fine to change it as well, other option would be
> to use rmdir --ignore-fail-on-non-empty and avoid
> the check but that will make it generic and we might not see some
> unwanted files sneaking into base_libdir so erroring out
> is a good check.
>
> > > + rmdir ${D}${base_libdir}
> > > + fi
> > > }
> > > do_install:append:libc-newlib () {
> > > - rmdir ${D}${base_libdir}
> > > + if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)}; then
> > > + rmdir ${D}${base_libdir}
> > > + fi
> > > }
> > >
> > > # No rpm package is actually created but -dev depends on it, avoid dnf error
> > > --
> > > 2.37.1
> >
> > //Peter
//Peter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH 3/3] gcc-runtime: Use --with-target-subdir for baremetal targets
2022-07-23 14:54 ` [PATCH 3/3] gcc-runtime: Use --with-target-subdir for baremetal targets Khem Raj
@ 2022-07-25 20:17 ` Ross Burton
0 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2022-07-25 20:17 UTC (permalink / raw)
To: raj.khem; +Cc: openembedded-core
Fixes our builds, thanks Khem!
Ross
> On 23 Jul 2022, at 15:54, Khem Raj via lists.openembedded.org <raj.khem=gmail.com@lists.openembedded.org> wrote:
>
> This disables tests for runtime system specific functions like fcntl
> there is no other change seen
>
> +configure:77372: checking for fcntl
> +configure:77372: result: yes
>
> In libsttdc++ configure log outputs.
>
> [YOCTO #14803]
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/recipes-devtools/gcc/gcc-runtime.inc | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
> index 15f4175214b..91b74c732bd 100644
> --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
> +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
> @@ -16,7 +16,8 @@ EXTRA_OECONF_PATHS = "\
>
> EXTRA_OECONF:append:linuxstdbase = " --enable-clocale=gnu"
> EXTRA_OECONF:append = " --cache-file=${B}/config.cache"
> -EXTRA_OECONF:append:libc-newlib = " --with-newlib"
> +EXTRA_OECONF:append:libc-newlib = " --with-newlib --with-target-subdir"
> +EXTRA_OECONF:append:libc-baremetal = " --with-target-subdir"
>
> # Disable ifuncs for libatomic on arm conflicts -march/-mcpu
> EXTRA_OECONF:append:arm = " libat_cv_have_ifunc=no "
> --
> 2.37.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#168442): https://lists.openembedded.org/g/openembedded-core/message/168442
> Mute This Topic: https://lists.openembedded.org/mt/92568011/6875888
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ross.burton@arm.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-07-25 20:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-23 14:54 [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature Khem Raj
2022-07-23 14:54 ` [PATCH 2/3] gcc-runtime: Use static dummy libstdc++ Khem Raj
2022-07-23 14:54 ` [PATCH 3/3] gcc-runtime: Use --with-target-subdir for baremetal targets Khem Raj
2022-07-25 20:17 ` [OE-core] " Ross Burton
2022-07-24 11:47 ` [OE-core] [PATCH 1/3] libgcc: Fix standalone target builds with usrmerge distro feature Peter Kjellerstedt
2022-07-24 13:51 ` Khem Raj
2022-07-24 14:38 ` Peter Kjellerstedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.