summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2011-03-17 10:14:19 -0700
committerJan Dubois <jand@activestate.com>2011-03-17 10:17:14 -0700
commitf31c6eed2275930127050c5395e103e816de9c87 (patch)
tree1b3220f304b8d40d3b34d744117ef174ca47f16a /perl.c
parent3fffb88a6cabe9bc42e2a62f0ab7442ba6850dd0 (diff)
downloadperl-f31c6eed2275930127050c5395e103e816de9c87.tar.gz
#81026: Perl binary no longer relocatable
Provide a preprocessor macro PERL_RELOCATABLE_INCPUSH to tell incpush_use_sep() to ignore the passed in len argument. This enables relocatable Perl distributions that patch the various paths at install time. Core Perl neither provides actual relocation scripts/programs, nor endorses this practise as being "supported"; this patch only makes it possible to create such tools. It is therefore undocumented outside the source level comments.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index bfa4fe8d21..8e918c29e9 100644
--- a/perl.c
+++ b/perl.c
@@ -4641,7 +4641,15 @@ S_incpush_use_sep(pTHX_ const char *p, STRLEN len, U32 flags)
PERL_ARGS_ASSERT_INCPUSH_USE_SEP;
+ /* perl compiled with -DPERL_RELOCATABLE_INCPUSH will ignore the len
+ * argument to incpush_use_sep. This allows creation of relocatable
+ * Perl distributions that patch the binary at install time. Those
+ * distributions will have to provide their own relocation tools; this
+ * is not a feature otherwise supported by core Perl.
+ */
+#ifndef PERL_RELOCATABLE_INCPUSH
if (!len)
+#endif
len = strlen(p);
end = p + len;