diff options
author | Tijl Coosemans <tijl@FreeBSD.org> | 2023-07-04 16:22:05 +0200 |
---|---|---|
committer | Tijl Coosemans <tijl@FreeBSD.org> | 2023-07-11 22:10:58 +0200 |
commit | 0b59b9276418ce4fce8a73871a13598397ab2f2e (patch) | |
tree | 697ac479c7cefec1e718cab91938acffbe84fc6c /lang/perl5-devel/files | |
parent | print/cups: Use upstream release tarball (diff) |
lang/perl5*: Link with -pthread instead of -lpthread
During configure of security/p5-Crypt-GCrypt a test program is
compiled and run to test libgcrypt. This program segfaults when perl5
is built with the THREADS option. Libgcrypt links with libgpg-error
which has an init function which calls into libintl (gettext) which
calls pthread functions before libthr is initialised.
The compiler command line is provided by perl and it includes both
-pthread and -lpthread. Patch perl to remove -lpthread. With -pthread
the compiler will pass -lpthread to the linker such that it is
initialised early.
Discovered by the exp-run for gettext 0.22.
While here also remove -lc unconditionally and remove the code that
replaced it with -lc_r for old version of FreeBSD because the version
test is incorrect (missing a dot). The -pthread flag already tells
the compiler to use -lc_r on those old versions.
PR: 272210
Diffstat (limited to 'lang/perl5-devel/files')
-rw-r--r-- | lang/perl5-devel/files/patch-hints_freebsd.sh | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/lang/perl5-devel/files/patch-hints_freebsd.sh b/lang/perl5-devel/files/patch-hints_freebsd.sh index 9907c745ded7..966f04d1262a 100644 --- a/lang/perl5-devel/files/patch-hints_freebsd.sh +++ b/lang/perl5-devel/files/patch-hints_freebsd.sh @@ -1,24 +1,47 @@ Remove libs that are not here on FreeBSD. ---- hints/freebsd.sh.orig 2022-06-19 19:29:35 UTC +--- hints/freebsd.sh.orig 2020-12-18 09:58:48 UTC +++ hints/freebsd.sh -@@ -88,6 +88,8 @@ case "$osvers" in +@@ -88,8 +88,6 @@ case "$osvers" in esac libswanted=`echo $libswanted | sed 's/ malloc / /'` libswanted=`echo $libswanted | sed 's/ bind / /'` -+ libswanted=`echo $libswanted | sed 's/ dl / /'` -+ libswanted=`echo $libswanted | sed 's/ c / /'` - # iconv gone in Perl 5.8.1, but if someone compiles 5.8.0 or earlier. - libswanted=`echo $libswanted | sed 's/ iconv / /'` +- # iconv gone in Perl 5.8.1, but if someone compiles 5.8.0 or earlier. +- libswanted=`echo $libswanted | sed 's/ iconv / /'` d_setregid='define' -@@ -102,6 +104,10 @@ case "$osvers" in + d_setreuid='define' + d_setegid='define' +@@ -102,8 +100,13 @@ case "$osvers" in ;; esac libswanted=`echo $libswanted | sed 's/ malloc / /'` + libswanted=`echo $libswanted | sed 's/ bind / /'` -+ libswanted=`echo $libswanted | sed 's/ dl / /'` -+ libswanted=`echo $libswanted | sed 's/ iconv / /'` -+ libswanted=`echo $libswanted | sed 's/ c / /'` ;; esac ++libswanted=`echo $libswanted | sed 's/ c / /'` ++# Use -pthread so the compiler adds -lpthread at the right place on the ++# linker command line so its init functions run early. ++libswanted=`echo $libswanted | sed 's/ pthread / /'` + case "$osvers" in + 10.*) +@@ -269,19 +272,6 @@ EOM + + esac + +- case "$osvers" in +- [1-4]*) +- set `echo X "$libswanted "| sed -e 's/ c / c_r /'` +- shift +- libswanted="$*" +- ;; +- *) +- set `echo X "$libswanted "| sed -e 's/ c //'` +- shift +- libswanted="$*" +- ;; +- esac +- + # Configure will probably pick the wrong libc to use for nm scan. + # The safest quick-fix is just to not use nm at all... + usenm=false |