Skip to contentSkip to conversation

glibc: Backport patch to fix ifuncs on risc-v and gcc10 builds

PATCH In review Khem Raj 2 participants 5 messages Mar 26, 2020 – Mar 27, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 glibc: Backport patch to fix ifuncs on risc-v and gcc10 builds

ifunc patch is needed to address a glibc ptests failure on riscv long double double patch is backported to let 2.31 build with gcc10

---
 .../0030-Improve-IFUNC-check-BZ-25506.patch   |  47 +++++
 ...-with-GCC-10-when-long-double-double.patch | 170 ++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.31.bb         |   2 +
 3 files changed, 219 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0030-Improve-IFUNC-check-BZ-25506.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0031-Fix-build-with-GCC-10-when-long-double-double.patch
meta/recipes-core/glibc/glibc/0030-Improve-IFUNC-check-BZ-25506.patch new file +47 -0
new file mode 100644
index 0000000000..1cb398d2bc
@@ -0,0 +1,47 @@
+From 87a698a21646b7ee620923ef5ffa9735471a8ddd Mon Sep 17 00:00:00 2001
+From: Fangrui Song <[email protected]>
+Date: Tue, 4 Feb 2020 21:55:44 -0800
+Subject: [PATCH] Improve IFUNC check [BZ #25506]
+
+GNU ld's RISCV port does not support IFUNC. ld -no-pie produces no
+relocation and the test passed incorrectly. Be more rigid by testing
+IRELATIVE explicitly.
+
+Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=87a698a21646b7ee620923ef5ffa9735471a8ddd]
+Tested-by: Aurelien Jarno <[email protected]>
+Reviewed-by: Adhemerval Zanella <[email protected]>
+Signed-off-by: Khem Raj <[email protected]>
+---
+ configure    | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index b959d2d988..3b98ec312f 100755
+--- a/configure
++++ b/configure
+@@ -4035,7 +4035,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
+ 	    -o conftest conftest.S 1>&5 2>&5; then
+   # Do a link to see if the backend supports IFUNC relocs.
+   $READELF -r conftest 1>&5
+-  LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
++  LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && {
+     libc_cv_ld_gnu_indirect_function=yes
+   }
+ fi
+diff --git a/configure.ac b/configure.ac
+index 49b900c1ed..e20034f301 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
+ 	    -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
+   # Do a link to see if the backend supports IFUNC relocs.
+   $READELF -r conftest 1>&AS_MESSAGE_LOG_FD
+-  LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
++  LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && {
+     libc_cv_ld_gnu_indirect_function=yes
+   }
+ fi
+-- 
+2.25.1
+
meta/recipes-core/glibc/glibc/0031-Fix-build-with-GCC-10-when-long-double-double.patch new file +170 -0

170 lines not on this page · raw message

meta/recipes-core/glibc/glibc_2.31.bb +2 -0
index 6dd9415f6b..6605fd3967 100644
@@ -41,6 +41,8 @@ SRC_URI =  "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
            file://0028-inject-file-assembly-directives.patch \
            file://0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
            file://CVE-2020-10029.patch \
+           file://0030-Improve-IFUNC-check-BZ-25506.patch \
+           file://0031-Fix-build-with-GCC-10-when-long-double-double.patch \
            "
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build-${TARGET_SYS}"
Signature · 1 line
2.26.0
#1 lore raw
Quoted 4 lines

...
+ configure | 2 +-
+ configure.ac | 2 +-
...

This shouldn't patch both.

cu
Adrian

author
#2 lore raw
Quoted 8 lines · Adrian Bunk
Quoted 5 lines

...
+ configure | 2 +-
+ configure.ac | 2 +-
...

This shouldn't patch both.

why ?

Quoted 2 lines

cu
Adrian

author
#3 lore raw
Quoted 8 lines · Khem Raj
Quoted 6 lines · Adrian Bunk
Quoted 5 lines

...
+ configure | 2 +-
+ configure.ac | 2 +-
...

Quoted 5 lines
Quoted 2 lines

This shouldn't patch both.

why ?

Yes, there were few more, so I have rather sent a new patch on top

Quoted 2 lines
Quoted 2 lines

cu
Adrian

author
#4 lore raw
Quoted 10 lines · Khem Raj
Quoted 8 lines · Khem Raj
Quoted 6 lines · Adrian Bunk
Quoted 5 lines

...
+ configure | 2 +-
+ configure.ac | 2 +-
...

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

This shouldn't patch both.

why ?

Yes, there were few more, so I have rather sent a new patch on top

well in glibc we do not configure inplace instead we use pre-generated configure files
and we touch them specifically so they dont get regenerated. So this patch is ok

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

cu
Adrian