This is the mail archive of the cygwin 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]
Other format: [Raw text]

Questions on patching dcrt0.cc


I'm working on a patch to make it possible to load cygwin1.dll
via LoadLibrary() in MSVC.  The intent is to make it possible
for non-cygwin applications to be cooperative with cygwin paths
and signals.  (Such applications will need to either be open
source as specified in the cygwin license, GPLed, or under the
Cygwin Contract available at http://www.redhat.com/software/cygwin/ .)

Some questions:

1.  As far as I can determine, the current problem with loading
    the cygwin DLL via LoadLibrary is that the cygtls per-thread
    context needs 4K of the bottom of the stack to be available to
    work with.  That normally gets initialized when the application
    loads or a thread is spawned, but it's hard to deal with that
    retroactively in the LoadLibrary case.  If you ensure that there's
    4K of padding at the bottom of the stack, you can just add
	main_environ = user_data->envptr;
	*main_environ = NULL;
	initialize_main_tls(&_my_tls);
    to cygwin_dll_init() just before the call to dll_crt0_1(NULL),
    but that's the sort of thing that should come with big warning
    signs.  Is this manner of solution-- combined with a sample
    program that demonstrates and tests this functionality, a
    FAQ entry, and thorough commenting in the code explaining all
    the caveats-- acceptable?  Or should I be looking for a
    different way to solve the problem?

2.  I have an MSVC test program that demonstrates and tests this
    functionality.  Where should I submit the source code and
    Makefile -- a subdirectory of contrib?  of winsup/testsuite?
    Since not everyone working on cygwin will have access to the
    Microsoft compiler, should I submit a binary as well as source?
    Where should I submit it?

3.  I want to spare anyone making use of the test program any
    worries over legalities.  Should I submit it under the cygwin
    license or put it in the public domain?

Thanks,
Max



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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