diff mbox series

glib: set glib-specific cross properties

Message ID 20190326120157.4397-1-ross.burton@intel.com
State Accepted
Commit e04e0a20cab04966698c50dc79195a8f159248d3
Headers show
Series glib: set glib-specific cross properties | expand

Commit Message

Ross Burton March 26, 2019, 12:01 p.m. UTC
GLib wants to execute code to identify several properties of the system, for
example is vsprintf() broken and what direction does the stack grow. In
cross-compiled environments these fallback to the default values which are not
always correct (our vsprintf() is fine, but the test assumes it isn't) so set
these properties explicitly.

Ideally this happens magically by meson.bbclass using the same logic as
siteinfo.bbclass, but we need to fix glib now.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross | 6 ++++++
 meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb        | 1 +
 meta/recipes-core/glib-2.0/glib.inc                  | 1 +
 3 files changed, 8 insertions(+)
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross

-- 
2.11.0

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

Comments

Khem Raj March 26, 2019, 6:08 p.m. UTC | #1
On Tue, Mar 26, 2019 at 5:02 AM Ross Burton <ross.burton@intel.com> wrote:
>

> GLib wants to execute code to identify several properties of the system, for

> example is vsprintf() broken and what direction does the stack grow. In

> cross-compiled environments these fallback to the default values which are not

> always correct (our vsprintf() is fine, but the test assumes it isn't) so set

> these properties explicitly.

>

> Ideally this happens magically by meson.bbclass using the same logic as

> siteinfo.bbclass, but we need to fix glib now.

>

> Signed-off-by: Ross Burton <ross.burton@intel.com>

> ---

>  meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross | 6 ++++++

>  meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb        | 1 +

>  meta/recipes-core/glib-2.0/glib.inc                  | 1 +

>  3 files changed, 8 insertions(+)

>  create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross

>

> diff --git a/meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross b/meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross

> new file mode 100644

> index 00000000000..8420f9874e1

> --- /dev/null

> +++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross

> @@ -0,0 +1,6 @@

> +[properties]

> +have_c99_vsnprintf = true

> +have_c99_snprintf = true

> +have_unix98_printf = true

> +va_val_copy = true

> +growing_stack = false


this is mostly true for arches we support but maybe a comment
to check it when doing explicit arch ports ( e.g. arm can grown both ways)


> diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb

> index 2de2affa51a..c872c749202 100644

> --- a/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb

> +++ b/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb

> @@ -16,6 +16,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \

>             file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \

>             file://0001-Do-not-write-bindir-into-pkg-config-files.patch \

>             file://0001-meson.build-do-not-hardcode-linux-as-the-host-system.patch \

> +           file://glib-meson.cross \

>             "

>

>  SRC_URI_append_class-native = " file://relocate-modules.patch"

> diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc

> index 6f0ec1ad2e9..574bb38557b 100644

> --- a/meta/recipes-core/glib-2.0/glib.inc

> +++ b/meta/recipes-core/glib-2.0/glib.inc

> @@ -53,6 +53,7 @@ PACKAGECONFIG[libelf] = ",,elfutils"

>  PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,dbus"

>

>  EXTRA_OEMESON = "-Ddtrace=false -Dfam=false -Dsystemtap=false -Dselinux=false"

> +EXTRA_OEMESON_append_class-target = " --cross-file ${WORKDIR}/glib-meson.cross"

>

>  do_configure_prepend() {

>         sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in

> --

> 2.11.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
Andre McCurdy March 26, 2019, 7:41 p.m. UTC | #2
On Tue, Mar 26, 2019 at 11:08 AM Khem Raj <raj.khem@gmail.com> wrote:
> On Tue, Mar 26, 2019 at 5:02 AM Ross Burton <ross.burton@intel.com> wrote:

> >

> > GLib wants to execute code to identify several properties of the system, for

> > example is vsprintf() broken and what direction does the stack grow. In

> > cross-compiled environments these fallback to the default values which are not

> > always correct (our vsprintf() is fine, but the test assumes it isn't) so set

> > these properties explicitly.

> >

> > Ideally this happens magically by meson.bbclass using the same logic as

> > siteinfo.bbclass, but we need to fix glib now.

> >

> > Signed-off-by: Ross Burton <ross.burton@intel.com>

> > ---

> >  meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross | 6 ++++++

> >  meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb        | 1 +

> >  meta/recipes-core/glib-2.0/glib.inc                  | 1 +

> >  3 files changed, 8 insertions(+)

> >  create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross

> >

> > diff --git a/meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross b/meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross

> > new file mode 100644

> > index 00000000000..8420f9874e1

> > --- /dev/null

> > +++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross

> > @@ -0,0 +1,6 @@

> > +[properties]

> > +have_c99_vsnprintf = true

> > +have_c99_snprintf = true

> > +have_unix98_printf = true

> > +va_val_copy = true

> > +growing_stack = false

>

> this is mostly true for arches we support but maybe a comment

> to check it when doing explicit arch ports ( e.g. arm can grown both ways)


Not on EABI or any other ARM ABI which could possibly be targeted by
OE... unless you have evidence to prove otherwise?

> > diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb

> > index 2de2affa51a..c872c749202 100644

> > --- a/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb

> > +++ b/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb

> > @@ -16,6 +16,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \

> >             file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \

> >             file://0001-Do-not-write-bindir-into-pkg-config-files.patch \

> >             file://0001-meson.build-do-not-hardcode-linux-as-the-host-system.patch \

> > +           file://glib-meson.cross \

> >             "

> >

> >  SRC_URI_append_class-native = " file://relocate-modules.patch"

> > diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc

> > index 6f0ec1ad2e9..574bb38557b 100644

> > --- a/meta/recipes-core/glib-2.0/glib.inc

> > +++ b/meta/recipes-core/glib-2.0/glib.inc

> > @@ -53,6 +53,7 @@ PACKAGECONFIG[libelf] = ",,elfutils"

> >  PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,dbus"

> >

> >  EXTRA_OEMESON = "-Ddtrace=false -Dfam=false -Dsystemtap=false -Dselinux=false"

> > +EXTRA_OEMESON_append_class-target = " --cross-file ${WORKDIR}/glib-meson.cross"

> >

> >  do_configure_prepend() {

> >         sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in

> > --

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

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Ross Burton March 28, 2019, 12:48 p.m. UTC | #3
On Tue, 26 Mar 2019 at 19:41, Andre McCurdy <armccurdy@gmail.com> wrote:
> > > +growing_stack = false

> >

> > this is mostly true for arches we support but maybe a comment

> > to check it when doing explicit arch ports ( e.g. arm can grown both ways)

>

> Not on EABI or any other ARM ABI which could possibly be targeted by

> OE... unless you have evidence to prove otherwise?


Evidence, no.  Anecdotally:

$ grep glib_cv_stack_grows *
arc-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}
arm-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}
arm-darwin:glib_cv_stack_grows=${glib_cv_stack_grows=no}
arm-darwin8:glib_cv_stack_grows=${glib_cv_stack_grows=no}
ix86-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}
microblaze-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mips64el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mips64el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mips64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mips64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsel-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsel-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsisa32r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsisa32r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsisa32r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsisa32r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsisa64r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsisa64r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsisa64r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mipsisa64r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mips-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
mips-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
nios2-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
powerpc-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
riscv32-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
riscv64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
sh-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}
sparc-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}
x86_64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

Yes, this technique needs to be extended and generalised so it can be
overridden on a per-platform basis, but for now it appears that
everything we care about has the same values.

Ross
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj March 28, 2019, 1:45 p.m. UTC | #4
On Thu, Mar 28, 2019 at 5:48 AM Burton, Ross <ross.burton@intel.com> wrote:

> On Tue, 26 Mar 2019 at 19:41, Andre McCurdy <armccurdy@gmail.com> wrote:

> > > > +growing_stack = false

> > >

> > > this is mostly true for arches we support but maybe a comment

> > > to check it when doing explicit arch ports ( e.g. arm can grown both

> ways)

> >

> > Not on EABI or any other ARM ABI which could possibly be targeted by

> > OE... unless you have evidence to prove otherwise?

>

> Evidence, no.  Anecdotally:

>

> $ grep glib_cv_stack_grows *

> arc-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> arm-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> arm-darwin:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> arm-darwin8:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> ix86-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> microblaze-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mips64el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mips64el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mips64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mips64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsel-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsel-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsisa32r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsisa32r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsisa32r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsisa32r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsisa64r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsisa64r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsisa64r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mipsisa64r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mips-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> mips-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> nios2-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> powerpc-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> riscv32-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> riscv64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> sh-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> sparc-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

> x86_64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}

>

> Yes, this technique needs to be extended and generalised so it can be

> overridden on a per-platform basis, but for now it appears that

> everything we care about has the same values.



All I asked was to add a comment about it
So if someone is porting OE to new architecture then this will be a great
hint to check for


>

> Ross

>
<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 28, 2019 at 5:48 AM Burton, Ross &lt;<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 26 Mar 2019 at 19:41, Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt; +growing_stack = false<br>
&gt; &gt;<br>
&gt; &gt; this is mostly true for arches we support but maybe a comment<br>
&gt; &gt; to check it when doing explicit arch ports ( e.g. arm can grown both ways)<br>
&gt;<br>
&gt; Not on EABI or any other ARM ABI which could possibly be targeted by<br>
&gt; OE... unless you have evidence to prove otherwise?<br>
<br>
Evidence, no.  Anecdotally:<br>
<br>
$ grep glib_cv_stack_grows *<br>
arc-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
arm-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
arm-darwin:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
arm-darwin8:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
ix86-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
microblaze-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mips64el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mips64el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mips64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mips64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsel-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsel-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsisa32r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsisa32r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsisa32r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsisa32r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsisa64r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsisa64r6el-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsisa64r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mipsisa64r6-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mips-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
mips-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
nios2-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
powerpc-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
riscv32-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
riscv64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
sh-common:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
sparc-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
x86_64-linux:glib_cv_stack_grows=${glib_cv_stack_grows=no}<br>
<br>
Yes, this technique needs to be extended and generalised so it can be<br>
overridden on a per-platform basis, but for now it appears that<br>
everything we care about has the same values.</blockquote><div dir="auto"><br></div><div dir="auto">All I asked was to add a comment about it</div><div dir="auto">So if someone is porting OE to new architecture then this will be a great hint to check for </div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Ross<br>
</blockquote></div></div>
-- 
_______________________________________________
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-core/glib-2.0/glib-2.0/glib-meson.cross b/meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross
new file mode 100644
index 00000000000..8420f9874e1
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-meson.cross
@@ -0,0 +1,6 @@ 
+[properties]
+have_c99_vsnprintf = true
+have_c99_snprintf = true
+have_unix98_printf = true
+va_val_copy = true
+growing_stack = false
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb
index 2de2affa51a..c872c749202 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb
@@ -16,6 +16,7 @@  SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
            file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \
            file://0001-Do-not-write-bindir-into-pkg-config-files.patch \
            file://0001-meson.build-do-not-hardcode-linux-as-the-host-system.patch \
+           file://glib-meson.cross \
            "
 
 SRC_URI_append_class-native = " file://relocate-modules.patch"
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
index 6f0ec1ad2e9..574bb38557b 100644
--- a/meta/recipes-core/glib-2.0/glib.inc
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -53,6 +53,7 @@  PACKAGECONFIG[libelf] = ",,elfutils"
 PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,dbus"
 
 EXTRA_OEMESON = "-Ddtrace=false -Dfam=false -Dsystemtap=false -Dselinux=false"
+EXTRA_OEMESON_append_class-target = " --cross-file ${WORKDIR}/glib-meson.cross"
 
 do_configure_prepend() {
 	sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in