Skip to content

Commit 541f97f

Browse files
committed
bisect-runner.pl must patch dl_dyld.xs to eliminate the PREINIT section
*Really* early xsubpp doesn't understand this, and it turns out to be trivial to eliminate it.
1 parent c080c69 commit 541f97f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Porting/bisect-runner.pl

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4344,15 +4344,31 @@ sub patch_ext {
43444344
#define DL_LOADONCEONLY
43454345
43464346
#include "dlutils.c" /* SaveError() etc */
4347-
@@ -185,7 +191,7 @@
4347+
@@ -104,7 +145,7 @@
4348+
dl_last_error = savepv(error);
4349+
}
4350+
4351+
-static char *dlopen(char *path, int mode /* mode is ignored */)
4352+
+static char *dlopen(char *path)
4353+
{
4354+
int dyld_result;
4355+
NSObjectFileImage ofile;
4356+
@@ -161,13 +202,11 @@
4357+
dl_load_file(filename, flags=0)
4358+
char * filename
4359+
int flags
4360+
- PREINIT:
4361+
- int mode = 1;
43484362
CODE:
43494363
DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
43504364
if (flags & 0x01)
43514365
- Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
4366+
- RETVAL = dlopen(filename, mode) ;
43524367
+ Perl_warn_nocontext("Can't make loaded symbols global on this platform while loading %s",filename);
4353-
RETVAL = dlopen(filename, mode) ;
4368+
+ RETVAL = dlopen(filename);
43544369
DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL));
43554370
ST(0) = sv_newmortal() ;
4371+
if (RETVAL == NULL)
43564372
EOPATCH
43574373
if ($major < 4 && !extract_from_file('util.c', qr/^form/m)) {
43584374
apply_patch(<<'EOPATCH');

0 commit comments

Comments
 (0)