Branch: refs/heads/leont/regcomp_static
Home: https://github.com/Perl/perl5
Commit: 3c782000401b8b506eccf83840f3d9a31c64d8cf
https://github.com/Perl/perl5/commit/3c782000401b8b506eccf83840f3d9a31c64d8cf
Author: Yves Orton
Date: 2023-08-01 (Tue, 01 Aug 2023)
Changed paths:
M regcomp_debug.c
Log Message:
---
regcomp_debug.c - fixup regex engine build under -Uusedl
The regex engine is built a bit different from most of the perl
codebase. It is compiled as part of the main libperl.so, and it is
also compiled, with DEBUGGING enabled, as part of the re extension.
When perl itself is compiled with DEBUGGING enabled then the code
in the re extension and the code in libperl.so are the same.
This all works fine and dandy until you have a static build where
the re.so is linked into libperl.so, which results in duplicate
symbols being defined.
This can be handled by looking at PERL_EXT_RE_DEBUG and
DEBUGGING_RE_ONLY. The latter is only defined if PERL_EXT_RE_DEBUG
is defined and DEBUGGING is NOT defined when ext/re/re_top.h is
compiled:
#if defined(PERL_EXT_RE_DEBUG) && !defined(DEBUGGING)
# define DEBUGGING
# define DEBUGGING_RE_ONLY
#endif
This logic ensures that when the re extension is compiled DEBUGGING is
on, and the extra symbol DEBUGGING_RE_ONLY is only defined if it was
defined by re_top.h. If it was on before re_top.h was compiled then
DEBUGGING_RE_ONLY is not defined.
This allows us to tell apart the case where libperl.so already contains
symbols that normally would only be compiled into the re extension.
This patch moves some code around so that static functions in
regcomp_debug.c are compiled regardless, but that non-static functions
are compiled only once.
Commit: 57f83a339e7fe45c287fb95e4a15d42ce98c5471
https://github.com/Perl/perl5/commit/57f83a339e7fe45c287fb95e4a15d42ce98c5471
Author: Yves Orton
Date: 2023-08-01 (Tue, 01 Aug 2023)
Changed paths:
M regexec.c
Log Message:
---
regexec.c - only compile debugging code once under -Uusedl
The regex engine is built a bit different from most of the perl
codebase. It is compiled as part of the main libperl.so, and it is
also compiled, with DEBUGGING enabled, as part of the re extension.
When perl itself is compiled with DEBUGGING enabled then the code
in the re extension and the code in libperl.so are the same.
This all works fine and dandy until you have a static build where
the re.so is linked into libperl.so, which results in duplicate
symbols being defined.
This can be handled by looking at PERL_EXT_RE_DEBUG and
DEBUGGING_RE_ONLY. The latter is only defined if PERL_EXT_RE_DEBUG
is defined and DEBUGGING is NOT defined when ext/re/re_top.h is
compiled:
#if defined(PERL_EXT_RE_DEBUG) && !defined(DEBUGGING)
# define DEBUGGING
# define DEBUGGING_RE_ONLY
#endif
This logic ensures that when the re extension is compiled DEBUGGING is
on, and the extra symbol DEBUGGING_RE_ONLY is only defined if it was
defined by re_top.h. If it was on before re_top.h was compiled then
DEBUGGING_RE_ONLY is not defined.
This allows us to tell apart the case where libperl.so already contains
symbols that normally would only be compiled into the re extension.
We use this to ensure that Perl_re_exec_indentf() is only compiled once.
Compare: https://github.com/Perl/perl5/compare/75ca7065276b...57f83a339e7f