X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Mon, 1 Sep 2008 11:25:14 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: why the strange stack stuf in cygwin? Message-ID: <20080901152514.GA1833@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Mon, Sep 01, 2008 at 08:33:16AM +0000, Jay wrote: > Why does Cygwin do such wierd stuff with the top of the stack? > Is this to have thread locals faster than TlsGetValue offers? No, it is a work-around for this: % cat <<'EOF' > foo.c __thread int abc; int main (int argc, char **argv) { printf ("%d\n", abc); } EOF % gcc -o foo foo.c foo.c:2: error: thread-local storage not supported for this target > Is it worth it? What kind of answer do you expect here? A head slap and a "What were we thinking???" > (The cost: harder to LoadLibrary(cygwin1.dll), Dynamic linking of cygwin1.dll (i.e., making it easier to be a 3PP) has never been a core goal of Cygwin. >harder to port to other architectures, Cygwin works on all of the architectures that Windows NT+ supports. Porting Cygwin to architectures supported by Windows CE would require quite a bit more work than fiddling with the thread local storage model. >the strange path where DllMain "respawns", etc.) "the strange path"? You're using shorthand which assumes that people understand your thought processes and conclusions. If you have a point to make you really need to provide more details and concrete examples of an alternate method for doing what is currently accomplished by Cygwin's tls method. cgf -- 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/