From: Gurusamy Sarathy Date: Thu, 6 Jan 2000 20:11:46 +0000 (+0000) Subject: add workaround for dlopen() bug on OpenBSD (relative paths that X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d4ce9a5d50788ac8c636881861cb1c2ab45fc52;p=p5sagit%2Fp5-mst-13.2.git add workaround for dlopen() bug on OpenBSD (relative paths that match /^lib/ won't load properly) p4raw-id: //depot/perl@4765 --- diff --git a/Changes b/Changes index 953dfb7..c30b7fd 100644 --- a/Changes +++ b/Changes @@ -79,6 +79,67 @@ Version v5.5.640 Development release working toward 5.6 ---------------- ____________________________________________________________________________ +[ 4764] By: gsar on 2000/01/06 19:51:08 + Log: add undocumented globals for compatibility--find.pl, and find2perl + generated code need them (from Helmut Jarausch ) + Branch: perl + ! lib/File/Find.pm +____________________________________________________________________________ +[ 4763] By: gsar on 2000/01/06 10:51:07 + Log: fix various C-backend shenanigans + Branch: perl + ! ext/B/B/C.pm +____________________________________________________________________________ +[ 4762] By: gsar on 2000/01/06 04:09:00 + Log: tweak test in change#4757 for Windows + Branch: perl + ! t/io/open.t +____________________________________________________________________________ +[ 4761] By: gsar on 2000/01/06 02:55:30 + Log: USE_ITHREADS tweak (reused pad values could be SvREADONLY if + they belonged to freed OP_CONSTs) + Branch: perl + ! op.c +____________________________________________________________________________ +[ 4760] By: gsar on 2000/01/06 00:22:40 + Log: constant ranges could escape bareword check in list context + Branch: perl + ! op.c t/pragma/strict-subs +____________________________________________________________________________ +[ 4759] By: gsar on 2000/01/05 20:52:50 + Log: From: Ilya Zakharevich + Date: Wed, 05 Jan 2000 15:23:18 EST + Message-Id: <20000105152318.A7400@monk.mps.ohio-state.edu> + Subject: Re: minimal m//g matches appear busted + Branch: perl + ! regexec.c t/op/pat.t +____________________________________________________________________________ +[ 4758] By: gsar on 2000/01/05 12:49:40 + Log: various nits identified by warnings unmasked by recent changes + Branch: perl + ! ext/B/Makefile.PL lib/ExtUtils/Install.pm pod/perlfunc.pod +____________________________________________________________________________ +[ 4757] By: gsar on 2000/01/05 12:48:10 + Log: severe bugs in change#3786 fixed + Branch: perl + ! doio.c t/io/open.t +____________________________________________________________________________ +[ 4756] By: gsar on 2000/01/05 11:25:10 + Log: tweak change#4745 to make ebcdic output match for chars <= 037 + Branch: perl + ! ext/Data/Dumper/Dumper.pm +____________________________________________________________________________ +[ 4755] By: gsar on 2000/01/05 06:56:05 + Log: cygwin support tweaks (from Eric Fifer ) + Branch: perl + ! Configure util.c utils/perlcc.PL +____________________________________________________________________________ +[ 4754] By: gsar on 2000/01/05 06:52:25 + Log: avoid expensive Version_check (from Andreas Koenig) + Branch: perl + ! Changes lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MM_VMS.pm + ! lib/ExtUtils/MM_Win32.pm lib/ExtUtils/MakeMaker.pm +____________________________________________________________________________ [ 4753] By: gsar on 2000/01/05 06:48:22 Log: From: andreas.koenig@anima.de (Andreas J. Koenig) Date: 03 Jan 2000 21:56:02 +0100 diff --git a/MANIFEST b/MANIFEST index bd42382..3e0b4c6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -246,6 +246,7 @@ ext/DynaLoader/dl_vms.xs VMS implementation ext/DynaLoader/dlutils.c Dynamic loader utilities for dl_*.xs files ext/DynaLoader/hints/aix.pl Hint for DynaLoader for named architecture ext/DynaLoader/hints/linux.pl Hint for DynaLoader for named architecture +ext/DynaLoader/hints/openbsd.pl Hint for DynaLoader for named architecture ext/Errno/ChangeLog Errno perl module change log ext/Errno/Errno_pm.PL Errno perl module create script ext/Errno/Makefile.PL Errno extension makefile writer diff --git a/ext/DynaLoader/dl_dlopen.xs b/ext/DynaLoader/dl_dlopen.xs index 9c07e60..135f511 100644 --- a/ext/DynaLoader/dl_dlopen.xs +++ b/ext/DynaLoader/dl_dlopen.xs @@ -146,9 +146,20 @@ void * dl_load_file(filename, flags=0) char * filename int flags - PREINIT: + PREINIT: int mode = RTLD_LAZY; - CODE: + CODE: +{ +#if defined(DLOPEN_WONT_DO_RELATIVE_PATHS) + char pathbuf[PATH_MAX + 2]; + if (*filename != '/' && strchr(filename, '/')) { + if (getcwd(pathbuf, PATH_MAX - strlen(filename))) { + strcat(pathbuf, "/"); + strcat(pathbuf, filename); + filename = pathbuf; + } + } +#endif #ifdef RTLD_NOW if (dl_nonlazy) mode = RTLD_NOW; @@ -167,7 +178,7 @@ dl_load_file(filename, flags=0) SaveError(aTHX_ "%s",dlerror()) ; else sv_setiv( ST(0), PTR2IV(RETVAL)); - +} void * dl_find_symbol(libhandle, symbolname) diff --git a/ext/DynaLoader/hints/openbsd.pl b/ext/DynaLoader/hints/openbsd.pl new file mode 100644 index 0000000..aeaa92c --- /dev/null +++ b/ext/DynaLoader/hints/openbsd.pl @@ -0,0 +1,3 @@ +# XXX Configure test needed? +# Some OpenBSDs seem to have a dlopen() that won't accept relative paths +$self->{CCFLAGS} = $Config{ccflags} . ' -DDLOPEN_WONT_DO_RELATIVE_PATHS';