Mailing List Archive

gcrypt windows build
When I compile on Windows XP using MinGW and GCC 4.4.1, and run the tests (make check), I get a bunch of failures:


FAIL: version.exe
FAIL: t-mpi-bit.exe
FAIL: prime.exe
FAIL: register.exe
FAIL: ac.exe
FAIL: ac-schemes.exe
FAIL: ac-data.exe
FAIL: basic.exe
FAIL: mpitests.exe
FAIL: tsexp.exe
FAIL: keygen.exe
FAIL: pubkey.exe
FAIL: hmac.exe
FAIL: keygrip.exe
FAIL: fips186-dsa.exe
FAIL: benchmark.exe
========================================
16 of 16 tests failed
Please report to bug-libgcrypt@gnupg.org
========================================


The libraries build just fine - no problems there. When I run the programs I don't see any output at all. Any thoughts? I appreciate any help anyone can provide.

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: gcrypt windows build [ In reply to ]
On Wed, 16 Dec 2009 11:34:06 -0800, Hoyt, David wrote:
>
> When I compile on Windows XP using MinGW and GCC 4.4.1, and run the tests (make check), I get a bunch of failures:

We only support cross-builds from a POSIX platform. If you try to
build it on the traget platform it may or may not work.

> The libraries build just fine - no problems there. When I run the programs I don't see any output at all. Any thoughts? I appreciate any help anyone can provide.

You mean the test program? They return an exit code; some of them
accept an option like

cd tests
./basic --verbose


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
RE: gcrypt windows build [ In reply to ]
> We only support cross-builds from a POSIX platform. If you try to build it on the traget platform it may or may not work.

How do you test a cross-compiled library? How do you run your test programs to validate your cross-compiled libraries are working correctly? Do you have any tips on how I could get the test programs working?

> You mean the test program? They return an exit code; some of them
> accept an option like
>
> cd tests
> ./basic --verbose
>

I was running the generated executables (e.g. ./basic.exe --verbose), not the associated scripts (./basic) and even with --verbose, I was getting no output at all.

Thanks for helping me out - it's appreciated.

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: gcrypt windows build [ In reply to ]
"Hoyt, David" <hoyt6@llnl.gov> writes:

>> We only support cross-builds from a POSIX platform. If you try to build it on the traget platform it may or may not work.
>
> How do you test a cross-compiled library? How do you run your test
> programs to validate your cross-compiled libraries are working
> correctly? Do you have any tips on how I could get the test programs
> working?

Use wine. Just install MinGW and Wine under Linux, and then build
libgcrypt like this:

./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu

It will invoke the self-tests automatically, if you have the
binfmt-support package installed.

If you want a makefile that does everything, check out
<http://josefsson.org/gnutls4win/Makefile>.

/Simon

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
RE: gcrypt windows build [ In reply to ]
> If you want a makefile that does everything, check out
> <http://*josefsson.org/gnutls4win/Makefile>.

What version of gcc do you use (in the mingw toolchain)?

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: gcrypt windows build [ In reply to ]
"Hoyt, David" <hoyt6@llnl.gov> writes:

>> If you want a makefile that does everything, check out
>> <http://*josefsson.org/gnutls4win/Makefile>.
>
> What version of gcc do you use (in the mingw toolchain)?

I'm using the 'mingw32' package from debian, which appears to be gcc 4.2
based. http://packages.qa.debian.org/m/mingw32.html

/Simon

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: gcrypt windows build [ In reply to ]
On Fri, 18 Dec 2009 07:20:36 +0100, Simon Josefsson wrote:
>
> "Hoyt, David" <hoyt6@llnl.gov> writes:
>
> >> If you want a makefile that does everything, check out
> >> <http://*josefsson.org/gnutls4win/Makefile>.
> >
> > What version of gcc do you use (in the mingw toolchain)?
>
> I'm using the 'mingw32' package from debian, which appears to be gcc 4.2
> based. http://packages.qa.debian.org/m/mingw32.html

Take care: The mingw packages in Debian are broken:

as GNU make. We are using Debian GNU/Linux (Lenny); due to a little
bug in the mingw32 compiler it is highly suggested to put a line
deb http://apt.intevation.org lenny/mingw .
into /etc/apt/sources and update the mingw packages.

they replaced the snprintf and introduced a bug. IIRC, "%lu" requires
an "unsigned long long" arg and not an "unsigned long". The result is
that the stack is messed up and you get all kinds of strange error.
At one point it took us many hours of debugging until we realized that
some parts of a system were build with the broken mingw runtime. The
fix is trivial but still hasn't made it into Debian.

I think libgcrypt does not use printf with "%lu" but that may depend
on the version.


Shalom-Salam,

Werner


--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: gcrypt windows build [ In reply to ]
Werner Koch <wk@gnupg.org> writes:

> On Fri, 18 Dec 2009 07:20:36 +0100, Simon Josefsson wrote:
>>
>> "Hoyt, David" <hoyt6@llnl.gov> writes:
>>
>> >> If you want a makefile that does everything, check out
>> >> <http://*josefsson.org/gnutls4win/Makefile>.
>> >
>> > What version of gcc do you use (in the mingw toolchain)?
>>
>> I'm using the 'mingw32' package from debian, which appears to be gcc 4.2
>> based. http://packages.qa.debian.org/m/mingw32.html
>
> Take care: The mingw packages in Debian are broken:
>
> as GNU make. We are using Debian GNU/Linux (Lenny); due to a little
> bug in the mingw32 compiler it is highly suggested to put a line
> deb http://apt.intevation.org lenny/mingw .
> into /etc/apt/sources and update the mingw packages.
>
> they replaced the snprintf and introduced a bug. IIRC, "%lu" requires
> an "unsigned long long" arg and not an "unsigned long". The result is
> that the stack is messed up and you get all kinds of strange error.
> At one point it took us many hours of debugging until we realized that
> some parts of a system were build with the broken mingw runtime. The
> fix is trivial but still hasn't made it into Debian.
>
> I think libgcrypt does not use printf with "%lu" but that may depend
> on the version.

Interesting! I believe I was able to reproduce the problem, now
reported too:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561599

/Simon

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: gcrypt windows build [ In reply to ]
On Fri, 18 Dec 2009 16:23:34 +0100, Simon Josefsson wrote:
> Interesting! I believe I was able to reproduce the problem, now
> reported too:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561599

There is another bug report as weel. Hwoever I can't remember the
number. FWIW, here is a little test program:


#include <stdio.h>

main ()
{
unsigned long foo = 42;
char buf[50];

snprintf (buf, sizeof buf, "->%lu<-", 42);
if (strcmp (buf, "->42<-"))
{
fputs ("snprintf is broken\n", stderr);
return 1;
}
else
{
fputs ("snprintf is okay\n", stderr);
}
return 0;
}



Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: gcrypt windows build [ In reply to ]
Werner Koch <wk@gnupg.org> writes:

> On Fri, 18 Dec 2009 16:23:34 +0100, Simon Josefsson wrote:
>> Interesting! I believe I was able to reproduce the problem, now
>> reported too:
>>
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561599
>
> There is another bug report as weel. Hwoever I can't remember the
> number.

It is http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452977 -- my bug
was a duplicate of that one.

> FWIW, here is a little test program:

Looks like the same error.

/Simon

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel