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
After https://cgit.freebsd.org/src/commit/?id=be39466a1035, there is no
need anymore to patch the perl5 Makefiles to add
"-Wl,--allow-multiple-definition" to the linker flags. They should now
link with lld 15 and later without any issues.
PR: 265516
Fixes: 8c69fc20e6
MFH: 2022Q4
Modify the workaround committed in 4ae8ff941b by only adding
-Wl,--allow-multiple-definition to the two link command lines that
require it, instead of adding it to hints/freebsd.sh
Otherwise, that linker flag is emitted into perl's global configuration
(/usr/local/lib/perl5/5.xx/mach/Config_heavy.pl), and might be used by
other ports which link in libperl, such as www/mod_perl2, which cannot
correctly handle any unexpected linker flags, leading to errors.
PR: 265516
Reported by: lev
Approved by: maintainer timeout (1 month)
Fixes: 4ae8ff941b
MFH: 2022Q3
Building any of the lang/perl5* ports with clang and lld 15, and the
DTRACE option enabled (which is default on) results in link errors
similar to:
cc -pthread -Wl,-E -fstack-protector-strong -L/usr/local/lib -o miniperl mpdtrace/opmini.o mpdtrace/perlmini.o mpdtrace/universalmini.o mpdtrace/gv.o mpdtrace/toke.o mpdtrace/perly.o mpdtrace/pad.o mpdtrace/regcomp.o mpdtrace/dump.o mpdtrace/util.o mpdtrace/mg.o mpdtrace/reentr.o mpdtrace/mro_core.o mpdtrace/keywords.o mpdtrace/builtin.o mpdtrace/hv.o mpdtrace/av.o mpdtrace/run.o mpdtrace/pp_hot.o mpdtrace/sv.o mpdtrace/pp.o mpdtrace/scope.o mpdtrace/pp_ctl.o mpdtrace/pp_sys.o mpdtrace/doop.o mpdtrace/doio.o mpdtrace/regexec.o mpdtrace/utf8.o mpdtrace/taint.o mpdtrace/deb.o mpdtrace/globals.o mpdtrace/perlio.o mpdtrace/numeric.o mpdtrace/mathoms.o mpdtrace/locale.o mpdtrace/pp_pack.o mpdtrace/pp_sort.o mpdtrace/caretx.o mpdtrace/dquote.o mpdtrace/time64.o mpdtrace/miniperlmain.o dtrace_mini.o -lpthread -lm -lcrypt -lutil
ld: error: duplicate symbol: __dtraceenabled_perl___sub__entry
>>> defined in mpdtrace/pp_hot.o
>>> defined in mpdtrace/pp_sort.o
ld: error: duplicate symbol: __dtraceenabled_perl___sub__entry
>>> defined in mpdtrace/pp_hot.o
>>> defined in mpdtrace/regexec.o
ld: error: duplicate symbol: __dtraceenabled_perl___op__entry
>>> defined in mpdtrace/perlmini.o
>>> defined in mpdtrace/run.o
ld: error: duplicate symbol: __dtraceenabled_perl___op__entry
>>> defined in mpdtrace/perlmini.o
>>> defined in mpdtrace/dump.o
ld: error: duplicate symbol: __dtraceenabled_perl___sub__entry
>>> defined in mpdtrace/pp_hot.o
>>> defined in mpdtrace/pp_ctl.o
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Work around these errors by allowing multiple definitions during
linking, using the --allow-multiple-definition linker flag. (Note: this
flag is also supported by GNU ld.)
PR: 265516
Approved by: maintainer timeout (1 month)
MFH: 2022Q3
Commit b7f05445c0 has added WWW entries to port Makefiles based on
WWW: lines in pkg-descr files.
This commit removes the WWW: lines of moved-over URLs from these
pkg-descr files.
Approved by: portmgr (tcberner)
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.
Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.
There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.
This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.
There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.
The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.
Approved by: portmgr (tcberner)