develooper Front page | perl.perl5.porters | Postings from June 2019

Re: [perl #134218] dtrace build of perl-5.30.0 uses undefined$(ECHO)

Thread Next
From:
Tim Mooney
Date:
June 21, 2019 20:56
Subject:
Re: [perl #134218] dtrace build of perl-5.30.0 uses undefined$(ECHO)
Message ID:
alpine.SOC.2.20.1906211535160.4489@dogbert.cc.ndsu.NoDak.edu
In regard to: [perl #134218] dtrace build of perl-5.30.0 uses undefined...:

> On Fri, 21 Jun 2019 19:55:57 GMT, enchanter wrote:
>>
>> This is a bug report for perl from tim.mooney@ndsu.edu,
>> generated with the help of perlbug 1.40 running under perl 5.22.4.
>>
>>
>> -----------------------------------------------------------------
>> [Please describe your issue here]
>>
>> Hi!
>>
>> I'm using perlbug from 5.22.4, but I'm attempting to build perl 5.30.0
>> on OpenIndiana, one of the Illumos (formerly OpenSolaris)
>> distributions.
>>
>
> Can you supply the full ./Configure command you used to configure this perl?

     /export/home/mooney/oi-userland/components/perl/perl-530/perl-5.30.0/Configure -de -Dmksymlinks -Ulocincpth= -Uloclibpth= -Dbin=/usr/perl5/5.30/bin -Dcc="/usr/gcc/6/bin/gcc -m64" -Dcf_email="oi-dev@openindiana.org" -Dcf_by="perl-bugs" -Dlibperl=libperl.so -Dmyhostname="localhost" -Dprefix=/usr/perl5/5.30 -Dprivlib=/usr/perl5/5.30/lib -Dsitelib=/usr/perl5/site_perl/5.30 -Dsiteprefix=/usr/perl5/5.30 -Dvendorlib=/usr/perl5/vendor_perl/5.30 -Dvendorprefix=/usr/perl5/5.30 -Duse64bitall -Duseshrplib -Dusedtrace -Dusethreads -Dlibpth="/lib/64 /usr/lib/64")


I'm actually building 5.30.0 using the same recipe that the packaged perl
for OI uses, just updated for 5.30.0.  It's part of 'oi-userland', and
you can find the whole thing here:

 	https://github.com/OpenIndiana/oi-userland

and the older perl-522 and perl-524 packages are generated using the
Makefiles in here:

 	https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/perl/perl-522
 	https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/perl/perl-524


>> ----
>>
>> LD_LIBRARY_PATH=/export/home/mooney/oi-userland/components/perl/perl-
>> 530/build/amd64 ./miniperl -Ilib -MExtUtils::Miniperl -e
>> 'writemain(\"perlmain.c", @ARGV)' DynaLoader
>> /usr/gcc/6/bin/gcc -m64 -c -DPERL_CORE -D_REENTRANT -m64 -fwrapv -fno-
>> strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE64_SOURCE
>> -D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV -O -Wall
>> -Werror=declaration-after-statement -Werror=pointer-arith -Wextra
>> -Wc++-compat -Wwrite-strings -fPIC perlmain.c
>> rm -rf maindtrace
>> mkdir maindtrace
>> cp perlmain.o maindtrace/
>> /usr/sbin/dtrace -xnolibs -G -s perldtrace.d -o dtrace_main.o
>> maindtrace/perlmain.o ||        \
>>  (  "No probes in perlmain.o, generating a dummy dtrace_main.o    " &&
>> \
>>> dtrace_main.c &&                                \
>> `sh  cflags "optimize='-O'" dtrace_main.o` -fPIC dtrace_main.c &&
>> \
>>  rm -f dtrace_main.c )
>> dtrace: failed to link script perldtrace.d: No probe sites found for
>> declared provider
>> /bin/sh[2]: No probes in perlmain.o, generating a dummy dtrace_main.o
>> : not found [No such file or directory]
>> make[1]: *** [makefile:368: dtrace_main.o] Error 127
>>
>>
>> ----
>>
>> If you examine that output closely, you'll see that there's no echo or
>> printf before the "No probes in perlmain.o..." string.
>>
>> Tracing this back to the "Makefile", it's coming from this section of
>> code in the generated Makefile:
>>
>>
>> ----
>>
>> $(DTRACE_MAIN_O): perldtrace.d perlmain$(OBJ_EXT)
>>         -rm -rf maindtrace
>>         mkdir maindtrace
>>         cp perlmain$(OBJ_EXT) maindtrace/
>>         $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O)
>> $(perlmain_dtrace_objs) ||           \
>>           ( $(ECHO) "No probes in perlmain$(OBJ_EXT), generating a
>> dummy $(DTRACE_MAIN_O)" && \
>>             $(ECHO) >dtrace_main.c &&
>> \
>>             `$(CCCMD)` $(PLDLFLAGS) dtrace_main.c &&
>> \
>>              rm -f dtrace_main.c )
>>
>> ----
>>
>> As you can see, the Makefile has $(ECHO) in a couple of places, but
>> it's
>> not actually defined anywhere in the generated Makefile, so it's
>> coming
>> up empty when the Makefile is run, and triggering the issue.
>>
>> The fix is straightforward.  In Makefile.SH, in the section where
>> other
>> settings like CC, LD, CPS, RMS, etc. are set, we just need a
>>
>> ECHO = $echo
>>
>> $echo *is* being set by Configure and added to config.sh, it's just
>> that
>> Makefile.SH and hence Makefile are using $(ECHO) in one and only one
>> place: the dtrace probes.
>>
>> If you agree this is the right fix, I can submit the trivial patch to
>> fix it.
>>
>> Thanks,
>>
>> Tim
>>
>>
>
> I don't have any Solaris available -- we could really use some smoke-testers on those systems -- but I do have FreeBSD with dtrace.

FreeBSD uses the other branch of the ||, based on my reading of the
comments in the 5.26.2 delta, so I'm moderately certain it's only Solaris
and Solaris-like systems that are going to trigger the code path that
wants $(ECHO).

If you visually inspect Makefile.SH , though, you'll see that it's used
without ever being defined earlier.

Thanks,

Tim
-- 
Tim Mooney                                             Tim.Mooney@ndsu.edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, Quentin Burdick Building                  701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About