This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: rebase not compilable
Brian Dessent wrote on 02 June 2008 16:29:
> Is this really a good direction to move in? The long term plan, as I
> understood it, was to simply build everything with
> --enable-auto-image-base and avoid forever the problem of having to
> manually rebase ever.
--enable-auto-image-base isn't magic. We'll still get collisions. There
are only so many <handwave> possible image bases to choose from. Hang on a
mo, ...
static unsigned long
compute_dll_image_base (const char *ofile)
{
unsigned long hash = strhash (ofile);
return 0x61300000 + ((hash << 16) & 0x0FFC0000);
}
#endif
There are only 1024 possible image bases to choose from, and any DLL >=
256kB in size will span several of them. Collisions are an inevitability,
no? I think we'll probably still have a need for rebase until the whole
world goes 64bit and we've got room for a few more hash buckets[*].
>> g++ -O2 -c -o sections.o sections.cc
>> sections.cc: In member function `bool Relocations::check()':
>> sections.cc:288: error: ISO C++ forbids cast to non-reference type
>> used as lvalue
>> sections.cc: In member function `bool Relocations::fix()':
>> sections.cc:331: error: ISO C++ forbids cast to non-reference type
>> used as lvalue
>> sections.cc: In member function `bool Relocations::relocate(int)':
>> sections.cc:366: error: ISO C++ forbids cast to non-reference type
>> used as lvalue
>> make: *** [sections.o] Error 1
>
> The cast-as-lvalue was a nonstandard gcc extension that was disabled in
> C++ mode (and deprecated for C mode) starting with gcc 3.4.x. Likely
> this package is so old that it was last built with gcc 3.3.x which still
> allowed the construct. So, one workaround is to temporarily install the
> [prev] version of gcc-g++ and gcc-core which are the 3.3 versions.
Sounds like a fairly horrible bodge to me, the better way would be to fix
the code, which was of dubious legality even in K'n'R days.
cheers,
DaveK
[*] - Noooo they be hashin' my bukket!
--
Can't think of a witty .sigline today....
--
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/