Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Subject: Questions on patching dcrt0.cc From: Max Kaehn To: cygwin AT cygwin DOT com Content-Type: text/plain Message-Id: <1117064831.5390.174.camel@fulgurite> Mime-Version: 1.0 Date: Wed, 25 May 2005 16:47:11 -0700 Content-Transfer-Encoding: 7bit X-Spam-Not-Checked: Messages over 100K or from internal Electric Cloud machines are not checked X-IsSubscribed: yes 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/