Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
@ 2022-03-20  9:48 sgn
  2022-03-20 12:08 ` leahneukirchen
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: sgn @ 2022-03-20  9:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages glibc-libpthread
https://github.com/void-linux/void-packages/pull/36239

[RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36239.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-glibc-libpthread-36239.patch --]
[-- Type: text/x-diff, Size: 4018 bytes --]

From 2ca8434c0dbbc698823ff74e96739c7164112c6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 20 Mar 2022 16:29:53 +0700
Subject: [PATCH 1/2] hooks/gen-runtime-deps: convert element check to
 case...esac

This change was made in the hope of finding a needle in a haystack
could be faster than tokenizing and loop with for.

However, the ultimate goal is easier to integrate a later change to
add implicit sh-requires on libgcc_s.so.1 when libpthread.so.0 is
required since libpthread.so.0 always dlopen(2) libgcc_s.so.1,
and libpthread.so.0 will go ahead to crash the program, should it fail
to do so.
---
 common/hooks/pre-pkg/04-generate-runtime-deps.sh | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index c8f8c04d4884..da0ac7754902 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -75,12 +75,13 @@ hook() {
         read -n4 elfmagic < "$f"
         if [ "$elfmagic" = $'\177ELF' ]; then
             for nlib in $($OBJDUMP -p "$f"|awk '/NEEDED/{print $2}'); do
-                [ -z "$verify_deps" ] && verify_deps="$nlib" && continue
-                found=0
-                for j in ${verify_deps}; do
-                    [[ $j == $nlib ]] && found=1 && break
-                done
-                [[ $found -eq 0 ]] && verify_deps="$verify_deps $nlib"
+                case " $verify_deps " in
+                    *" $nlib "*)
+                        ;;
+                    *)
+                        verify_deps="$verify_deps $nlib"
+                        ;;
+                esac
             done
         fi
     done

From 71478956740ba94d02a7ea4b98417f0d7ce81376 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 20 Mar 2022 16:38:00 +0700
Subject: [PATCH 2/2] hooks/gen-runtime-deps: require libgcc_s.so.1 for
 libpthread.so.0

libpthread.so.0 dlopen(2) libgcc_s.so.1 on startup.
Should the former fails to dlopen(2) the latter, it will proceed to
crash the program.

Let's add libgcc_s.so.1 to sh-requires list whenever libpthread.so.0 is
required.

While doing so, don't add it to sh-requires list when $sourcepkg is
glibc, in order to prevent circular dependencies between glibc and
libgcc.

Fix: #36004
---
 common/hooks/pre-pkg/04-generate-runtime-deps.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index da0ac7754902..2fb9dc34b9e3 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -48,6 +48,7 @@ store_pkgdestdir_rundeps() {
 
 hook() {
     local depsftmp f lf j mapshlibs sorequires _curdep elfmagic
+    local needpthread=
 
     # Disable trap on ERR, xbps-uhelper cmd might return error... but not something
     # to be worried about because if there are broken shlibs this hook returns
@@ -80,6 +81,9 @@ hook() {
                         ;;
                     *)
                         verify_deps="$verify_deps $nlib"
+                        if [ "$nlib" = libpthread.so.0 ]; then
+                            needpthread=y
+                        fi
                         ;;
                 esac
             done
@@ -88,6 +92,12 @@ hook() {
     exec 0<&3 # restore stdin
     rm -f $depsftmp
 
+    # libpthread.so.0 dlopen(2) libgcc_s.so.1 and will abort if fail to do so
+    # Don't make glibc depends on libgcc to prevent circular dependencies.
+    if [ "$needpthread" ] && [ "$sourcepkg" != glibc ] ; then
+        verify_deps="$verify_deps libgcc_s.so.1"
+    fi
+
     #
     # Add required run time packages by using required shlibs resolved
     # above, the mapping is done thru the common/shlibs file.

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
@ 2022-03-20 12:08 ` leahneukirchen
  2022-03-21  2:51 ` sgn
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: leahneukirchen @ 2022-03-20 12:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1073237180

Comment:
sgtm, another option would be glibc depending on libgcc?

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
  2022-03-20 12:08 ` leahneukirchen
@ 2022-03-21  2:51 ` sgn
  2022-03-21  5:51 ` q66
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: sgn @ 2022-03-21  2:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1073431351

Comment:
On 2022-03-20 05:08:24-0700, Leah Neukirchen ***@***.***> wrote:
> another option would be glibc depending on libgcc?

It will make a circular dependencies, libgcc depends on glic already.

-- 
Danh


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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
  2022-03-20 12:08 ` leahneukirchen
  2022-03-21  2:51 ` sgn
@ 2022-03-21  5:51 ` q66
  2022-03-21 20:23 ` leahneukirchen
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: q66 @ 2022-03-21  5:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1073506563

Comment:
xbps should handle circular dependencies just fine 

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (2 preceding siblings ...)
  2022-03-21  5:51 ` q66
@ 2022-03-21 20:23 ` leahneukirchen
  2022-03-21 20:56 ` q66
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: leahneukirchen @ 2022-03-21 20:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1074382850

Comment:
I don't see libgcc depending on glibc?

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (3 preceding siblings ...)
  2022-03-21 20:23 ` leahneukirchen
@ 2022-03-21 20:56 ` q66
  2022-03-24 14:44 ` sgn
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: q66 @ 2022-03-21 20:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1074409515

Comment:
it depends on it through shlibs

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (4 preceding siblings ...)
  2022-03-21 20:56 ` q66
@ 2022-03-24 14:44 ` sgn
  2022-04-03 11:14 ` sgn
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: sgn @ 2022-03-24 14:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1077705731

Comment:
> xbps should handle circular dependencies just fine

But, it would be a problem during bootstrap?

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (5 preceding siblings ...)
  2022-03-24 14:44 ` sgn
@ 2022-04-03 11:14 ` sgn
  2022-04-03 14:02 ` q66
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: sgn @ 2022-04-03 11:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1086840547

Comment:
I will merge this as-is tomorrow if no-one objects.

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (6 preceding siblings ...)
  2022-04-03 11:14 ` sgn
@ 2022-04-03 14:02 ` q66
  2022-04-13 19:43 ` Chocimier
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: q66 @ 2022-04-03 14:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1086875916

Comment:
i already objected, this shouldn't be needed

make glibc depend on libgcc instead

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (7 preceding siblings ...)
  2022-04-03 14:02 ` q66
@ 2022-04-13 19:43 ` Chocimier
  2022-04-14  0:32 ` q66
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Chocimier @ 2022-04-13 19:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1098416240

Comment:
> make glibc depend on libgcc instead

Can you be more specific instead of what? Adding `depends="libgcc"` at glibc template will create build-time cycle.

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (8 preceding siblings ...)
  2022-04-13 19:43 ` Chocimier
@ 2022-04-14  0:32 ` q66
  2022-07-13  2:15 ` github-actions
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: q66 @ 2022-04-14  0:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1098598604

Comment:
just special-case it in some hook (for example the same one as this one is modifying), then there is nothing for xbps-src to complain about...

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (9 preceding siblings ...)
  2022-04-14  0:32 ` q66
@ 2022-07-13  2:15 ` github-actions
  2022-07-17 20:13 ` ericonr
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: github-actions @ 2022-07-13  2:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1182688816

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (10 preceding siblings ...)
  2022-07-13  2:15 ` github-actions
@ 2022-07-17 20:13 ` ericonr
  2022-07-17 20:13 ` ericonr
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ericonr @ 2022-07-17 20:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1186599900

Comment:
The advantage of adding the dependency to glibc is that we don't need to rebuild so many libraries.

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (11 preceding siblings ...)
  2022-07-17 20:13 ` ericonr
@ 2022-07-17 20:13 ` ericonr
  2022-10-16  2:14 ` github-actions
  2022-10-31  2:14 ` [PR PATCH] [Closed]: " github-actions
  14 siblings, 0 replies; 16+ messages in thread
From: ericonr @ 2022-07-17 20:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1186599900

Comment:
The advantage of adding the dependency to glibc is that we don't need to rebuild so many packages.

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

* Re: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (12 preceding siblings ...)
  2022-07-17 20:13 ` ericonr
@ 2022-10-16  2:14 ` github-actions
  2022-10-31  2:14 ` [PR PATCH] [Closed]: " github-actions
  14 siblings, 0 replies; 16+ messages in thread
From: github-actions @ 2022-10-16  2:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/36239#issuecomment-1279872847

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

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

* Re: [PR PATCH] [Closed]: [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
  2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
                   ` (13 preceding siblings ...)
  2022-10-16  2:14 ` github-actions
@ 2022-10-31  2:14 ` github-actions
  14 siblings, 0 replies; 16+ messages in thread
From: github-actions @ 2022-10-31  2:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

There's a closed pull request on the void-packages repository

[RFC] requires libgcc_s.so.1 when libpthread.so.0 is required
https://github.com/void-linux/void-packages/pull/36239

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

end of thread, other threads:[~2022-10-31  2:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-20  9:48 [PR PATCH] [RFC] requires libgcc_s.so.1 when libpthread.so.0 is required sgn
2022-03-20 12:08 ` leahneukirchen
2022-03-21  2:51 ` sgn
2022-03-21  5:51 ` q66
2022-03-21 20:23 ` leahneukirchen
2022-03-21 20:56 ` q66
2022-03-24 14:44 ` sgn
2022-04-03 11:14 ` sgn
2022-04-03 14:02 ` q66
2022-04-13 19:43 ` Chocimier
2022-04-14  0:32 ` q66
2022-07-13  2:15 ` github-actions
2022-07-17 20:13 ` ericonr
2022-07-17 20:13 ` ericonr
2022-10-16  2:14 ` github-actions
2022-10-31  2:14 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).