Skip to content

Commit 889794d

Browse files
nwc10demerphq
authored andcommitted
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 902ed9e commit 889794d

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
@@ -4451,15 +4451,31 @@ sub patch_ext {
44514451
#define DL_LOADONCEONLY
44524452
44534453
#include "dlutils.c" /* SaveError() etc */
4454-
@@ -185,7 +191,7 @@
4454+
@@ -104,7 +145,7 @@
4455+
dl_last_error = savepv(error);
4456+
}
4457+
4458+
-static char *dlopen(char *path, int mode /* mode is ignored */)
4459+
+static char *dlopen(char *path)
4460+
{
4461+
int dyld_result;
4462+
NSObjectFileImage ofile;
4463+
@@ -161,13 +202,11 @@
4464+
dl_load_file(filename, flags=0)
4465+
char * filename
4466+
int flags
4467+
- PREINIT:
4468+
- int mode = 1;
44554469
CODE:
44564470
DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
44574471
if (flags & 0x01)
44584472
- Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
4473+
- RETVAL = dlopen(filename, mode) ;
44594474
+ Perl_warn_nocontext("Can't make loaded symbols global on this platform while loading %s",filename);
4460-
RETVAL = dlopen(filename, mode) ;
4475+
+ RETVAL = dlopen(filename);
44614476
DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL));
44624477
ST(0) = sv_newmortal() ;
4478+
if (RETVAL == NULL)
44634479
EOPATCH
44644480
if ($major < 4 && !extract_from_file('util.c', qr/^form/m)) {
44654481
apply_patch(<<'EOPATCH');

0 commit comments

Comments
 (0)