Skip to content

[PATCH] Make sitecustomize relocatableinc aware #11761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
p5pRT opened this issue Nov 20, 2011 · 9 comments
Closed

[PATCH] Make sitecustomize relocatableinc aware #11761

p5pRT opened this issue Nov 20, 2011 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 20, 2011

Migrated from rt.perl.org#104112 (status was 'resolved')

Searchable as RT104112$

@p5pRT
Copy link
Author

p5pRT commented Nov 20, 2011

From [email protected]

This is a bug report for perl from hayter@​usc.edu,
generated with the help of perlbug 1.39 running under perl 5.15.5.

From 94faaffd8a8d1bc17ec9c91351a4b26f676b0f8e Mon Sep 17 00​:00​:00 2001
From​: Carl Hayter <hayter@​usc.edu>
Date​: Sun, 20 Nov 2011 12​:38​:15 -0800
Subject​: [PATCH] Make sitecustomize relocatableinc aware

When -Dusesitecustomize is used with -Duserelocatableinc,
SITELIB_EXP/sitecustomize.pl is not found due to SITELIB_EXP having a
'.../..' relocation path.

This patch refactors the path relocation code from S_incpush() into
S_mayberelocate() so that it can be used in both S_incpush() and in
usesitecustomize's use of SITELIB_EXP.


AUTHORS | 1 +
embed.fnc | 2 +
embed.h | 1 +
perl.c | 102 +++++++++++++++++++++++++++++++++++++------------------------
proto.h | 5 +++
5 files changed, 71 insertions(+), 40 deletions(-)

Inline Patch
diff --git a/AUTHORS b/AUTHORS
index d0707b4..dd90b3f 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -174,6 +174,7 @@ Calle Dybedahl			<[email protected]>
 Campo Weijerman			<[email protected]>
 Carl Eklof			<[email protected]>
 Carl M. Fongheiser		<[email protected]>
+Carl Hayter	            <[email protected]>
 Carl Witty			<[email protected]>
 Cary D. Renzema			<[email protected]>
 Casey R. Tweten			<[email protected]>
diff --git a/embed.fnc b/embed.fnc
index 6b22a3e..f4c9f43 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1731,6 +1731,8 @@ s	|void	|find_beginning	|NN SV* linestr_sv|NN PerlIO *rsfp
 s	|void	|forbid_setid	|const char flag|const bool suidscript
 s	|void	|incpush	|NN const char *const dir|STRLEN len \
 				|U32 flags
+s	|SV*	|mayberelocate	|NN const char *const dir|STRLEN len \
+				|U32 flags
 s	|void	|incpush_use_sep|NN const char *p|STRLEN len|U32 flags
 s	|void	|init_interp
 s	|void	|init_ids
diff --git a/embed.h b/embed.h
index d8d2776..fe93de0 100644
--- a/embed.h
+++ b/embed.h
@@ -1411,6 +1411,7 @@
 #define init_perllib()		S_init_perllib(aTHX)
 #define init_postdump_symbols(a,b,c)	S_init_postdump_symbols(aTHX_ a,b,c)
 #define init_predump_symbols()	S_init_predump_symbols(aTHX)
+#define mayberelocate(a,b,c)	S_mayberelocate(aTHX_ a,b,c)
 #define my_exit_jump()		S_my_exit_jump(aTHX)
 #define nuke_stacks()		S_nuke_stacks(aTHX)
 #define open_script(a,b,c,d)	S_open_script(aTHX_ a,b,c,d)
diff --git a/perl.c b/perl.c
index bbfae80..cfd277b 100644
--- a/perl.c
+++ b/perl.c
@@ -2013,6 +2013,13 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
     }
     }
 
+    /* Set $^X early so that it can be used for relocatable paths in @INC  */
+    /* and for SITELIB_EXP in USE_SITECUSTOMIZE                            */
+    assert (!PL_tainted);
+    TAINT;
+    S_set_caret_X(aTHX);
+    TAINT_NOT;
+
 #if defined(USE_SITECUSTOMIZE)
     if (!minus_f) {
 	/* The games with local $! are to avoid setting errno if there is no
@@ -2028,10 +2035,16 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
 	}
 #  else
 	/* SITELIB_EXP is a function call on Win32.  */
-	const char *const sitelib = SITELIB_EXP;
+	const char *const raw_sitelib = SITELIB_EXP;
+	/* process .../.. if PERL_RELOCATABLE_INC is defined */
+	SV *sitelib_sv = mayberelocate(raw_sitelib, strlen(raw_sitelib),
+				       INCPUSH_CAN_RELOCATE);
+	const char *const sitelib = SvPVX(sitelib_sv);
 	(void)Perl_av_create_and_unshift_one(aTHX_ &PL_preambleav,
 					     Perl_newSVpvf(aTHX_
 							   "BEGIN { do {local $!; -f '%s/sitecustomize.pl'} && do '%s/sitecustomize.pl' }", sitelib, sitelib));
+	assert (SvREFCNT(sitelib_sv) == 1);
+	SvREFCNT_dec(sitelib_sv);
 #  endif
     }
 #endif
@@ -2050,11 +2063,6 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
 	scriptname = "-";
     }
 
-    /* Set $^X early so that it can be used for relocatable paths in @INC  */
-    assert (!PL_tainted);
-    TAINT;
-    S_set_caret_X(aTHX);
-    TAINT_NOT;
     init_perllib();
 
     {
@@ -4419,45 +4427,15 @@ S_incpush_if_exists(pTHX_ AV *const av, SV *dir, SV *const stem)
 }
 #endif
 
-STATIC void
-S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags)
+STATIC SV *
+S_mayberelocate(pTHX_ const char *const dir, STRLEN len, U32 flags)
 {
-    dVAR;
-#ifndef PERL_IS_MINIPERL
-    const U8 using_sub_dirs
-	= (U8)flags & (INCPUSH_ADD_VERSIONED_SUB_DIRS
-		       |INCPUSH_ADD_ARCHONLY_SUB_DIRS|INCPUSH_ADD_OLD_VERS);
-    const U8 add_versioned_sub_dirs
-	= (U8)flags & INCPUSH_ADD_VERSIONED_SUB_DIRS;
-    const U8 add_archonly_sub_dirs
-	= (U8)flags & INCPUSH_ADD_ARCHONLY_SUB_DIRS;
-#ifdef PERL_INC_VERSION_LIST
-    const U8 addoldvers  = (U8)flags & INCPUSH_ADD_OLD_VERS;
-#endif
-#endif
     const U8 canrelocate = (U8)flags & INCPUSH_CAN_RELOCATE;
-    const U8 unshift     = (U8)flags & INCPUSH_UNSHIFT;
-    const U8 push_basedir = (flags & INCPUSH_NOT_BASEDIR) ? 0 : 1;
-    AV *const inc = GvAVn(PL_incgv);
+    SV *libdir;
 
-    PERL_ARGS_ASSERT_INCPUSH;
+    PERL_ARGS_ASSERT_MAYBERELOCATE;
     assert(len > 0);
 
-    /* Could remove this vestigial extra block, if we don't mind a lot of
-       re-indenting diff noise.  */
-    {
-	SV *libdir;
-	/* Change 20189146be79a0596543441fa369c6bf7f85103f, to fix RT#6665,
-	   arranged to unshift #! line -I onto the front of @INC. However,
-	   -I can add version and architecture specific libraries, and they
-	   need to go first. The old code assumed that it was always
-	   pushing. Hence to make it work, need to push the architecture
-	   (etc) libraries onto a temporary array, then "unshift" that onto
-	   the front of @INC.  */
-#ifndef PERL_IS_MINIPERL
-	AV *const av = (using_sub_dirs) ? (unshift ? newAV() : inc) : NULL;
-#endif
-
 	if (len) {
 	    /* I am not convinced that this is valid when PERLLIB_MANGLE is
 	       defined to so something (in os2/os2.c), but the code has been
@@ -4583,6 +4561,50 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags)
 	    }
 #endif
 	}
+    return libdir;
+
+}
+
+STATIC void
+S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags)
+{
+    dVAR;
+#ifndef PERL_IS_MINIPERL
+    const U8 using_sub_dirs
+	= (U8)flags & (INCPUSH_ADD_VERSIONED_SUB_DIRS
+		       |INCPUSH_ADD_ARCHONLY_SUB_DIRS|INCPUSH_ADD_OLD_VERS);
+    const U8 add_versioned_sub_dirs
+	= (U8)flags & INCPUSH_ADD_VERSIONED_SUB_DIRS;
+    const U8 add_archonly_sub_dirs
+	= (U8)flags & INCPUSH_ADD_ARCHONLY_SUB_DIRS;
+#ifdef PERL_INC_VERSION_LIST
+    const U8 addoldvers  = (U8)flags & INCPUSH_ADD_OLD_VERS;
+#endif
+#endif
+    const U8 unshift     = (U8)flags & INCPUSH_UNSHIFT;
+    const U8 push_basedir = (flags & INCPUSH_NOT_BASEDIR) ? 0 : 1;
+    AV *const inc = GvAVn(PL_incgv);
+
+    PERL_ARGS_ASSERT_INCPUSH;
+    assert(len > 0);
+
+    /* Could remove this vestigial extra block, if we don't mind a lot of
+       re-indenting diff noise.  */
+    {
+	SV *libdir;
+	/* Change 20189146be79a0596543441fa369c6bf7f85103f, to fix RT#6665,
+	   arranged to unshift #! line -I onto the front of @INC. However,
+	   -I can add version and architecture specific libraries, and they
+	   need to go first. The old code assumed that it was always
+	   pushing. Hence to make it work, need to push the architecture
+	   (etc) libraries onto a temporary array, then "unshift" that onto
+	   the front of @INC.  */
+#ifndef PERL_IS_MINIPERL
+	AV *const av = (using_sub_dirs) ? (unshift ? newAV() : inc) : NULL;
+#endif
+
+	libdir = mayberelocate(dir, len, flags);
+
 #ifndef PERL_IS_MINIPERL
 	/*
 	 * BEFORE pushing libdir onto @INC we may first push version- and
diff --git a/proto.h b/proto.h
index 55f4b3b..d62514f 100644
--- a/proto.h
+++ b/proto.h
@@ -5846,6 +5846,11 @@ STATIC void	S_init_postdump_symbols(pTHX_ int argc, char **argv, char **env)
 	assert(argv)
 
 STATIC void	S_init_predump_symbols(pTHX);
+STATIC SV*	S_mayberelocate(pTHX_ const char *const dir, STRLEN len, U32 flags)
+			__attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_MAYBERELOCATE	\
+	assert(dir)
+
 STATIC void	S_my_exit_jump(pTHX)
 			__attribute__noreturn__;
 
-- 
1.7.0.4

Flags​:
  category=core
  severity=medium


Site configuration information for perl 5.15.5​:

Configured by hayter at Sun Nov 20 14​:59​:31 PST 2011.

Summary of my perl5 (revision 5 version 15 subversion 5) configuration​:
  Commit id​: 94faaffd8a8d1bc17ec9c91351a4b26f676b0f8e
  Platform​:
  osname=linux, osvers=2.6.32-34-generic-pae, archname=i686-linux-thread-multi
  uname='linux zim.local 2.6.32-34-generic-pae #77-ubuntu smp tue sep 13 21​:16​:18 utc 2011 i686 gnulinux '
  config_args='-des -Dusedevel -Dusesitecustomize -Dusethreads -Duserelocatableinc'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=define, usemultiplicity=define
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.4.3', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=4, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /usr/lib/i486-linux-gnu /usr/lib64
  libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
  libc=/lib/libc-2.11.1.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.11.1'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches​:
 


@​INC for perl 5.15.5​:
  /reloc/usr/local/lib/perl5/site_perl/5.15.5/i686-linux-thread-multi
  /reloc/usr/local/lib/perl5/site_perl/5.15.5
  /reloc/usr/local/lib/perl5/5.15.5/i686-linux-thread-multi
  /reloc/usr/local/lib/perl5/5.15.5
  .


Environment for perl 5.15.5​:
  HOME=/home/hayter
  LANG=en_US.UTF-8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/reloc/usr/local/bin​:/home/hayter/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/bin​:/usr/games
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Nov 24, 2011

From @nwc10

On Sun, Nov 20, 2011 at 03​:22​:07PM -0800, Carl Hayter wrote​:

This is a bug report for perl from hayter@​usc.edu,
generated with the help of perlbug 1.39 running under perl 5.15.5.

From 94faaffd8a8d1bc17ec9c91351a4b26f676b0f8e Mon Sep 17 00​:00​:00 2001
From​: Carl Hayter <hayter@​usc.edu>
Date​: Sun, 20 Nov 2011 12​:38​:15 -0800
Subject​: [PATCH] Make sitecustomize relocatableinc aware

When -Dusesitecustomize is used with -Duserelocatableinc,
SITELIB_EXP/sitecustomize.pl is not found due to SITELIB_EXP having a
'.../..' relocation path.

This patch refactors the path relocation code from S_incpush() into
S_mayberelocate() so that it can be used in both S_incpush() and in
usesitecustomize's use of SITELIB_EXP.

Thanks for that patch.

Is it coincidence that you've reported the same issue as
"zengargoyle <zengargoyle@​gmail.com>" within a couple of days?

I think that the patch is good, but I'm still pondering the corner cases.
I remember a lot of pain with the location of the call to set $^X when I
originally added the relocatable INC code. I think it was because the
code to set $^X had to be moved quite a bit earlier in the initialisation
sequence, into a different function, and it needed to play nicely with
the PL_do_undump code. I'm pleased to see that this time it only needs to
move slightly earlier in the same function.

However, I think that fixing this bug opens up a bit of a security hole​:

$ cat >/home/nick/Sandpit/snap5.9.x-v5.15.5-181-g84573ee/lib/perl5/site_perl/5.15.5/sitecustomize.pl
print STDERR "Hello from the relocated sitecustomize script\n";
$ /home/nick/Sandpit/snap5.9.x-v5.15.5-181-g84573ee/bin/perl5.15.5 -e0
Hello from the relocated sitecustomize script
$ mv /home/nick/Sandpit/snap5.9.x-v5.15.5-181-g84573ee /home/nick/Sandpit/SCR
$ /home/nick/Sandpit/SCR/bin/perl5.15.5 -e0
Hello from the relocated sitecustomize script
$ mv /home/nick/Sandpit/SCR /home/nick/Sandpit/\''; system "id"; '\'
$ /home/nick/Sandpit/\''; system "id"; '\'/bin/perl5.15.5 -e0
uid=1146(nick) gid=1146(nick) groups=1146(nick)
uid=1146(nick) gid=1146(nick) groups=1146(nick)

I have an idea how to fix this.

Arguably the same hole exists already, but to be exploited the person
building perl would need to Configure it with an evil pathname, build it,
and then install it to the evil pathname. Which ought to alert them to
the fact.

- /* Set $^X early so that it can be used for relocatable paths in @​INC */
- assert (!PL_tainted);
- TAINT;
- S_set_caret_X(aTHX);
- TAINT_NOT;
init_perllib();

I'm tempted to leave that assertion in at that location.
(Not tested it yet, mind)

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Nov 24, 2011

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Nov 24, 2011

From [email protected]

On Thu, Nov 24, 2011 at 8​:13 AM, Nicholas Clark <nick@​ccl4.org> wrote​:

On Sun, Nov 20, 2011 at 03​:22​:07PM -0800, Carl Hayter wrote​:

This is a bug report for perl from hayter@​usc.edu,
generated with the help of perlbug 1.39 running under perl 5.15.5.

From 94faaffd8a8d1bc17ec9c91351a4b26f676b0f8e Mon Sep 17 00​:00​:00 2001
From​: Carl Hayter <hayter@​usc.edu>
Date​: Sun, 20 Nov 2011 12​:38​:15 -0800
Subject​: [PATCH] Make sitecustomize relocatableinc aware

When -Dusesitecustomize is used with -Duserelocatableinc,
SITELIB_EXP/sitecustomize.pl is not found due to SITELIB_EXP having a
'.../..' relocation path.

This patch refactors the path relocation code from S_incpush() into
S_mayberelocate() so that it can be used in both S_incpush() and in
usesitecustomize's use of SITELIB_EXP.

Thanks for that patch.

Is it coincidence that you've reported the same issue as
"zengargoyle <zengargoyle@​gmail.com>" within a couple of days?

Not a coincidence. Going back to cleaner, more proper patch and using
Git and having `make test` complain loudly that my repository was whack,
reading perlhack and having to touch AUTHORS... I figured it wasn't worth
it to zengargoyle-ize everything.

I think that the patch is good, but I'm still pondering the corner cases.
I remember a lot of pain with the location of the call to set $^X when I
originally added the relocatable INC code. I think it was because the
code to set $^X had to be moved quite a bit earlier in the initialisation
sequence, into a different function, and it needed to play nicely with
the PL_do_undump code. I'm pleased to see that this time it only needs to
move slightly earlier in the same function.

However, I think that fixing this bug opens up a bit of a security hole​:

$ cat >/home/nick/Sandpit/snap5.9.x-v5.15.5-181-g84573ee/lib/perl5/site_perl/5.15.5/sitecustomize.pl
print STDERR "Hello from the relocated sitecustomize script\n";
$ /home/nick/Sandpit/snap5.9.x-v5.15.5-181-g84573ee/bin/perl5.15.5 -e0
Hello from the relocated sitecustomize script
$ mv /home/nick/Sandpit/snap5.9.x-v5.15.5-181-g84573ee /home/nick/Sandpit/SCR
$ /home/nick/Sandpit/SCR/bin/perl5.15.5 -e0
Hello from the relocated sitecustomize script
$ mv /home/nick/Sandpit/SCR /home/nick/Sandpit/\''; system "id"; '\'
$ /home/nick/Sandpit/\''; system "id"; '\'/bin/perl5.15.5 -e0
uid=1146(nick) gid=1146(nick) groups=1146(nick)
uid=1146(nick) gid=1146(nick) groups=1146(nick)

I have an idea how to fix this.

Arguably the same hole exists already, but to be exploited the person
building perl would need to Configure it with an evil pathname, build it,
and then install it to the evil pathname. Which ought to alert them to
the fact.

My original hackish solution was to make it 'sitecustomize.pm' and 'use' it
with the currently working @​INC relocation. But I guess that's a whole other
can of worms.

-    /* Set $^X early so that it can be used for relocatable paths in @​INC  */
-    assert (!PL_tainted);
-    TAINT;
-    S_set_caret_X(aTHX);
-    TAINT_NOT;
     init_perllib();

I'm tempted to leave that assertion in at that location.
(Not tested it yet, mind)

This move IIRC I only had to do when I tested along with -Dusethreads, but I
might be wrong. It took me some trial and error to figure out using the proto.h
macros vs calling S_mayberelocate(pTHX_ ...).

Most of this is moot to me now, I had wanted to use it on Solaris but
only tested
on Linux. Came to find out that Solaris doesn't do $^X in a useful
way to start with.

$ ssh zim 'uname -a;perl -e "print qq{$^X\n}"'
Linux zim.local 2.6.32-34-generic-pae #77-Ubuntu SMP Tue Sep 13
21​:16​:18 UTC 2011 i686 GNU/Linux
/usr/bin/perl

$ ssh tak 'uname -a;perl -e "print qq{$^X\n}"'
SunOS tak.usc.edu 5.10 Generic_125101-03 i86pc i386 i86pc
perl

This sorta blows my planed use of relocatable sitecustomize out of the water.

____
Carl

@p5pRT
Copy link
Author

p5pRT commented Nov 24, 2011

From @nwc10

On Thu, Nov 24, 2011 at 12​:29​:24PM -0800, zengargoyle wrote​:

Most of this is moot to me now, I had wanted to use it on Solaris but
only tested
on Linux. Came to find out that Solaris doesn't do $^X in a useful
way to start with.

$ ssh zim 'uname -a;perl -e "print qq{$^X\n}"'
Linux zim.local 2.6.32-34-generic-pae #77-Ubuntu SMP Tue Sep 13
21​:16​:18 UTC 2011 i686 GNU/Linux
/usr/bin/perl

$ ssh tak 'uname -a;perl -e "print qq{$^X\n}"'
SunOS tak.usc.edu 5.10 Generic_125101-03 i86pc i386 i86pc
perl

This sorta blows my planed use of relocatable sitecustomize out of the water.

It does in blead now.

I think you'd need to cherry-pick commits 9e68546 and
9e68546 to get Configure to probe for it.

Otherwise I think you need to force procselfexe=/proc/curproc/file
and d_procselfexe=define in config.sh

You may be able to force that (not tested) by running ./Configure with
-Dprocselfexe=/proc/curproc/file -Dd_procselfexe=define

Otherwise edit config.sh after Configure has run.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Nov 24, 2011

From [email protected]

On Thu, Nov 24, 2011 at 12​:40 PM, Nicholas Clark <nick@​ccl4.org> wrote​:

On Thu, Nov 24, 2011 at 12​:29​:24PM -0800, zengargoyle wrote​:

Most of this is moot to me now, I had wanted to use it on Solaris but
only tested
on Linux.  Came to find out that Solaris doesn't do $^X in a useful
way to start with.

$ ssh zim 'uname -a;perl -e "print qq{$^X\n}"'
Linux zim.local 2.6.32-34-generic-pae #77-Ubuntu SMP Tue Sep 13
21​:16​:18 UTC 2011 i686 GNU/Linux
/usr/bin/perl

$ ssh tak 'uname -a;perl -e "print qq{$^X\n}"'
SunOS tak.usc.edu 5.10 Generic_125101-03 i86pc i386 i86pc
perl

This sorta blows my planed use of relocatable sitecustomize out of the water.

It does in blead now.

I think you'd need to cherry-pick commits 9e68546 and
9e68546 to get Configure to probe for it.

Otherwise I think you need to force procselfexe=/proc/curproc/file
and d_procselfexe=define in config.sh

You may be able to force that (not tested) by running ./Configure with
-Dprocselfexe=/proc/curproc/file -Dd_procselfexe=define

Otherwise edit config.sh after Configure has run.

Sweet! My $WORK Solaris playground isn't Git-ized so I'll have to read perlgit
and figure out all that stuff that gets a Debian Perl -V the long list
of patches.
I've been a -des -Dprefix builder. :)

You mentioned 9e68546 twice, I'm guessing maybe needing the
couple of commits previous that are Configure/$^X related.

____
Carl

@p5pRT
Copy link
Author

p5pRT commented Nov 24, 2011

From @nwc10

On Thu, Nov 24, 2011 at 02​:14​:33PM -0800, zengargoyle wrote​:

On Thu, Nov 24, 2011 at 12​:40 PM, Nicholas Clark <nick@​ccl4.org> wrote​:

It does in blead now.

I think you'd need to cherry-pick commits 9e68546 and
9e68546 to get Configure to probe for it.

Otherwise I think you need to force procselfexe=/proc/curproc/file
and d_procselfexe=define in config.sh

You may be able to force that (not tested) by running ./Configure with
-Dprocselfexe=/proc/curproc/file -Dd_procselfexe=define

Otherwise edit config.sh after Configure has run.

Sweet! My $WORK Solaris playground isn't Git-ized so I'll have to read perlgit
and figure out all that stuff that gets a Debian Perl -V the long list
of patches.
I've been a -des -Dprefix builder. :)

You mentioned 9e68546 twice, I'm guessing maybe needing the
couple of commits previous that are Configure/$^X related.

Yes. D'oh. I meant 698ca84

You can probably get most things from the gitweb interface, although possibly
not in the correct format for tools such as patch​:

http​://perl5.git.perl.org/perl.git

(A twisty maze of links)

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Dec 3, 2011

From @cpansprout

On Sun Nov 20 15​:22​:06 2011, hayter@​usc.edu wrote​:

This is a bug report for perl from hayter@​usc.edu,
generated with the help of perlbug 1.39 running under perl 5.15.5.

From 94faaffd8a8d1bc17ec9c91351a4b26f676b0f8e Mon Sep 17 00​:00​:00 2001
From​: Carl Hayter <hayter@​usc.edu>
Date​: Sun, 20 Nov 2011 12​:38​:15 -0800
Subject​: [PATCH] Make sitecustomize relocatableinc aware

When -Dusesitecustomize is used with -Duserelocatableinc,
SITELIB_EXP/sitecustomize.pl is not found due to SITELIB_EXP having a
'.../..' relocation path.

This patch refactors the path relocation code from S_incpush() into
S_mayberelocate() so that it can be used in both S_incpush() and in
usesitecustomize's use of SITELIB_EXP.
---
AUTHORS | 1 +
embed.fnc | 2 +
embed.h | 1 +
perl.c | 102
+++++++++++++++++++++++++++++++++++++------------------------
proto.h | 5 +++
5 files changed, 71 insertions(+), 40 deletions(-)

Nicholas Clark has applied your patch as c29067d. Thank you.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Dec 3, 2011

@cpansprout - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant