commit:     62add71b9ab7a444189d80e00a8eaca179cd1c85
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 28 00:54:17 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 28 00:56:42 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elt-patches.git/commit/?id=62add71b

patches: add cxx-pthread

Bug: https://bugs.gentoo.org/650876
Bug: https://debbugs.gnu.org/15646
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eltpatch.in               |  2 +-
 patches/cxx-pthread/2.4.6 | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/eltpatch.in b/eltpatch.in
index e3842bd..1e6920d 100644
--- a/eltpatch.in
+++ b/eltpatch.in
@@ -129,7 +129,7 @@ elibtoolize() {
        local force="false"
        local elt_patches="
                install-sh ltmain portage relink max_cmd_len sed test tmp cross 
as-needed target-nm ppc64le
-               specs fsanitize fuse-ld static-flags werror
+               specs fsanitize fuse-ld static-flags werror cxx-pthread
        "
 
        for x in "$@" ; do

diff --git a/patches/cxx-pthread/2.4.6 b/patches/cxx-pthread/2.4.6
new file mode 100644
index 0000000..a57f58e
--- /dev/null
+++ b/patches/cxx-pthread/2.4.6
@@ -0,0 +1,38 @@
+http://permalink.gmane.org/gmane.comp.gnu.libtool.patches/11704
+https://bugs.gentoo.org/650876
+
+From: Pavel Raiskup <praiskup <at> redhat.com>
+Subject: [PATCH] libtool: handle the -pthread{,s} options for g++
+Newsgroups: gmane.comp.gnu.libtool.patches
+Date: Thursday 28th November 2013 14:18:05 UTC (over 4 years ago)
+
+As we are forced to pass -nostdlib to g++ for linking, this option
+expectedly disables the effectiveness of passed -pthread flag - so
+add the -lpthread explicitly to $deplibs to link correctly.
+
+References:
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
+https://bugzilla.redhat.com/show_bug.cgi?id=661333
+http://lists.gnu.org/archive/html/bug-libtool/2013-01/msg00018.htm
+
+* build-aux/ltmain.in (func_mode_link): Explicitly add -lpthread
+flag into $deplibs when -pthread is passed (for g++ only).
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -7127,6 +7127,16 @@
+           *" $arg "*) ;;
+           * ) func_append new_inherited_linker_flags " $arg" ;;
+       esac
++
++      # As we are forced to pass -nostdlib to g++ during linking, the option
++      # -pthread{,s} is not in effect;  add the -lpthread to $deplist
++      # explicitly to link correctly.
++      if test "$tagname" = CXX -a x"$with_gcc" = xyes; then
++        case "$arg" in
++          -pthread*) func_append deplibs " -lpthread" ;;
++        esac
++      fi
++
+       continue
+       ;;
+ 

Reply via email to