From: Jarkko Hietaniemi Date: Sun, 25 Nov 2001 05:32:18 +0000 (+0000) Subject: Revert the /proc/self/auxv experiment for now. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8338e36774b7e3cc49c6f8e0553b2f22973bc322;p=p5sagit%2Fp5-mst-13.2.git Revert the /proc/self/auxv experiment for now. p4raw-id: //depot/perl@13257 --- diff --git a/lib/ExtUtils.t b/lib/ExtUtils.t index 59cb978..24d85d3 100644 --- a/lib/ExtUtils.t +++ b/lib/ExtUtils.t @@ -14,8 +14,7 @@ use ExtUtils::Constant qw (constant_types C_constant XS_constant autoload); use Config; use File::Spec::Functions qw(catfile rel2abs); # Because were are going to be changing directory before running Makefile.PL -my $perl = $^X; -print "# perl=$perl\n"; +my $perl; $perl = rel2abs( $^X ) unless $] < 5.006; # Hack. Until 5.00503 has rel2abs # ExtUtils::Constant::C_constant uses $^X inside a comment, and we want to # compare output to ensure that it is the same. We were probably run as ./perl @@ -25,7 +24,6 @@ $^X = $perl; print "# perl=$perl\n"; my $runperl = "$perl -x \"-I../../lib\""; -print "# runperl=$runperl\n"; $| = 1; @@ -464,10 +462,6 @@ $test++; my $expect = $constant_types . $C_constant . "\n#### XS Section:\n" . $XS_constant; -# Depending on whether $^X resolves symbolic links -# or not we may have ".../perl" or ".../t/perl". -$regen =~ s/\#!.+perl -w$/#!$perl -w/m; - if ($expect eq $regen) { print "ok $test\n"; } else { diff --git a/perl.c b/perl.c index 54f68c7..8b3066e 100644 --- a/perl.c +++ b/perl.c @@ -3415,7 +3415,7 @@ Perl_init_argv_symbols(pTHX_ register int argc, register char **argv) #ifdef HAS_PROCSELFEXE /* This is a function so that we don't hold on to MAXPATHLEN - bytes of stack longer than necessary. + bytes of stack longer than necessary */ STATIC void S_procself_val(pTHX_ SV *sv, char *arg0) @@ -3431,47 +3431,6 @@ S_procself_val(pTHX_ SV *sv, char *arg0) } #endif /* HAS_PROCSELFEXE */ -#if defined(sun) && defined(__svr4__) /* solaris */ -#include -STATIC void -S_procselfauxv(pTHX_ SV *sv, char *arg0) { - auxv_t auxv; - int fh; - int n; - - fh = open("/proc/self/auxv", O_RDONLY); - if (fh < 0) { - sv_setpv(sv, arg0); - return; - } - - while (1) { - n = read(fh, &auxv, sizeof(auxv)); - if (n != sizeof(auxv)) - break; - if (auxv.a_type == AT_SUN_EXECNAME) { - close(fh); - sv_setpv(sv, auxv.a_un.a_ptr); - if (!strchr(SvPVX(sv), '/')) { - /* If no slash at all, probably started as "./perl" - * Do not compare against "perl", though, since the - * binary might be called something else. */ - STRLEN len; - char *s = SvPV(sv, len); - SvGROW(sv, len + 2); - memmove(s + 2, s, len); - SvPVX(sv)[0] = '.'; - SvPVX(sv)[1] = '/'; - SvCUR(sv) += 2; - } - return; - } - } - close(fh); - sv_setpv(sv, arg0); -} -#endif /* solaris */ - STATIC void S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register char **env) { @@ -3508,15 +3467,11 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register #ifdef HAS_PROCSELFEXE S_procself_val(aTHX_ GvSV(tmpgv), PL_origargv[0]); #else -# ifdef OS2 +#ifdef OS2 sv_setpv(GvSV(tmpgv), os2_execname(aTHX)); -# else -# if defined(sun) && defined(__svr4__) /* solaris */ - S_procselfauxv(aTHX_ GvSV(tmpgv), PL_origargv[0]); -# else - sv_setpv(GvSV(tmpgv), PL_origargv[0]); -# endif -# endif +#else + sv_setpv(GvSV(tmpgv),PL_origargv[0]); +#endif #endif } if ((PL_envgv = gv_fetchpv("ENV",TRUE, SVt_PVHV))) { diff --git a/t/lib/1_compile.t b/t/lib/1_compile.t index af2c168..51d4d6a 100644 --- a/t/lib/1_compile.t +++ b/t/lib/1_compile.t @@ -1,13 +1,7 @@ #!./perl BEGIN { - if (-d '../pod' && -d '../t') { - require File::Spec; - my ($v,$d,$f) = File::Spec->splitpath($^X); - $^X = File::Spec->catfile(File::Spec->curdir, $f) - if $^X eq File::Spec->catfile(File::Spec->updir, $f); - chdir '..'; - } + chdir '..' if -d '../pod' && -d '../t'; @INC = 'lib'; }