Bitcoin Forum
October 18, 2017, 05:09:22 PM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Gitian windows compile on ubuntu  (Read 1584 times)
TierNolan
Legendary
*
Offline Offline

Activity: 1120


View Profile
August 18, 2013, 04:12:09 PM
 #1

I am trying to compile using gitian using Ubuntu (so cross-compile for windows).

I have it mostly working.  However, I can get miniupnpc to work.

There is an executable "wingenminiupnpcstrings" that is generated during the building process.

The issue can be replicated with

Code:
wget -O miniupnpc-1.6.tar.gz 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.tar.gz'

tar xzf miniupnpc-1.6.tar.gz

cd miniupnpc-1.6/

make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar

The error it gives is

Code:
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o upnpc.o upnpc.c
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -c -o dll/upnpc.o upnpc.c
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o wingenminiupnpcstrings.o wingenminiupnpcstrings.c
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/wingenminiupnpcstrings.o wingenminiupnpcstrings.c
i586-mingw32msvc-gcc   wingenminiupnpcstrings.o  -lws2_32 -liphlpapi -o wingenminiupnpcstrings
wingenminiupnpcstrings miniupnpcstrings.h.in miniupnpcstrings.h
make: wingenminiupnpcstrings: Command not found
make: *** [miniupnpcstrings.h] Error 127

What is happening is that it is generating "wingenminiupnpcstrings" as a windows executable, but it can't run the .exe, since it is cross compiled.

A simple workaround is to generate the file using linux, but then it gives the wrong string.

If i added the 2 sed commands to update the make file, I get this

Code:
i586-mingw32msvc-ar
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o upnpc.o upnpc.c
i586-mingw32msvc-gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -c -o dll/upnpc.o upnpc.c
i586-mingw32msvc-gcc   wingenminiupnpcstrings.o  -lws2_32 -liphlpapi -o wingenminiupnpcstrings
./wingenminiupnpcstrings miniupnpcstrings.h.in miniupnpcstrings.h
./wingenminiupnpcstrings: 1: ./wingenminiupnpcstrings: MZ����@���: not found
./wingenminiupnpcstrings: 1: ./wingenminiupnpcstrings: .data: not found
./wingenminiupnpcstrings: 2: ./wingenminiupnpcstrings: 6�R2��
                                                                 0: not found
./wingenminiupnpcstrings: 10: ./wingenminiupnpcstrings: Syntax error: Unterminated quoted string
[/quote]

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
1508346562
Hero Member
*
Offline Offline

Posts: 1508346562

View Profile Personal Message (Offline)

Ignore
1508346562
Reply with quote  #2

1508346562
Report to moderator
1508346562
Hero Member
*
Offline Offline

Posts: 1508346562

View Profile Personal Message (Offline)

Ignore
1508346562
Reply with quote  #2

1508346562
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1508346562
Hero Member
*
Offline Offline

Posts: 1508346562

View Profile Personal Message (Offline)

Ignore
1508346562
Reply with quote  #2

1508346562
Report to moderator
1508346562
Hero Member
*
Offline Offline

Posts: 1508346562

View Profile Personal Message (Offline)

Ignore
1508346562
Reply with quote  #2

1508346562
Report to moderator
TierNolan
Legendary
*
Offline Offline

Activity: 1120


View Profile
August 18, 2013, 04:36:46 PM
 #2

Looks like installing wine on the host fixes it.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!