[Bug 265516] lang/perl5*: work around duplicate symbol errors with dtrace enabled

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 30 Jul 2022 13:15:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265516

            Bug ID: 265516
           Summary: lang/perl5*: work around duplicate symbol errors with
                    dtrace enabled
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: mat@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(mat@FreeBSD.org)
          Assignee: mat@FreeBSD.org

During an exp-run for llvm 15 (see bug 265425), it turned out that
lang/perl5.32, lang/perl5.34, lang/perl5.36 and lang/perl5-devel fail to build
with clang and lld 15:

cc -pthread -Wl,-E  -fstack-protector-strong -L/usr/local/lib -o miniperl 
mpdtrace/opmini.o mpdtrace/perlmini.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/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/universal.o mpdtrace/globals.o mpdtrace/perlio.o mpdtrace/perlapi.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___op__entry
>>> defined in mpdtrace/perlmini.o
>>> defined in mpdtrace/dump.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___sub__entry
>>> defined in mpdtrace/pp_hot.o
>>> defined in mpdtrace/pp_ctl.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___sub__entry
>>> defined in mpdtrace/pp_hot.o
>>> defined in mpdtrace/pp_sort.o
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

This error pops up in more bug reports, for instance bug 258872 and bug 260947.

It seems that dtrace does something to the object files produced during the
build, if the DTRACE option is enabled (which it is by default). Whatever it
does, it causes these multiply defined symbols, which only appear to occur in
certain (as of yet) undetermined circumstances.

I would like to get the ports going again by working around these link errors,
using the --allow-multiple-definition linker flag, which is supported by both
GN ld and lld.

-- 
You are receiving this mail because:
You are the assignee for the bug.