gmp 4.2.4 bug on Cygwin 1.5.25

View: New views
2 Messages — Rating Filter:   Alert me  

gmp 4.2.4 bug on Cygwin 1.5.25

by Vladimir Naidenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Sirs/Madams,

I found a bug when compiling gmp 4.2.4 on Cygwin 1.5.25

The below command

./configure \
"CFLAGS=-march=pentium3 -msse -O3 -fomit-frame-pointer" \
--host=pentium3-pc-mingw32 --build=pentium3-pc-mingw32 \
--disable-cxx --disable-shared --enable-static \
"CPP=cpp -mno-cygwin" \
"CC=gcc -mno-cygwin" \
"CC_FOR_BUILD=gcc -mno-cygwin" \
"CPP_FOR_BUILD=cpp -mno-cygwin"

fails.

This error occurs since the variable ac_cv_sizeof_mp_limb_t is handled
as a string rather than an integer because of the carriage return symbol
'\r'
in its tail.
I corrected this file "configure" by inserting a new line
ac_cv_sizeof_mp_limb_t=`expr $ac_cv_sizeof_mp_limb_t : '\([0-9]*\)'`
which converts ac_cv_sizeof_mp_limb_t to the integer.

Please find the corrected file "configure" attached in this letter.

Sincerely yours,

Vlad Naid


_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs

configure.tar.bz2 (184K) Download Attachment

Parent Message unknown Re: gmp 4.2.4 bug on Cygwin 1.5.25

by Vladimir Naidenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think that the variable ac_cv_sizeof_mp_limb_t gets
the carriage return symbol '\r' via the command
ac_cv_sizeof_mp_limb_t=`cat conftest.val`

In Windows (MinGW or Cygwin) the file conftest.val
contains '\r' along with '\n' if it is opened as a text file.

To fix this problem, instead of the command:

fopen ("conftest.val", "w")

put the command:

fopen ("conftest.val", "wb")

everywhere in "configure".

This corrected "configure" will be work in UNIX as well.

----
Naidenko

----- Original Message -----
From: "Torbjorn Granlund" <tg@...>
To: "Vladimir Naidenko" <naidenko@...>
Cc: <gmp-bugs@...>
Sent: Saturday, February 14, 2009 10:20 AM
Subject: Re: gmp 4.2.4 bug on Cygwin 1.5.25


"Vladimir Naidenko" <naidenko@...> writes:

  I found a bug when compiling gmp 4.2.4 on Cygwin 1.5.25

  The below command

  ./configure \
  "CFLAGS=-march=pentium3 -msse -O3 -fomit-frame-pointer" \
  --host=pentium3-pc-mingw32 --build=pentium3-pc-mingw32 \
  --disable-cxx --disable-shared --enable-static \
  "CPP=cpp -mno-cygwin" \
  "CC=gcc -mno-cygwin" \
  "CC_FOR_BUILD=gcc -mno-cygwin" \
  "CPP_FOR_BUILD=cpp -mno-cygwin"

  fails.

  This error occurs since the variable ac_cv_sizeof_mp_limb_t is handled
  as a string rather than an integer because of the carriage return
  symbol '\r'
  in its tail.
  I corrected this file "configure" by inserting a new line
  ac_cv_sizeof_mp_limb_t=`expr $ac_cv_sizeof_mp_limb_t : '\([0-9]*\)'`
  which converts ac_cv_sizeof_mp_limb_t to the integer.

  Please find the corrected file "configure" attached in this letter.

The \r should probably not be there in the first place.  Removing it
from one ac_cv_* variable is not the right approach.  Instead, you
need to find out why it was added.

--
Torbjörn

_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs