maintainer-feedback requested: [Bug 209173] lang/perl5.22: port build has inappropriate use of -Wl,-R/usr/local/lib/perl5/5.22/mach/CORE before the update libperl.so.5.22.2 is there to use
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun May 1 08:35:13 UTC 2016
Mark Millard <markmi at dsl-only.net> has reassigned Bugzilla Automation
<bugzilla at FreeBSD.org>'s request for maintainer-feedback to perl at FreeBSD.org:
Bug 209173: lang/perl5.22: port build has inappropriate use of
-Wl,-R/usr/local/lib/perl5/5.22/mach/CORE before the update libperl.so.5.22.2
is there to use
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209173
--- Description ---
[Mostly take from
https://lists.freebsd.org/pipermail/freebsd-ports/2016-May/103059.html but
simplified/shortened. ]
When building lang/perl5.22 for 5.22.2 . . .
The following happens when /usr/local/lib/perl5/5.22/mach/CORE does not yet
exist or does yet have any libperl.so* files:
--- perl ---
/usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=armv7-a
-mcpu=cortex-a7 -mfloat-abi=softfp -mno-unaligned-access -o perl -lpthread
-Wl,-E -fstack-protector-strong -L/usr/local/lib
-Wl,-R/usr/local/lib/perl5/5.22/mach/CORE perlmain.o libperl.so.5.22.2 `cat
ext.libs` -lpthread -lm -lcrypt -lutil
--- MANIFEST.srt ---
--- extras.make ---
--- MANIFEST.srt ---
Shared object "libperl.so.5.22" not found, required by "perl"
WARNING: re-sorting MANIFEST
Shared object "libperl.so.5.22" not found, required by "perl"
*** [MANIFEST.srt] Error code 1
make[2]: stopped in /usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2
By contrast when /usr/local/lib/perl5/5.22/mach/CORE/libperl.so.5.22.1 is in
place (and libperl.so and libperl.so.5.22 reference it) the following happens:
--- pod/perltoc.pod ---
LD_LIBRARY_PATH=/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl\-5.22.2
./perl -Ilib -f pod/buildtoc -q
pod/buildtoc: Perl lib version (5.22.2) doesn't match executable
'/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/perl' version
(5.22.1) at lib/Config.pm line 62.
Compilation failed in require at lib/locale.pm line 4.
BEGIN failed--compilation aborted at lib/locale.pm line 4.
Compilation failed in require at pod/buildtoc line 10.
BEGIN failed--compilation aborted at pod/buildtoc line 10.
*** [pod/perltoc.pod] Error code 255
make[2]: stopped in /usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2
1 error
This last happens because:
# /usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/perl --version
This is perl 5, version 22, subversion 1 (v5.22.1) built for
powerpc-freebsd-thread-multi
That in turn happened from linking against the wrong libperl.so or
libperl.so.5.22 : an older vintage is linked to.
Both of the above cases trace back to the following sorts of uses of
-Wl,-R/usr/local/lib/perl5/5.22/mach/CORE notation: (from the build's log, note
how "-o perl" uses -Wl,-R so ld will do the -R style of linking):
rm -f libperl.so.5.22.2
/usr/local/bin/gcc49 -o libperl.so.5.22.2 -shared -L/usr/local/lib
-fstack-protector-strong -Wl,-soname,libperl.so.5.22 op.o perl.o gv.o toke.o
perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o
av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o
utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o
mathoms.o locale.o pp_pack.o pp_sort.o caretx.o DynaLoader.o -lpthread -lm
-lcrypt -lutil
/usr/local/bin/gcc49 -o perl -lpthread -Wl,-E -fstack-protector-strong
-L/usr/local/lib -Wl,-R/usr/local/lib/perl5/5.22/mach/CORE perlmain.o
libperl.so.5.22.2 `cat ext.libs` -lpthread -lm -lcrypt -lutil
And were does the -Wl,-R notation come from?:
# find /usr/obj/portswork/usr/ports/lang/perl5.22/ -exec grep Wl,-R {} \;
-print | more
. . . (most are omitted but some interesting ones follow) . . .
-L*|-R*|-Wl,-R*)
xxx="-Wl,-R$shrpdir"
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/Configure.orig
-L*|-R*|-Wl,-R*)
xxx="-Wl,-R$shrpdir"
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/Configure.bak
ccdlflags=' -Wl,-R/usr/local/lib/perl5/5.22/mach/CORE'
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/config.sh
CCDLFLAGS = -Wl,-R/usr/local/lib/perl5/5.22/mach/CORE
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/Makefile
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
-Wl,-R/usr/local/lib/perl5/5.22/mach/CORE'
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/myconfig
CCDLFLAGS = -Wl,-R/usr/local/lib/perl5/5.22/mach/CORE
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/makefile
CCDLFLAGS = -Wl,-R/usr/local/lib/perl5/5.22/mach/CORE
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/makefile.old
For FreeBSD the use of the notation -Wl,-R/usr/local/lib/perl5/5.22/mach/CORE
(as seen in the log file) is also odd for the "does not exist yet" case because
of the dual use of -R in ld for FreeBSD:
if the -R option is
followed by a directory name, rather than a file name, it is
treated as the -rpath option
So which interpretation does -R get when /usr/local/lib/perl5/5.22/mach/CORE
does not exist yet because 5.22 has yet to even be created in /usr/local/. . .?
/usr/local/lib/perl5/5.22/mach/CORE is then neither a directory nor a named
file that can supply symbols.
/usr/local/lib/perl5/5.22/mach/CORE will not have appropriate material to use
until some point during the install step: not even the staging step is enough
context for that path to find the right vintage of files. During the build's
linking it is too early to be using -Wl,-R/usr/local/lib/perl5/5.22/mach/CORE .
More information about the freebsd-perl
mailing list