Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 May 2016 08:35:12 +0000
From:      bugzilla-noreply@freebsd.org
To:        perl@FreeBSD.org
Subject:   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
Message-ID:  <bug-209173-14331-bpFuqYyonN@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-209173-14331@https.bugs.freebsd.org/bugzilla/>
References:  <bug-209173-14331@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Mark Millard <markmi@dsl-only.net> has reassigned Bugzilla Automation
<bugzilla@FreeBSD.org>'s request for maintainer-feedback to perl@FreeBSD.or=
g:
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=3D209173



--- 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=3Darmv7-a
-mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-access -o perl -lpthr=
ead
-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 happe=
ns:

--- pod/perltoc.pod ---
LD_LIBRARY_PATH=3D/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl\-5.2=
2.2=20
./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 h=
v.o
av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regex=
ec.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=20
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=3D"-Wl,-R$shrpdir"
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/Configure.orig
	       -L*|-R*|-Wl,-R*)
	       xxx=3D"-Wl,-R$shrpdir"
/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl-5.22.2/Configure.bak
ccdlflags=3D'  -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 =3D   -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=3Ddl_dlopen.xs, dlext=3Dso, d_dlsymun=3Dundef, ccdlflags=3D'=20
-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 =3D   -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 =3D   -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/CO=
RE
(as seen in the log file) is also odd for the "does not exist yet" case bec=
ause
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 u=
se
until some point during the install step: not even the staging step is enou=
gh
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/CO=
RE .



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-209173-14331-bpFuqYyonN>