From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11821 invoked by alias); 30 Apr 2007 15:32:24 -0000 Received: (qmail 11812 invoked by uid 22791); 30 Apr 2007 15:32:23 -0000 X-Spam-Check-By: sourceware.org Received: from dessent.net (HELO dessent.net) (69.60.119.225) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Apr 2007 16:32:18 +0100 Received: from localhost ([127.0.0.1] helo=dessent.net) by dessent.net with esmtp (Exim 4.50) id 1HiXrL-0005vI-OQ; Mon, 30 Apr 2007 15:32:15 +0000 Message-ID: <46360BFF.200CCCE0@dessent.net> Date: Mon, 30 Apr 2007 15:32:00 -0000 From: Brian Dessent Reply-To: cygwin@cygwin.com X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: Fahd Abidi CC: gdb@sourceware.org Subject: Re: trying to build gdb with renamed cygwin1.dll References: <071DB0C788671B48940BC79F8B4930691181F4@ultsol01.tewks.ultsol.local> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00170.txt.bz2 Fahd Abidi wrote: > I was trying to build a gdb version that would use a renamed version of > cygwin1.dll and some of the other dll's that gdb seem to depend on. I > > [...] > > Is this going to be possible to do? Short answer, it's not going to be possible without a lot more work than what you've done. Unfortunately, Cygwin is complicated, and it jumps through a ton of hoops to get that magical POSIX emulation under Win32. Since this is the gdb list it's not particularly topical, so I will try to be brief. I'm sure gdb developers don't really care about this much so please take any replies to the Cygwin list. For one thing, as Bob already mentioned, Cygwin uses a shared memory region for interprocess communication between other Cygwin processes to coordinate signals and child/parent communications and so forth. The name of this shared memory region must be changed in order to actually isolate two Cygwin DLLs. While you're at it you'd also have to change the registry key used for the mount table, otherwise both Cygwins will share the same notions of posix-win32 path mappings. And there is also a "magic prefix" used to differentiate Cygwin strace messages from other OutputDebugString() output that you would have to also change so that two Cygwins would not collide when using strace or gdb. Further, linking against the Cygwin DLL requires use of an import library (due to symbol name aliases), and when using an import library to link the name of the DLL is embedded into the import library. This is convenient because it allows for easy library versioning, i.e. you have an import library libfoo.dll.a that internally references cygfoo-.dll. Thus you can still link with just -lfoo but this will pick up the most recent version of the library where multiple ones exist. It's directly analogous to making the symlink libfoo.so -> libfoo-.so on ELF systems. And the Cygwin DLL is just one; all of the other libs you are using all have their own import libraries, so they would all need to be rebuilt with a different DLL name too. (Hardly anything in the Cygwin distro makes use of the "direct to DLL linking without import library" feature of ld, you will find.) You will end up doing a "make world", patching and recompiling just about every single library. Don't forget that gcc has a -lcygwin in its specs file, so you will need to patch that too. Finally, there are places in the Cygwin source and build machinery that assume the DLL is named "cygwin.dll", so if you change this (and especially if you change it to something of a different length) you will likely have to patch these places too. Brian