Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: gcrypt

libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux

 

 

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded


vincent.torri at gmail

Sep 30, 2011, 1:02 AM

Post #1 of 8 (712 views)
Permalink
libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux

Hey,

I'm trying to compile libgpg-error for Windows 64 bits with mingw-w64. I
cross compile it on linux (ubuntu).

configuration: ./configure --prefix=/opt/efl --host=x86_64-w64-mingw32
--disable-nls --disable-static

generation of the files:

make[3]: Entering directory
`/home/torri/gitroot/packages/packages/MinGW/libgpg-error-1.10-src/release/mingw-w64-x86_64-libgpg-error-1.10/src'
gawk -f ./mkerrnos.awk ./errnos.in >code-to-errno.h
gawk -f ./mkerrcodes1.awk ./errnos.in >_mkerrcodes.h
gawk -f ./mkstrtable.awk -v textidx=2 -v nogettext=1 \
./err-sources.h.in >err-sources-sym.h
gawk -f ./mkstrtable.awk -v textidx=2 -v nogettext=1 \
./err-codes.h.in >err-codes-sym.h
x86_64-w64-mingw32-gcc -E _mkerrcodes.h | grep GPG_ERR_ | \
gawk -f ./mkerrcodes.awk >mkerrcodes.h
gawk -f ./mkstrtable.awk -v textidx=2 -v nogettext=1 \
-v prefix=GPG_ERR_ -v namespace=errnos_ \
./errnos.in >errnos-sym.h
rm extra-h.in
rm: cannot remove `extra-h.in': No such file or directory
make[3]: [extra-h.in] Error 1 (ignored)
cat ./w32-add.h >>extra-h.in
cat ./gpg-error.def.in >_gpg-error.def.h
echo EOF >>extra-h.in
x86_64-w64-mingw32-gcc -E -I. -I.. _gpg-error.def.h | \
grep -v '^#' >gpg-error.def
echo "/*dummy*/" > mkw32errmap.map.c
rm _gpg-error.def.h
gawk -f ./mkheader.awk \
./err-sources.h.in \
./err-codes.h.in \
./errnos.in \
extra-h.in \
./gpg-error.h.in > gpg-error.h
rm _mkerrcodes.h
cc -I. -I. -o mkerrcodes ./mkerrcodes.c
./mkerrcodes | gawk -f ./mkerrcodes2.awk >code-from-errno.h
make all-am


Here is the beginning of code-from-errno.h :


-2147168224 GPG_ERR_EPROTO
static const int err_code_from_index[] = {
GPG_ERR_EPERM,
etc....

So if someone has an idea of the fix....

thank you

Vincent Torri


wk at gnupg

Sep 30, 2011, 7:58 AM

Post #2 of 8 (698 views)
Permalink
Re: libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux [In reply to]

On Fri, 30 Sep 2011 10:02, vincent.torri [at] gmail said:

> configuration: ./configure --prefix=/opt/efl --host=x86_64-w64-mingw32
> --disable-nls --disable-static

Use

./autogen.sh --build-w64

to build it. Some time ago I changed a few things and was then able to
build a pure 64 bit version which worked without problems on
Windows7-64bit. You need master of course.

libgpg-error is the only module which has support for 64 bit Windows.


Shalom-Salam,

Werner

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


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


vincent.torri at gmail

Sep 30, 2011, 11:43 AM

Post #3 of 8 (692 views)
Permalink
Re: libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux [In reply to]

On Fri, Sep 30, 2011 at 4:58 PM, Werner Koch <wk [at] gnupg> wrote:

> On Fri, 30 Sep 2011 10:02, vincent.torri [at] gmail said:
>
> > configuration: ./configure --prefix=/opt/efl --host=x86_64-w64-mingw32
> > --disable-nls --disable-static
>
> Use
>
> ./autogen.sh --build-w64
>
> to build it. Some time ago I changed a few things and was then able to
> build a pure 64 bit version which worked without problems on
> Windows7-64bit. You need master of course.
>

i'll try with the git repo, then.


>
> libgpg-error is the only module which has support for 64 bit Windows.
>

Actually, I need libgcrypt for crypto in gnutls. So it means that,
currently, it's useless to try to compile libgcrypt for win64 ?

Regards

Vincent Torri


vincent.torri at gmail

Sep 30, 2011, 10:34 PM

Post #4 of 8 (692 views)
Permalink
Re: libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux [In reply to]

On Fri, Sep 30, 2011 at 4:58 PM, Werner Koch <wk [at] gnupg> wrote:

> On Fri, 30 Sep 2011 10:02, vincent.torri [at] gmail said:
>
> > configuration: ./configure --prefix=/opt/efl --host=x86_64-w64-mingw32
> > --disable-nls --disable-static
>

I actually have the same problem when cross compiling to win32 :

configuration : ./configure --prefix=/opt/efl --host=i686-w64-mingw32
--disable-nls --disable-static

exactly the same problem

Vincent Torri


wk at gnupg

Oct 2, 2011, 2:04 AM

Post #5 of 8 (690 views)
Permalink
Re: libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux [In reply to]

On Fri, 30 Sep 2011 20:43, vincent.torri [at] gmail said:
> Actually, I need libgcrypt for crypto in gnutls. So it means that,
> currently, it's useless to try to compile libgcrypt for win64 ?

Don't use it. We do not have an RNG for w64.


Shalom-Salam,

Werner


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


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


cmouse at youzen

Oct 2, 2011, 6:39 AM

Post #6 of 8 (688 views)
Permalink
Re: libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux [In reply to]

On Sun, Oct 02, 2011 at 11:04:38AM +0200, Werner Koch wrote:
> On Fri, 30 Sep 2011 20:43, vincent.torri [at] gmail said:
> > Actually, I need libgcrypt for crypto in gnutls. So it means that,
> > currently, it's useless to try to compile libgcrypt for win64 ?
>
> Don't use it. We do not have an RNG for w64.
>
>
> Shalom-Salam,
>
> Werner
>
>
> --
> Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
>

I thought windows has a PRNG suited for cryptography bundled. Why can't you
use that?

Aki Tuomi
Attachments: signature.asc (0.19 KB)


vincent.torri at gmail

Oct 2, 2011, 2:32 PM

Post #7 of 8 (687 views)
Permalink
Re: libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux [In reply to]

On Sat, Oct 1, 2011 at 7:34 AM, Vincent Torri <vincent.torri [at] gmail>wrote:

>
>
> On Fri, Sep 30, 2011 at 4:58 PM, Werner Koch <wk [at] gnupg> wrote:
>
>> On Fri, 30 Sep 2011 10:02, vincent.torri [at] gmail said:
>>
>> > configuration: ./configure --prefix=/opt/efl --host=x86_64-w64-mingw32
>> > --disable-nls --disable-static
>>
>
> I actually have the same problem when cross compiling to win32 :
>
> configuration : ./configure --prefix=/opt/efl --host=i686-w64-mingw32
> --disable-nls --disable-static
>
> exactly the same problem
>

Just lookin at the output of ./mkerrcodes, I get:

-2147168224 GPG_ERR_EPROTO
1 GPG_ERR_EPERM
2 GPG_ERR_ENOENT
etc...

So it seems that there is a problem with the fact that GPG_ERR_EPROTO is
negative (i think). So integer size overflow.

I changed mkerrcodes.c so that it displays an unsigned int. The 2 changes
lines are:

unsigned int i;
...
printf ("%u\t%s\n", err_table[i].err, err_table[i].err_sym);

and it works now.

regards

Vincent


vincent.torri at gmail

Oct 2, 2011, 8:02 PM

Post #8 of 8 (685 views)
Permalink
Re: libgpg-error : code-from-errno.h not correctly generated when cross-compiling to Windows on Linux [In reply to]

On Sun, Oct 2, 2011 at 11:32 PM, Vincent Torri <vincent.torri [at] gmail>wrote:

>
>
> On Sat, Oct 1, 2011 at 7:34 AM, Vincent Torri <vincent.torri [at] gmail>wrote:
>
>>
>>
>> On Fri, Sep 30, 2011 at 4:58 PM, Werner Koch <wk [at] gnupg> wrote:
>>
>>> On Fri, 30 Sep 2011 10:02, vincent.torri [at] gmail said:
>>>
>>> > configuration: ./configure --prefix=/opt/efl --host=x86_64-w64-mingw32
>>> > --disable-nls --disable-static
>>>
>>
>> I actually have the same problem when cross compiling to win32 :
>>
>> configuration : ./configure --prefix=/opt/efl --host=i686-w64-mingw32
>> --disable-nls --disable-static
>>
>> exactly the same problem
>>
>
> Just lookin at the output of ./mkerrcodes, I get:
>
> -2147168224 GPG_ERR_EPROTO
> 1 GPG_ERR_EPERM
> 2 GPG_ERR_ENOENT
> etc...
>
> So it seems that there is a problem with the fact that GPG_ERR_EPROTO is
> negative (i think). So integer size overflow.
>
> I changed mkerrcodes.c so that it displays an unsigned int. The 2 changes
> lines are:
>
> unsigned int i;
>

that change is not necessary, of course, but as i >= 0 anyway...

Vincent Torri


> ...
> printf ("%u\t%s\n", err_table[i].err, err_table[i].err_sym);
>
> and it works now.
>
> regards
>
> Vincent
>
>
>
>

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.