[PATCH] support for mingw-w64

Ozkan Sezer sezeroz at gmail.com
Sat Sep 12 22:43:15 CEST 2009


On Sat, Sep 12, 2009 at 9:41 PM, Torbjorn Granlund <tg at gmplib.org> wrote:
> Ozkan Sezer <sezeroz at gmail.com> writes:
>
>  Well, here the simplest patch I can think of
>  (attached gmp_intptr_t.diff, dif of configure omitted.)
>  It adds a few type size checks to configure.in and
>  typedefs gmp_intptr_t in gmp-impl.h so that all
>  tests can pick it up without issue.  Is this acceptable?
>
> I attached a modified and simplified patch.
>
>
>
> Note that not only configure is generated, config.in is too.
>
> The configure.in patch needs work.  The host os specific code is not in
> the standard place.  Since configure.in is already awfully large and
> hard to read, we need to make changes carefully, following its current
> structure.
>
> Please move the code to where x86_64 OS's are recognised, then test the
> entire thing.
>
> --
> Torbjörn

Torbjörn, thanks!

I replaced the necessary parts of my old draft with your patch,
building and testing seems to work just fine.  See the attached
w64-2.patch as a reference to see what I did (it is for reference
only, doesn't include diffs to generated files, discussed further
below).  See the attached test.log file for test results.

One failure is t-locale:  You are replacing the glibc library
function with yours, so the linkage fails because of multiple
definitions of localeconv. If I replace #if HAVE_LOCALECONV
with #if HAVE_LOCALECONV && !defined(__MINGW32__)
in t-locale.c, then build succeeds, and I get "Test skipped,
replacing localeconv/nl_langinfo doesn't work".

There are 5 warnings from the test build procedure:
memory.c: In function 'tests_reallocate':
memory.c:113: warning: cast from pointer to integer of different size
memory.c:121: warning: cast from pointer to integer of different size
memory.c: In function 'tests_free_find':
memory.c:168: warning: cast from pointer to integer of different size
t-get_str.c: In function 'check_one':
t-get_str.c:68: warning: cast from pointer to integer of different size
t-get_str.c:69: warning: cast from pointer to integer of different size
My humble suggestion would be replacing those 0x%lX simply
with %p (attached: tests.patch).

As for my patching configure.in at the correct location:  Well,
I thought that I already did it at the correct place, where you
do your stuff for athlon64 | x86_64 cpus.  Well, I just saw that
I missed the atom cpu case, I think..  What is your suggestion
about the correct place in configure.in?

--
Ozkan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.log
Type: application/octet-stream
Size: 16158 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-devel/attachments/20090912/22407dc2/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tests.patch
Type: application/octet-stream
Size: 1636 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-devel/attachments/20090912/22407dc2/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: w64-2.patch
Type: application/octet-stream
Size: 7809 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-devel/attachments/20090912/22407dc2/attachment-0005.obj>


More information about the gmp-devel mailing list