[PATCH] support for mingw-w64

Torbjorn Granlund tg at gmplib.org
Sat Sep 12 23:00:06 CEST 2009


Ozkan Sezer <sezeroz at gmail.com> writes:

  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".
  
Is __MINGW32__ defined for __MINGW64__?  Isn't there an __MINGW64__
symbol we should use instead, if we choose your workaround?

It seem strange that we're not allowed to override localeconv.  Is this
some strange windoze-ism, that libraries are linked in as a unit, not
incrementally from undefined symbols?

I've never heard of this problem in mingw32, by the way.

  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).
  
Is %p part of ISO C90?  I suppose these are error messages, to poor
printing results are no disaster.  But we should handle C90 right even
there.

  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?
  
Look for a case statement indexed by "operating system" within the x86
stuff.  Add a new tag there, put your code after that tag.

-- 
Torbjörn


More information about the gmp-devel mailing list