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

Mailing List Archive: GnuPG: devel

Cross compilation failed

 

 

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


i.demonstrate at gmail

Feb 18, 2009, 9:33 PM

Post #1 of 3 (537 views)
Permalink
Cross compilation failed

Hi all. I want to make a Win32 port of GnuPG 2.0.10 from my sid with
the help of mingw32.
$ dpkg -l "mingw32*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-
aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)
||/ Name Version Description
+++-=====================-=====================-
==========================================================
ii mingw32 4.2.1.dfsg-1 Minimalist GNU win32
(cross) compiler
ii mingw32-binutils 2.18.50-20080109-1 Minimalist GNU win32
(cross) binutils
ii mingw32-runtime 3.13-1 Minimalist GNU win32
(cross) runtime

I downloaded the following libraries for building GnuPG:
libgcrypt-1.4.4.tar.bz2
w32pth-2.0.2.tar.bz2
libgpg-error-1.7.tar.bz2
zlib-1.2.3.tar.gz
gettext-0.17.tar.gz
libiconv-1.12.tar.gz
readline-5.0-1-bin.zip
readline-5.0-1-lib.zip
libassuan-1.0.5
libksba-1.0.5.tar.bz2
libassuan-1.0.5.tar.bz2

When cross compiling libassuan, I got the following warnings:
configure: WARNING:
***
*** Data structure for sending ancillary data missing.
*** Descriptor passing won't work.
***
***
*** No implementation of fopencookie or funopen available.
*** The assuan_get_data_fp feature won't work.
***
But it succeeded in creating the library itself.

However when it comes to linking GnuPG, something went wrong:
i586-mingw32msvc-gcc -g -O2 -Wall -Wno-pointer-sign -Wpointer-arith
-L/home/heli/w32root/lib -o gpg2.exe gpg.o server.o build-packet.o
compress.o free-packet.o getkey.o keydb.o keyring.o seskey.o kbnode.o
mainproc.o armor.o mdfilter.o textfilter.o progress.o misc.o rmd160.o
openfile.o keyid.o parse-packet.o cpr.o plaintext.o sig-check.o
keylist.o pkglue.o pkclist.o skclist.o pubkey-enc.o passphrase.o
seckey-cert.o encr-data.o cipher.o encode.o sign.o verify.o revoke.o
decrypt.o keyedit.o dearmor.o import.o export.o trustdb.o tdbdump.o
tdbio.o delkey.o keygen.o helptext.o keyserver.o photoid.o call-
agent.o card-util.o exec.o ../common/libcommon.a ../jnlib/libjnlib.a
../gl/libgnu.a ../common/libgpgrl.a -lz -lreadline -lws2_32 -
lgcrypt -lassuan -lgpg-error /home/heli/w32root/lib/libiconv.dll.a -
L/home/heli/w32root/lib
/home/heli/w32root/lib/libassuan.a(assuan-socket.o): In function
`_assuan_sock_bind':
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:300: undefined
reference to `_bind [at] 1'
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:260: undefined
reference to `_htonl@4'
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:280: undefined
reference to `_bind [at] 1'
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:282: undefined
reference to `_getsockname [at] 1'
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:292: undefined
reference to `_ntohs@4'
/home/heli/w32root/lib/libassuan.a(assuan-socket.o): In function
`_assuan_sock_connect':
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:228: undefined
reference to `_connect [at] 1'
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:203: undefined
reference to `_htons@4'
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:204: undefined
reference to `_htonl@4'
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:211: undefined
reference to `_connect [at] 1'
/home/heli/w32root/lib/libassuan.a(assuan-socket.o): In function
`_assuan_sock_new':
/home/heli/w32src/libassuan-1.0.5/src/assuan-socket.c:176: undefined
reference to `_socket [at] 1'
/home/heli/w32root/lib/libassuan.a(assuan-uds.o): In function
`uds_writer':
/home/heli/w32src/libassuan-1.0.5/src/assuan-uds.c:187: undefined
reference to `_sendto [at] 2'
/home/heli/w32root/lib/libassuan.a(assuan-uds.o): In function
`uds_reader':
/home/heli/w32src/libassuan-1.0.5/src/assuan-uds.c:155: undefined
reference to `_recvfrom [at] 2'
collect2: ld returned 1 exit status
make[2]: *** [gpg2.exe] Error 1
make[2]: Leaving directory `/home/heli/MyDownloads/gnupg-2.0.10/g10'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/heli/MyDownloads/gnupg-2.0.10'
make: *** [all] Error 2

I think there might be something wrong with my compilation of
libassuan. But I am not sure what caused it. Could anybody tell me how
to fix it?

Thank you a lot!


--
He, Li
Shanghai Key Lab of Intelligent Information Processing
School of Computer Science, Fudan University, Shanghai, China
E-mail: I.demonstrate [at] gmail

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


wk at gnupg

Mar 6, 2009, 12:19 AM

Post #2 of 3 (492 views)
Permalink
Re: Cross compilation failed [In reply to]

On Thu, 19 Feb 2009 06:33, i.demonstrate [at] gmail said:

> Hi all. I want to make a Win32 port of GnuPG 2.0.10 from my sid with
> the help of mingw32.

The easiest way is to use the gpg4win installer (the tar.bz2 file) which
makes sure that everthing is in place. If you want to manually build
it, I suggest to create a directory

$HOME/w32root

or alternativley any other directory and set w32root=directory. Then
you can just use

./autogen.sh --build-w32 && make install

for all GnuPG related packages (those with that script). For the other
packages you need to pass appropriate options to ./configure. Start
with libgpg-error, libgcrypt, w32pth, libassuan, libksba.

> When cross compiling libassuan, I got the following warnings:
> configure: WARNING:
> ***
> *** Data structure for sending ancillary data missing.
> *** Descriptor passing won't work.
> ***
> ***
> *** No implementation of fopencookie or funopen available.
> *** The assuan_get_data_fp feature won't work.
> ***

That's okay.

> -L/home/heli/w32root/lib
[...]
> ../gl/libgnu.a ../common/libgpgrl.a -lz -lreadline -lws2_32 -
> lgcrypt -lassuan -lgpg-error /home/heli/w32root/lib/libiconv.dll.a -
> L/home/heli/w32root/lib

libassuan requires libws2_32 as well. Compare your ld command to mine:

../gl/libgnu.a ../common/libgpgrl.a -lz -lws2_32 -L/home/wk/w32root/lib
-lgcrypt -lgpg-error -L/home/wk/w32root/lib -lassuan -lws2_32
-L/home/wk/w32root/lib -lgpg-error

Here you see -lws2_w32 after -lassuan. This is because my
libassuan-config says this.

$ ~/w32root/bin/libassuan-config --libs
-L/home/wk/w32root/lib -lassuan -lws2_32

My conclusion is that you do did use "./autogen.sh --build-w32" for
libassuan or forgot to run "make install". The GnuPG build command is:

./configure --enable-maintainer-mode --prefix=${w32root} \
--host=${host} --build=${build} \
--with-gpg-error-prefix=${w32root} \
--with-ksba-prefix=${w32root} \
--with-libgcrypt-prefix=${w32root} \
--with-libassuan-prefix=${w32root} \
--with-zlib=${w32root} \
--with-regex=${w32root} \
--with-pth-prefix=${w32root} \
--with-adns=${w32root} \
--without-included-gettext "$@"

which uses "--with-libassuan-prefix=${w32root}" and thus takes
libassuan-config from ~/w32root/bin/.



Shalom-Salam,

Werner

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


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


i.demonstrate at gmail

Mar 9, 2009, 5:42 AM

Post #3 of 3 (490 views)
Permalink
Re: Cross compilation failed [In reply to]

On Friday 06 March 2009, Werner Koch wrote:
> My conclusion is that you do did use "./autogen.sh --build-w32" for
> libassuan or forgot to run "make install". The GnuPG build command
> is:
>
> ./configure --enable-maintainer-mode --prefix=${w32root} \
> --host=${host} --build=${build} \
> --with-gpg-error-prefix=${w32root} \
> --with-ksba-prefix=${w32root} \
> --with-libgcrypt-prefix=${w32root} \
> --with-libassuan-prefix=${w32root} \
> --with-zlib=${w32root} \
> --with-regex=${w32root} \
> --with-pth-prefix=${w32root} \
> --with-adns=${w32root} \
> --without-included-gettext "$@"
>
> which uses "--with-libassuan-prefix=${w32root}" and thus takes
> libassuan-config from ~/w32root/bin/.
>
>
>
> Shalom-Salam,
>
> Werner
Thanks a lot! It works now :-D

--
He, Li
Shanghai Key Lab of Intelligent Information Processing
School of Computer Science, Fudan University, Shanghai, China
E-mail: I.demonstrate [at] gmail
Attachments: signature.asc (0.82 KB)

GnuPG devel 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.