diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-08-13 21:59:20 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-16 07:54:38 +0100 |
commit | 0ffc861b49aeb29a37020c942bf5ab70fefec6a9 (patch) | |
tree | 462056ce16a5bf34077e4cc7d6bde3691cde17dc /meta/recipes-core/glibc | |
parent | 0a8e0691e04684823fa69b60046a6c85604c730b (diff) | |
download | poky-0ffc861b49aeb29a37020c942bf5ab70fefec6a9.tar.gz |
glibc: Fix SVE detection on aarch64
(From OE-Core rev: 10e1ae119e8087598947dd45c163d5fe6569839d)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc')
-rw-r--r-- | meta/recipes-core/glibc/glibc/0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch | 56 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc_2.38.bb | 2 |
2 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch b/meta/recipes-core/glibc/glibc/0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch new file mode 100644 index 0000000000..7be9fc981d --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From d836f008a96aa9b2e88c7b394bfc110542e57176 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 4 Aug 2023 09:34:50 -0700 | ||
4 | Subject: [PATCH] aarch64/configure: Pass -mcpu along with -march to detect sve | ||
5 | support | ||
6 | |||
7 | SVE support logic in configure is rightly passing -march=<arch>+sve to | ||
8 | compiler to override whatever user might have passed via environment, | ||
9 | however GCC does not do as intended when -mcpu is part of environment | ||
10 | compiler flags, then it overrides the -march computed from -mcpu and | ||
11 | igonores other -march values so this test fails for lot of aarch64 | ||
12 | machines which pass -mcpu that does not support sve. This is seemingly a | ||
13 | bug in GCC [1], until that is fixed we preempt -mcpu along with -march | ||
14 | in the configure test itself. It does not change functionality and yet | ||
15 | lets us through the GCC inconsistency. | ||
16 | |||
17 | [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110901 | ||
18 | |||
19 | Upstream-Status: Inappropriate [Workaround for a GCC issue] | ||
20 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
21 | |||
22 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
23 | --- | ||
24 | sysdeps/aarch64/configure | 2 +- | ||
25 | sysdeps/aarch64/configure.ac | 2 +- | ||
26 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure | ||
29 | index 5e91fab023..39dddc66d4 100644 | ||
30 | --- a/sysdeps/aarch64/configure | ||
31 | +++ b/sysdeps/aarch64/configure | ||
32 | @@ -327,7 +327,7 @@ else $as_nop | ||
33 | cat > conftest.s <<\EOF | ||
34 | ptrue p0.b | ||
35 | EOF | ||
36 | -if { ac_try='${CC-cc} -c -march=armv8.2-a+sve conftest.s 1>&5' | ||
37 | +if { ac_try='${CC-cc} -c -mcpu=generic+sve -march=armv8.2-a+sve conftest.s 1>&5' | ||
38 | { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 | ||
39 | (eval $ac_try) 2>&5 | ||
40 | ac_status=$? | ||
41 | diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac | ||
42 | index 8a708f2ef4..b6a146d2be 100644 | ||
43 | --- a/sysdeps/aarch64/configure.ac | ||
44 | +++ b/sysdeps/aarch64/configure.ac | ||
45 | @@ -92,7 +92,7 @@ AC_CACHE_CHECK([for SVE support in assembler], [libc_cv_aarch64_sve_asm], [dnl | ||
46 | cat > conftest.s <<\EOF | ||
47 | ptrue p0.b | ||
48 | EOF | ||
49 | -if AC_TRY_COMMAND(${CC-cc} -c -march=armv8.2-a+sve conftest.s 1>&AS_MESSAGE_LOG_FD); then | ||
50 | +if AC_TRY_COMMAND(${CC-cc} -c -mcpu=generic+sve -march=armv8.2-a+sve conftest.s 1>&AS_MESSAGE_LOG_FD); then | ||
51 | libc_cv_aarch64_sve_asm=yes | ||
52 | else | ||
53 | libc_cv_aarch64_sve_asm=no | ||
54 | -- | ||
55 | 2.41.0 | ||
56 | |||
diff --git a/meta/recipes-core/glibc/glibc_2.38.bb b/meta/recipes-core/glibc/glibc_2.38.bb index c02730bcb5..32ccb888f0 100644 --- a/meta/recipes-core/glibc/glibc_2.38.bb +++ b/meta/recipes-core/glibc/glibc_2.38.bb | |||
@@ -50,6 +50,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ | |||
50 | file://0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch \ | 50 | file://0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch \ |
51 | file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ | 51 | file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ |
52 | file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \ | 52 | file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \ |
53 | file://0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch \ | ||
53 | " | 54 | " |
54 | S = "${WORKDIR}/git" | 55 | S = "${WORKDIR}/git" |
55 | B = "${WORKDIR}/build-${TARGET_SYS}" | 56 | B = "${WORKDIR}/build-${TARGET_SYS}" |
@@ -86,6 +87,7 @@ EXTRA_OECONF:append:x86 = " ${@bb.utils.contains_any('TUNE_FEATURES', 'i586 c3', | |||
86 | EXTRA_OECONF:append:x86-64 = " --enable-cet" | 87 | EXTRA_OECONF:append:x86-64 = " --enable-cet" |
87 | 88 | ||
88 | PACKAGECONFIG ??= "nscd memory-tagging" | 89 | PACKAGECONFIG ??= "nscd memory-tagging" |
90 | |||
89 | PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd" | 91 | PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd" |
90 | PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging" | 92 | PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging" |
91 | 93 | ||