From 0fef3d3fdd51150fd4d54a6b1bcd56ac67068797 Mon Sep 17 00:00:00 2001 From: Warren Togami Date: Thu, 10 Oct 2013 15:19:44 -1000 Subject: [PATCH] Litecoin: Upgrade gitian win32 to Precise 12.04 and boost-1.54 mingw upgrade allows more hardening, compiler bug fixes and possibily win64 later. Rename deps .zip files to be more consistent in revision format. Litecoin: Reuse bitcoin-0.9 win32 deps. --- bitcoin-qt.pro | 8 ++- contrib/gitian-descriptors/boost-win32.yml | 72 ++++++++++++++------- contrib/gitian-descriptors/deps-win32.yml | 67 ++++++++++++------- contrib/gitian-descriptors/gitian-win32.yml | 52 ++++++--------- contrib/gitian-descriptors/qt-win32.yml | 41 +++++++----- src/makefile.linux-mingw | 18 ++---- 6 files changed, 154 insertions(+), 104 deletions(-) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 81d7367c2..a7fbc2721 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -49,6 +49,8 @@ QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat # on Windows: enable GCC large address aware linker flag win32:QMAKE_LFLAGS *= -Wl,--large-address-aware +# i686-w64-mingw32 +win32:QMAKE_LFLAGS *= -static-libgcc -static-libstdc++ # use: qmake "USE_QRCODE=1" # libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support @@ -317,8 +319,12 @@ DEFINES += BITCOIN_QT_TEST } contains(USE_SSE2, 1) { -SOURCES += src/scrypt-sse2.cpp DEFINES += USE_SSE2 +gccsse2.input = SOURCES_SSE2 +gccsse2.output = $$PWD/build/${QMAKE_FILE_BASE}.o +gccsse2.commands = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -msse2 +QMAKE_EXTRA_COMPILERS += gccsse2 +SOURCES_SSE2 += src/scrypt-sse2.cpp } # Todo: Remove this line when switching to Qt5, as that option was removed diff --git a/contrib/gitian-descriptors/boost-win32.yml b/contrib/gitian-descriptors/boost-win32.yml index 1eeb9eaa2..b421cbe8c 100644 --- a/contrib/gitian-descriptors/boost-win32.yml +++ b/contrib/gitian-descriptors/boost-win32.yml @@ -1,38 +1,66 @@ --- name: "boost" suites: -- "lucid" +- "precise" architectures: -- "i386" -packages: -- "mingw32" +- "amd64" +packages: +- "mingw-w64" +- "g++-mingw-w64" - "faketime" - "zip" reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "boost_1_50_0.tar.bz2" +- "boost_1_54_0.tar.bz2" +- "boost-mingw-gas-cross-compile-2013-03-03.patch" script: | - TMPDIR="$HOME/tmpdir" - mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include - tar xjf boost_1_50_0.tar.bz2 - cd boost_1_50_0 - echo "using gcc : 4.4 : i586-mingw32msvc-g++ + # Defines + INSTALLPREFIX="$OUTDIR/staging/boost" + HOST=i686-w64-mingw32 + # Input Integrity Check + echo "047e927de336af106a24bceba30069980c191529fd76b8dff8eb9a328b48ae1d boost_1_54_0.tar.bz2" | shasum -c + echo "d2b7f6a1d7051faef3c9cf41a92fa3671d905ef1e1da920d07651a43299f6268 boost-mingw-gas-cross-compile-2013-03-03.patch" | shasum -c + + mkdir -p "$INSTALLPREFIX" + tar xjf boost_1_54_0.tar.bz2 + cd boost_1_54_0 + GCCVERSION=$($HOST-g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) + echo "using gcc : $GCCVERSION : $HOST-g++ : - i586-mingw32msvc-windres - i586-mingw32msvc-ar + $HOST-windres + $HOST-ar -frandom-seed=boost1 + $HOST-ranlib ;" > user-config.jam ./bootstrap.sh --without-icu - ./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage - for lib in chrono date_time exception filesystem graph iostreams math_c99f math_c99l math_c99 math_tr1f math_tr1l math_tr1 prg_exec_monitor program_options random regex serialization signals system test_exec_monitor thread_win32 unit_test_framework wave wserialization; do - mkdir $lib - (cd $lib ; ar xf ../stage/lib/libboost_${lib}-mt-s.a) - mv $lib $TMPDIR/bin/$GBUILD_BITS - done - cp -a boost $TMPDIR/include - cd $TMPDIR + + # Workaround: Upstream boost dev refuses to include patch that would allow Free Software cross-compile toolchain to work + # This patch was authored by the Fedora package developer and ships in Fedora's mingw32-boost. + # Please obtain the exact patch that matches the above sha256sum from one of the following mirrors. + # + # Read History: https://svn.boost.org/trac/boost/ticket/7262 + # History Mirror: http://rose.makesad.us/~paulproteus/mirrors/7262%20Boost.Context%20fails%20to%20build%20using%20MinGW.html + # + # Patch: https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch + # Patch Mirror: http://wtogami.fedorapeople.org/boost-mingw-gas-cross-compile-2013-03-03.patch + # Patch Mirror: http://mindstalk.net/host/boost-mingw-gas-cross-compile-2013-03-03.patch + # Patch Mirror: http://rose.makesad.us/~paulproteus/mirrors/boost-mingw-gas-cross-compile-2013-03-03.patch + patch -p0 < ../boost-mingw-gas-cross-compile-2013-03-03.patch + + # Bug Workaround: boost-1.54.0 broke the ability to disable zlib + # https://svn.boost.org/trac/boost/ticket/9156 + sed -i 's^\[ ac.check-library /zlib//zlib : /zlib//zlib^^' libs/iostreams/build/Jamfile.v2 + sed -i 's^zlib.cpp gzip.cpp \]^^' libs/iostreams/build/Jamfile.v2 + + # http://statmt.org/~s0565741/software/boost_1_52_0/libs/context/doc/html/context/requirements.html + # Note: Might need these options in the future for 64bit builds. + # "Please note that address-model=64 must be given to bjam command line on 64bit Windows for 64bit build; otherwise 32bit code will be generated." + # "For cross-compiling the lib you must specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model." + ./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install + + cd "$INSTALLPREFIX" export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME - zip -r boost-win32-1.50.0-gitian2.zip * - cp boost-win32-1.50.0-gitian2.zip $OUTDIR + zip -r boost-win32-1.54.0-gitian-r6.zip * + cp boost-win32-1.54.0-gitian-r6.zip $OUTDIR diff --git a/contrib/gitian-descriptors/deps-win32.yml b/contrib/gitian-descriptors/deps-win32.yml index 92892b4d7..7ad00fcb0 100644 --- a/contrib/gitian-descriptors/deps-win32.yml +++ b/contrib/gitian-descriptors/deps-win32.yml @@ -1,15 +1,15 @@ --- -name: "litecoin-deps" +name: "bitcoin-deps" suites: -- "lucid" +- "precise" architectures: -- "i386" +- "amd64" packages: -- "mingw32" +- "mingw-w64" +- "g++-mingw-w64" - "git-core" - "zip" - "faketime" -- "wine" - "psmisc" reference_datetime: "2011-01-30 00:00:00" remotes: [] @@ -25,48 +25,69 @@ script: | export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC + export INSTALLPREFIX=$OUTDIR/staging/deps + export HOST=i686-w64-mingw32 # + mkdir -p $INSTALLPREFIX + tar xzf openssl-1.0.1c.tar.gz cd openssl-1.0.1c - ./Configure --cross-compile-prefix=i586-mingw32msvc- mingw + ./Configure --cross-compile-prefix=$HOST- mingw --openssldir=$INSTALLPREFIX make + make install_sw cd .. # tar xzf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix - ../dist/configure --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include" - make $MAKEOPTS + ../dist/configure --prefix=$INSTALLPREFIX --enable-mingw --enable-cxx --host=$HOST --disable-shared + make $MAKEOPTS library_build + make install_lib install_include cd ../.. # tar xzf miniupnpc-1.6.tar.gz cd miniupnpc-1.6 - sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw - sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw - make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar + echo " + --- miniupnpc-1.6/Makefile.mingw.orig 2013-09-29 18:52:51.014087958 -1000 + +++ miniupnpc-1.6/Makefile.mingw 2013-09-29 19:09:29.663318691 -1000 + @@ -67,8 +67,8 @@ + + wingenminiupnpcstrings.o: wingenminiupnpcstrings.c + + -miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings + - wingenminiupnpcstrings \$< \$@ + +miniupnpcstrings.h: miniupnpcstrings.h.in + + sed -e 's|OS/version|MSWindows/5.1.2600|' -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"VERSIONHERE\"|' \$< > \$@ + + minixml.o: minixml.c minixml.h miniupnpcstrings.h + + " | sed "s/VERSIONHERE/$(cat VERSION)/" | patch -p1 + mkdir -p dll + make -f Makefile.mingw CC=$HOST-gcc AR=$HOST-ar libminiupnpc.a + install -d $INSTALLPREFIX/include/miniupnpc + install *.h $INSTALLPREFIX/include/miniupnpc + install libminiupnpc.a $INSTALLPREFIX/lib cd .. - mv miniupnpc-1.6 miniupnpc # tar xzf zlib-1.2.6.tar.gz cd zlib-1.2.6 - make -f win32/Makefile.gcc PREFIX=i586-mingw32msvc- $MAKEOPTS + CROSS_PREFIX=$HOST- ./configure --prefix=$INSTALLPREFIX --static + make + make install cd .. # tar xzf libpng-1.5.9.tar.gz cd libpng-1.5.9 - ./configure -disable-shared CC=i586-mingw32msvc-cc AR=i586-mingw32msvc-ar STRIP=i586-mingw32msvc-strip RANLIB=i586-mingw32msvc-ranlib OBJDUMP=i586-mingw32msvc-objdump LD=i586-mingw32msvc-ld LDFLAGS="-L../zlib-1.2.6/" CFLAGS="-I../zlib-1.2.6/" + CFLAGS="-I$INSTALLPREFIX/include" LDFLAGS="-L$INSTALLPREFIX/lib" ./configure --disable-shared --prefix=$INSTALLPREFIX --host=$HOST make $MAKEOPTS + make install cd .. # tar xjf qrencode-3.2.0.tar.bz2 cd qrencode-3.2.0 - ./configure CC=i586-mingw32msvc-cc AR=i586-mingw32msvc-ar STRIP=i586-mingw32msvc-strip RANLIB=i586-mingw32msvc-ranlib OBJDUMP=i586-mingw32msvc-objdump LD=i586-mingw32msvc-ld png_LIBS="../libpng-1.5.9/.libs/libpng15.a ../zlib-1.2.6/libz.a" png_CFLAGS="-I../libpng-1.5.9" - make $MAKEOPTS + png_CFLAGS="-I$INSTALLPREFIX/include" png_LIBS="-L$INSTALLPREFIX/lib -lpng" ./configure --prefix=$INSTALLPREFIX --host=$HOST + make + make install cd .. # - zip -r $OUTDIR/litecoin-deps-0.0.5.zip \ - $(ls qrencode-*/{qrencode.h,.libs/libqrencode.{,l}a} | sort) \ - $(ls db-*/build_unix/{libdb_cxx.a,db.h,db_cxx.h,libdb.a,.libs/libdb_cxx-?.?.a} | sort) \ - $(find openssl-* -name '*.a' -o -name '*.h' | sort) \ - $(find miniupnpc -name '*.h' -o -name 'libminiupnpc.a' | sort) - # Kill wine processes as gitian won't figure out we are done otherwise - killall wineserver services.exe explorer.exe winedevice.exe + cd $INSTALLPREFIX + zip -r $OUTDIR/bitcoin-deps-win32-gitian-r9.zip include lib diff --git a/contrib/gitian-descriptors/gitian-win32.yml b/contrib/gitian-descriptors/gitian-win32.yml index f1694e010..c44e95ef9 100644 --- a/contrib/gitian-descriptors/gitian-win32.yml +++ b/contrib/gitian-descriptors/gitian-win32.yml @@ -1,11 +1,12 @@ --- name: "litecoin" suites: -- "lucid" +- "precise" architectures: -- "i386" +- "amd64" packages: -- "mingw32" +- "mingw-w64" +- "g++-mingw-w64" - "git-core" - "unzip" - "nsis" @@ -15,35 +16,23 @@ remotes: - "url": "https://github.com/litecoin-project/litecoin.git" "dir": "litecoin" files: -- "qt-win32-4.8.3-gitian-r1.zip" -- "boost-win32-1.50.0-gitian2.zip" -- "litecoin-deps-0.0.5.zip" +- "qt-win32-4.8.3-gitian-r4.zip" +- "boost-win32-1.54.0-gitian-r6.zip" +- "bitcoin-deps-win32-gitian-r9.zip" script: | # - mkdir $HOME/qt - cd $HOME/qt - unzip ../build/qt-win32-4.8.3-gitian-r1.zip - cd $HOME/build/ - export PATH=$HOME/qt/bin/:$PATH - # - mkdir boost_1_50_0 - cd boost_1_50_0 - mkdir -p stage/lib - unzip ../boost-win32-1.50.0-gitian2.zip - cd bin/$GBUILD_BITS - for lib in *; do - i586-mingw32msvc-ar rc ../../stage/lib/libboost_${lib}-mt-s.a $lib/*.o - i586-mingw32msvc-ranlib ../../stage/lib/libboost_${lib}-mt-s.a - done - cd ../.. - mv include/boost . - cd .. + STAGING=$HOME/staging + HOST=i686-w64-mingw32 # - unzip litecoin-deps-0.0.5.zip - # - find -type f | xargs touch --date="$REFERENCE_DATETIME" + mkdir -p $STAGING + cd $STAGING + unzip ../build/qt-win32-4.8.3-gitian-r4.zip + unzip ../build/boost-win32-1.54.0-gitian-r6.zip + unzip ../build/bitcoin-deps-win32-gitian-r9.zip + cd $HOME/build/ # cd litecoin + export PATH=$STAGING/host/bin:$PATH mkdir -p $OUTDIR/src git archive HEAD | tar -x -C $OUTDIR/src cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt @@ -51,17 +40,18 @@ script: | export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_50_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_50_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1c OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1c/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=litecoin USE_BUILD_INFO=1 USE_SSE2=1 + ln -s $STAGING $HOME/qt + $HOME/staging/host/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$STAGING MINIUPNPC_INCLUDE_PATH=$STAGING BDB_LIB_PATH=$STAGING BDB_INCLUDE_PATH=$STAGING BOOST_LIB_PATH=$STAGING BOOST_INCLUDE_PATH=$STAGING BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$STAGING OPENSSL_INCLUDE_PATH=$STAGING QRENCODE_LIB_PATH=$STAGING QRENCODE_INCLUDE_PATH=$STAGING USE_QRCODE=1 INCLUDEPATH=$STAGING DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=litecoin USE_SSE2=1 make $MAKEOPTS - i586-mingw32msvc-strip release/litecoin-qt.exe + $HOST-strip release/litecoin-qt.exe cp release/litecoin-qt.exe $OUTDIR/ # cd src export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build litecoind.exe USE_UPNP=0 DEBUGFLAGS="-frandom-seed=litecoin" USE_SSE2=1 - i586-mingw32msvc-strip litecoind.exe + make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$STAGING litecoind.exe USE_UPNP=0 DEBUGFLAGS="-frandom-seed=litecoin" USE_SSE2=1 + $HOST-strip litecoind.exe mkdir $OUTDIR/daemon cp litecoind.exe $OUTDIR/daemon cd .. diff --git a/contrib/gitian-descriptors/qt-win32.yml b/contrib/gitian-descriptors/qt-win32.yml index 0b711790e..1fc6f861e 100644 --- a/contrib/gitian-descriptors/qt-win32.yml +++ b/contrib/gitian-descriptors/qt-win32.yml @@ -1,54 +1,63 @@ --- name: "qt" suites: -- "lucid" +- "precise" architectures: -- "i386" +- "amd64" packages: -- "mingw32" +- "mingw-w64" +- "g++-mingw-w64" - "zip" +- "unzip" - "faketime" +- "unzip" reference_datetime: "2011-01-30 00:00:00" remotes: [] files: - "qt-everywhere-opensource-src-4.8.3.tar.gz" +- "bitcoin-deps-win32-gitian-r9.zip" script: | + # + HOST=i686-w64-mingw32 INSTDIR="$HOME/qt/" + # mkdir $INSTDIR - SRCDIR="$INSTDIR/src/" - mkdir $SRCDIR + mkdir -p $INSTDIR/host/bin + # + # Need mingw-compiled openssl from bitcoin-deps: + unzip bitcoin-deps-win32-gitian-r9.zip + DEPSDIR=`pwd` # tar xzf qt-everywhere-opensource-src-4.8.3.tar.gz cd qt-everywhere-opensource-src-4.8.3 sed 's/$TODAY/2011-01-30/' -i configure - sed 's/i686-pc-mingw32-/i586-mingw32msvc-/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed --posix 's|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/i586-mingw32msvc/include/ -frandom-seed=qtbuild|' -i mkspecs/unsupported/win32-g++-cross/qmake.conf + sed "s/i686-pc-mingw32-/$HOST-/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf + sed --posix "s|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/$HOST/include/ -frandom-seed=qtbuild|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed 's/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed 's/QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads/QMAKE_LFLAGS_EXCEPTIONS_ON = -lmingwthrd/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed --posix 's/QMAKE_MOC\t\t= i586-mingw32msvc-moc/QMAKE_MOC\t\t= moc/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed --posix 's/QMAKE_RCC\t\t= i586-mingw32msvc-rcc/QMAKE_RCC\t\t= rcc/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf - sed --posix 's/QMAKE_UIC\t\t= i586-mingw32msvc-uic/QMAKE_UIC\t\t= uic/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf + sed --posix "s/QMAKE_MOC\t\t= $HOST-moc/QMAKE_MOC\t\t= moc/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf + sed --posix "s/QMAKE_RCC\t\t= $HOST-rcc/QMAKE_RCC\t\t= rcc/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf + sed --posix "s/QMAKE_UIC\t\t= $HOST-uic/QMAKE_UIC\t\t= uic/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf # ar adds timestamps to every object file included in the static library # providing -D as ar argument is supposed to solve it, but doesn't work as qmake strips off the arguments and adds -M to pass a script... # which somehow cannot be combined with other flags. # use faketime only for ar, as it confuses make/qmake into hanging sometimes - sed --posix "s|QMAKE_LIB\t\t= i586-mingw32msvc-ar -ru|QMAKE_LIB\t\t= $HOME/ar -Dr|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf + sed --posix "s|QMAKE_LIB\t\t= $HOST-ar -ru|QMAKE_LIB\t\t= $HOME/ar -Dr|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf echo '#!/bin/bash' > $HOME/ar echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar - echo 'i586-mingw32msvc-ar "$@"' >> $HOME/ar + echo "$HOST-ar \"\$@\"" >> $HOME/ar chmod +x $HOME/ar #export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - ./configure -prefix $INSTDIR -confirm-license -release -opensource -static -no-qt3support -xplatform unsupported/win32-g++-cross -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs -no-feature-style-plastique -no-feature-style-cleanlooks -no-feature-style-motif -no-feature-style-cde -no-feature-style-windowsce -no-feature-style-windowsmobile -no-feature-style-s60 + # Compile static libraries, and use statically linked openssl (-openssl-linked): + OPENSSL_LIBS="-L$DEPSDIR/lib -lssl -lcrypto -lgdi32" ./configure -prefix $INSTDIR -bindir $INSTDIR/host/bin -I $DEPSDIR/include -confirm-license -release -opensource -static -no-qt3support -xplatform unsupported/win32-g++-cross -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs -no-feature-style-plastique -no-feature-style-cleanlooks -no-feature-style-motif -no-feature-style-cde -no-feature-style-windowsce -no-feature-style-windowsmobile -no-feature-style-s60 -openssl-linked find . -name *.prl | xargs -l sed 's|/\.||' -i find . -name *.prl | xargs -l sed 's|/$||' -i make $MAKEOPTS install - cp -a bin $SRCDIR/ cd $INSTDIR find . -name *.prl | xargs -l sed 's|/$||' -i - #sed 's|QMAKE_PRL_LIBS.*|QMAKE_PRL_LIBS = -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtNetwork -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32|' -i imports/Qt/labs/particles/qmlparticlesplugin.prl # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - zip -r $OUTDIR/qt-win32-4.8.3-gitian-r1.zip * + zip -r $OUTDIR/qt-win32-4.8.3-gitian-r4.zip * diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index 037abbc07..afb69020c 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -2,10 +2,10 @@ # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -DEPSDIR:=/usr/i586-mingw32msvc +DEPSDIR:=/usr/i686-w64-mingw32 -CC := i586-mingw32msvc-gcc -CXX := i586-mingw32msvc-g++ +CC := i686-w64-mingw32-gcc +CXX := i686-w64-mingw32-g++ USE_UPNP:=0 USE_IPV6:=1 @@ -13,15 +13,11 @@ USE_IPV6:=1 INCLUDEPATHS= \ -I"$(CURDIR)" \ -I"$(CURDIR)"/obj \ - -I"$(DEPSDIR)/boost_1_50_0" \ - -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ - -I"$(DEPSDIR)/openssl-1.0.1c/include" \ + -I"$(DEPSDIR)/include" \ -I"$(DEPSDIR)" LIBPATHS= \ - -L"$(DEPSDIR)/boost_1_50_0/stage/lib" \ - -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ - -L"$(DEPSDIR)/openssl-1.0.1c" + -L"$(DEPSDIR)/lib" LIBS= \ $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a \ @@ -38,7 +34,7 @@ DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE DEBUGFLAGS=-g xCXXFLAGS=-O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) $(CXXFLAGS) # enable: ASLR, DEP and large address aware -xLDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware $(LDFLAGS) +xLDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware -static-libgcc -static-libstdc++ $(LDFLAGS) TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) @@ -105,7 +101,7 @@ all: litecoind.exe DEFS += -I"$(CURDIR)/leveldb/include" DEFS += -I"$(CURDIR)/leveldb/helpers" leveldb/libleveldb.a: - @echo "Building LevelDB ..." && cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && i586-mingw32msvc-ranlib libleveldb.a && i586-mingw32msvc-ranlib libmemenv.a && cd .. + @echo "Building LevelDB ..." && cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && i686-w64-mingw32-ranlib libleveldb.a && i686-w64-mingw32-ranlib libmemenv.a && cd .. obj/build.h: FORCE /bin/sh ../share/genbuild.sh obj/build.h