[patch/rebase] Add a rebase database to keep track of DLL addresses

Charles Wilson cygwin@cwilson.fastmail.fm
Sat Jul 23 00:27:00 GMT 2011


On 7/21/2011 3:38 PM, Charles Wilson wrote:
>> IMHO it would make sense to bump LIB_VERSION and create a new rebase
>> package ASAP, so we can get some more people to test it.
> 
> Give me a day or so to do the mingw/msys gloss, before updating
> LIB_VERSION and cutting a new release, ok?

The attached allows to build on msys, as well as cygwin & mingw, and
appears to work properly on all three platforms.

The changes to config.guess and config.sub are...questionable.
Basically, msys doesn't WANT to put their triple in the upstream repo,
because then people would want to build all manner of tools for the msys
platform -- but that's cygwin's bailiwick (msys=minimal).

So, basically all msys ports have to explicitly patch config.guess and
config.sub: basically, the msys distributor "forks" each upstream
project, even if only to patch config.*.

I can continue to do that, for msys-rebase.

...OR, rebase itself can adopt the "forked" versions of config.*, since
it is such a special purpose tool. (But then, we've got to remember to
re-apply these changes if we update to newer config.*) Jason's call.


Also, I added a quick-n-dirty rebase-dump application. It actually
helped me track down a problem on mingw: the db was not being opened in
binary mode, and for some reason that prevented rebase (and rebase-dump)
from being able to load the strings (it loaded the other bits of the db
fine!)

I don't know why, but when I added O_BINARY everything was copacetic.

When I say quick-n-dirty, I mean: lots of duplicated and only slightly
modified code from rebase.c.  There's room for code consolidation, so
this bit could be put off until later.


	build-aux/config.guess: Add msys support.
	build-aux/config.sub: Add msys support.

	configure.ac: Specify -static-* and -D overrides, on a
	platform-sensitive basis, here rather than hardcoding in
	Makefile.in.
	imagehelper/Makefile.in: Ditto.
	Makefile.in: Ditto. Also, add rebase-dump.
	imagehelper/rebase_main.cc: Fix bug in GetImageInfos64 call.
	Be explicit about CYGWIN vs MSYS.
	imagehelper/sections.h: Fix portability issues with stdint.h
	and uintptr_t.
	rebase.c: Include limits.h for PATH_MAX. Handle missing
	inttypes.h on MSYS. Be explicit about CYGWIN vs MSYS.
	(strtoull) [MSYS]: Add missing function.
	(main) [MSYS]: Allow room for msys-1.0.dll, as with cygwin1.dll.
        (mkstemp) [MINGW]: Fix open flags.
	(load_image_info): Fix open flags (O_BINARY). Use calloc
	instead of malloc when allocating strings.
	(merge_image_info) [MSYS]: Skip msys-1.0.dll, as with
	cygwin1.dll.
	(parse_args) [MINGW]: Use program path to determine location of
	database.
	rebaseall.in: Add platform-specific code to handle msys
	shortcomings.
	peflagsall.in: Ditto.

	rebase-dump.c: New file.

--
Chuck

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mingw-msys-updates.patch
Type: text/x-patch
Size: 26597 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20110723/635f208b/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rebase-dump.c
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20110723/635f208b/attachment.c>


More information about the Cygwin-apps mailing list