diff mbox series

[2/2] glibc: Enable mathvec when sve is available as tune feature

Message ID 20230725035626.984709-2-raj.khem@gmail.com
State New
Headers show
Series [1/2] nfs-utils: Fix host path contamination building locktest | expand

Commit Message

Khem Raj July 25, 2023, 3:56 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-core/glibc/glibc_2.37.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ross Burton Aug. 4, 2023, 11:40 a.m. UTC | #1
On 25 Jul 2023, at 04:56, Khem Raj via lists.openembedded.org <raj.khem=gmail.com@lists.openembedded.org> wrote:
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/recipes-core/glibc/glibc_2.37.bb | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-core/glibc/glibc_2.37.bb b/meta/recipes-core/glibc/glibc_2.37.bb
> index 8ff9801ed4b..4290f3e6e4f 100644
> --- a/meta/recipes-core/glibc/glibc_2.37.bb
> +++ b/meta/recipes-core/glibc/glibc_2.37.bb
> @@ -85,7 +85,8 @@ EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
> EXTRA_OECONF:append:x86 = " ${@bb.utils.contains_any('TUNE_FEATURES', 'i586 c3', '--disable-cet', '--enable-cet', d)}"
> EXTRA_OECONF:append:x86-64 = " --enable-cet"
> 
> -PACKAGECONFIG ??= "nscd memory-tagging"
> +PACKAGECONFIG ??= "nscd memory-tagging ${@bb.utils.filter('TUNE_FEATURES', 'sve', d)}"
> +
> PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd"
> PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging"
> PACKAGECONFIG[sve] = "--enable-mathvec,--disable-mathvec"

This is the wrong thing to do, imho.

mathvec has existed since glibc 2.22 for x86-64 and only with 2.38 did it gain aarch64 support, where it has both NEON and SVE (optional in 8.2+) implementations.

Fedora 38 and Debian 11 both have a libmvec.so, so it looks like we should be turning it on by default for the relevant architectures (x86-64 for <2.38, x86-64 and aarch64 for 2.38+).

Ross
Khem Raj Aug. 4, 2023, 2:19 p.m. UTC | #2
On Fri, Aug 4, 2023 at 4:40 AM Ross Burton <Ross.Burton@arm.com> wrote:
>
> On 25 Jul 2023, at 04:56, Khem Raj via lists.openembedded.org <raj.khem=gmail.com@lists.openembedded.org> wrote:
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > meta/recipes-core/glibc/glibc_2.37.bb | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-core/glibc/glibc_2.37.bb b/meta/recipes-core/glibc/glibc_2.37.bb
> > index 8ff9801ed4b..4290f3e6e4f 100644
> > --- a/meta/recipes-core/glibc/glibc_2.37.bb
> > +++ b/meta/recipes-core/glibc/glibc_2.37.bb
> > @@ -85,7 +85,8 @@ EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
> > EXTRA_OECONF:append:x86 = " ${@bb.utils.contains_any('TUNE_FEATURES', 'i586 c3', '--disable-cet', '--enable-cet', d)}"
> > EXTRA_OECONF:append:x86-64 = " --enable-cet"
> >
> > -PACKAGECONFIG ??= "nscd memory-tagging"
> > +PACKAGECONFIG ??= "nscd memory-tagging ${@bb.utils.filter('TUNE_FEATURES', 'sve', d)}"
> > +
> > PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd"
> > PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging"
> > PACKAGECONFIG[sve] = "--enable-mathvec,--disable-mathvec"
>
> This is the wrong thing to do, imho.
>
> mathvec has existed since glibc 2.22 for x86-64 and only with 2.38 did it gain aarch64 support, where it has both NEON and SVE (optional in 8.2+) implementations.
>
> Fedora 38 and Debian 11 both have a libmvec.so, so it looks like we should be turning it on by default for the relevant architectures (x86-64 for <2.38, x86-64 and aarch64 for 2.38+).

these distros do not specify -mcpu like OE does and it lets glibc
override these options which it does when detecting SVE
but it fails for OE due to compiler flags because it inserts itself on
top of glibc defaults

>
> Ross
diff mbox series

Patch

diff --git a/meta/recipes-core/glibc/glibc_2.37.bb b/meta/recipes-core/glibc/glibc_2.37.bb
index 8ff9801ed4b..4290f3e6e4f 100644
--- a/meta/recipes-core/glibc/glibc_2.37.bb
+++ b/meta/recipes-core/glibc/glibc_2.37.bb
@@ -85,7 +85,8 @@  EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
 EXTRA_OECONF:append:x86 = " ${@bb.utils.contains_any('TUNE_FEATURES', 'i586 c3', '--disable-cet', '--enable-cet', d)}"
 EXTRA_OECONF:append:x86-64 = " --enable-cet"
 
-PACKAGECONFIG ??= "nscd memory-tagging"
+PACKAGECONFIG ??= "nscd memory-tagging ${@bb.utils.filter('TUNE_FEATURES', 'sve', d)}"
+
 PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd"
 PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging"
 PACKAGECONFIG[sve] = "--enable-mathvec,--disable-mathvec"