Bitcoin Forum
May 04, 2024, 06:54:10 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Gitian windows compile on ubuntu  (Read 1769 times)
TierNolan (OP)
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
August 18, 2013, 04:12:09 PM
Last edit: August 18, 2013, 04:22:12 PM by TierNolan
 #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
1714848850
Hero Member
*
Offline Offline

Posts: 1714848850

View Profile Personal Message (Offline)

Ignore
1714848850
Reply with quote  #2

1714848850
Report to moderator
1714848850
Hero Member
*
Offline Offline

Posts: 1714848850

View Profile Personal Message (Offline)

Ignore
1714848850
Reply with quote  #2

1714848850
Report to moderator
1714848850
Hero Member
*
Offline Offline

Posts: 1714848850

View Profile Personal Message (Offline)

Ignore
1714848850
Reply with quote  #2

1714848850
Report to moderator
Even in the event that an attacker gains more than 50% of the network's computational power, only transactions sent by the attacker could be reversed or double-spent. The network would not be destroyed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714848850
Hero Member
*
Offline Offline

Posts: 1714848850

View Profile Personal Message (Offline)

Ignore
1714848850
Reply with quote  #2

1714848850
Report to moderator
1714848850
Hero Member
*
Offline Offline

Posts: 1714848850

View Profile Personal Message (Offline)

Ignore
1714848850
Reply with quote  #2

1714848850
Report to moderator
TierNolan (OP)
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!