This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: DynaLoader in Perl 5.005_01 on cygwin32


> >After a bit of tweaking, I successfully built Perl 5.005_01
> in the cygwin
> >environment. However, I have a problem that the DynaLoader
> doesn't seem to
>
> Could you document the changes, and make them available, and also
> send them back to the perl folks, for inclusion?
>
> thanks
> D

Actually, I was going to wait until I figured out this DynaLoader problem
first, before letting everyone know. Since the DynaLoader is statically
linked into the perl executable (which takes an extremely long time to
build), I figured I'd like to wait and solve that problem first. If people
still want to know how to make a partially disabled version without the
DynaLoader, I can post instructions...

I also have some more information on the DynaLoader error. The error that
perl is returning is error 998 from the dl_load_file sub. Error 998,
according to the Microsoft SDK, is ERROR_NOACCESS, or "Invalid access to
memory location". Now, my question is, what is wrong with the dl_load_file
sub that comes with the distribution? Here is the code for it (from the
distribution file ext/DynaLoader/dl_cygwin32.xs):

---- START CODE ---

void *
dl_load_file(filename,flags=0)
    char *		filename
    int			flags
    PREINIT:
    CODE:
    DLDEBUG(1,fprintf(stderr,"dl_load_file(%s):\n", filename));

    RETVAL = (void*) LoadLibraryExA(filename, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH ) ;

    DLDEBUG(2,fprintf(stderr," libref=%x\n", RETVAL));
    ST(0) = sv_newmortal() ;
    if (RETVAL == NULL){
	SaveError("%d",GetLastError()) ;
    }
    else{
	// setup the dll's impure_ptr:
	impure_setupptr = GetProcAddress(RETVAL, "impure_setup");
	if( impure_setupptr == NULL){
		printf(
    "Cygwin32 dynaloader error: could not load impure_setup symbol\n");
		RETVAL = NULL;
	}
	else{
		// setup the DLLs impure_ptr:
		(*impure_setupptr)(_impure_ptr);
		sv_setiv( ST(0), (IV)RETVAL);
	}
   }

--- END CODE ---

This file (dl_cygwin32.xs) is dated 3/26/97, presumably before the B19 stuff
happened. My question is, did something change within the cygwin code that
would invalidate this procedure? If anyone needs any other code, let me
know. As I said, I would rather wait until the whole issue is resolved
before posting a patch or something, but if people really want it, I can
post instructions now. I think to solve this problem with the DynaLoader
requires someone with more knowledge of the cygwin internals than I have...
Thanks in advance...

Peter Mularski
CLARiiON


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]