All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/prelink-cross: fix handling of TLS offsets for s390 arch
@ 2021-08-08  9:48 Alexander Egorenkov
  2021-08-08 20:39 ` Thomas Petazzoni
  2021-09-04 19:54 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Egorenkov @ 2021-08-08  9:48 UTC (permalink / raw)
  To: buildroot
  Cc: thomas.petazzoni, Alexander Egorenkov, yann.morin.1998, aduskett

/tmp/instance-1/output-1/host/sbin/prelink-rtld: error while loading
shared libraries: /lib64/libc.so.6: cannot handle TLS data
ERROR: can't resolve libraries to shared libraries: glib-2.0, gobject-2.0
ninja: build stopped: subcommand failed.
make: *** [package/pkg-generic.mk:270:
/tmp/instance-1/output-1/build/gobject-introspection-1.68.0/.stamp_built]
Error 1
make: Leaving directory '/tmp/instance-1/buildroot'

Fixes:
- http://autobuild.buildroot.org/?reason=gobject-introspection-1.68.0&arch=s390x

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
---
 ...c-Fix-TLS-offsets-computation-for-s3.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/prelink-cross/0001-src-rtld-dl-tls.c-Fix-TLS-offsets-computation-for-s3.patch

diff --git a/package/prelink-cross/0001-src-rtld-dl-tls.c-Fix-TLS-offsets-computation-for-s3.patch b/package/prelink-cross/0001-src-rtld-dl-tls.c-Fix-TLS-offsets-computation-for-s3.patch
new file mode 100644
index 000000000000..cea1357d1dbd
--- /dev/null
+++ b/package/prelink-cross/0001-src-rtld-dl-tls.c-Fix-TLS-offsets-computation-for-s3.patch
@@ -0,0 +1,43 @@
+From 4064f77d2f550762cbf220fec7c26a8ce4219ea4 Mon Sep 17 00:00:00 2001
+From: Alexander Egorenkov <egorenar@linux.ibm.com>
+Date: Sun, 8 Aug 2021 11:19:52 +0200
+Subject: [PATCH] src/rtld/dl-tls.c: Fix TLS offsets computation for s390 arch
+
+rtld_determine_tlsoffsets() didn't handle s390 arch properly by falling
+back to the default case. If TLS_TCB_AT_TP is 1, then set offset to -1.
+
+From glibc's sysdeps/s390/nptl/tls.h:
+-------------------------------------
+/* The TCB can have any size and the memory following the address the
+   thread pointer points to is unspecified.  Allocate the TCB there.  */
+define TLS_TCB_AT_TP	1
+define TLS_DTV_AT_TP	0
+
+This lead to the following error:
+---------------------------------
+prelink-rtld: error while loading shared libraries: /lib64/libc.so.6: cannot handle TLS data
+
+Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
+---
+ src/rtld/dl-tls.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/rtld/dl-tls.c b/src/rtld/dl-tls.c
+index 280cee45f950..29422dcfd25e 100644
+--- a/src/rtld/dl-tls.c
++++ b/src/rtld/dl-tls.c
+@@ -143,6 +143,11 @@ rtld_determine_tlsoffsets (int e_machine, struct r_scope_elem *search_list)
+       tls_tcb_size = 0;
+       break;
+ 
++    case EM_S390:
++      tls_tcb_at_tp = 1;
++      tls_tcb_size = -1;
++      break;
++
+     default:
+       /* Hope there's no TLS!  */
+       for (i = 0; i < search_list->r_nlist; i++)
+-- 
+2.31.1
+
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/prelink-cross: fix handling of TLS offsets for s390 arch
  2021-08-08  9:48 [Buildroot] [PATCH 1/1] package/prelink-cross: fix handling of TLS offsets for s390 arch Alexander Egorenkov
@ 2021-08-08 20:39 ` Thomas Petazzoni
  2021-09-04 19:54 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2021-08-08 20:39 UTC (permalink / raw)
  To: Alexander Egorenkov; +Cc: yann.morin.1998, aduskett, buildroot

On Sun,  8 Aug 2021 11:48:44 +0200
Alexander Egorenkov <egorenar@linux.ibm.com> wrote:

> /tmp/instance-1/output-1/host/sbin/prelink-rtld: error while loading
> shared libraries: /lib64/libc.so.6: cannot handle TLS data
> ERROR: can't resolve libraries to shared libraries: glib-2.0, gobject-2.0
> ninja: build stopped: subcommand failed.
> make: *** [package/pkg-generic.mk:270:
> /tmp/instance-1/output-1/build/gobject-introspection-1.68.0/.stamp_built]
> Error 1
> make: Leaving directory '/tmp/instance-1/buildroot'

Thanks a lot for having looked at this problem and submitted a patch. I
have applied, after adjusting a bit the commit log, see below.

> 
> Fixes:
> - http://autobuild.buildroot.org/?reason=gobject-introspection-1.68.0&arch=s390x

This is not a correct way to reference an autobuilder failure. Indeed,
this point to a list of failures, which today are what you are fixing,
but tomorrow? Maybe there will be another s390 failure in
gobject-introspection, which is different. This would cause anybody
look at your commit log and following the link to be very confused. So
we always point to one (or several) specific build failures.

> Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
> ---
>  ...c-Fix-TLS-offsets-computation-for-s3.patch | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 package/prelink-cross/0001-src-rtld-dl-tls.c-Fix-TLS-offsets-computation-for-s3.patch

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/prelink-cross: fix handling of TLS offsets for s390 arch
  2021-08-08  9:48 [Buildroot] [PATCH 1/1] package/prelink-cross: fix handling of TLS offsets for s390 arch Alexander Egorenkov
  2021-08-08 20:39 ` Thomas Petazzoni
@ 2021-09-04 19:54 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2021-09-04 19:54 UTC (permalink / raw)
  To: Alexander Egorenkov
  Cc: aduskett, yann.morin.1998, thomas.petazzoni, buildroot

>>>>> "Alexander" == Alexander Egorenkov <egorenar@linux.ibm.com> writes:

 > /tmp/instance-1/output-1/host/sbin/prelink-rtld: error while loading
 > shared libraries: /lib64/libc.so.6: cannot handle TLS data
 > ERROR: can't resolve libraries to shared libraries: glib-2.0, gobject-2.0
 > ninja: build stopped: subcommand failed.
 > make: *** [package/pkg-generic.mk:270:
 > /tmp/instance-1/output-1/build/gobject-introspection-1.68.0/.stamp_built]
 > Error 1
 > make: Leaving directory '/tmp/instance-1/buildroot'

 > Fixes:
 > - http://autobuild.buildroot.org/?reason=gobject-introspection-1.68.0&arch=s390x

 > Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>

Committed to 2021.02.x and 2021.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-04 19:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-08  9:48 [Buildroot] [PATCH 1/1] package/prelink-cross: fix handling of TLS offsets for s390 arch Alexander Egorenkov
2021-08-08 20:39 ` Thomas Petazzoni
2021-09-04 19:54 ` Peter Korsgaard

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.