LevelDB 1.7 + windows updates (MinGW-w64, Boost 1.52, Precise gitian VM) #2106

Closed
wants to merge 9 commits into
from
View
@@ -33,18 +33,18 @@ contains(RELEASE, 1) {
}
}
-!win32 {
+# on Windows: use static linking
+win32:QMAKE_LFLAGS *= -static
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
QMAKE_CXXFLAGS *= -fstack-protector-all
QMAKE_LFLAGS *= -fstack-protector-all
-# We need to exclude this for Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable!
-# This can be enabled for Windows, when we switch to MinGW >= 4.4.x.
-}
# for extra security (see: https://wiki.debian.org/Hardening)
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
+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
contains(USE_QRCODE, 1) {
@@ -103,7 +103,8 @@ LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
isEmpty(QMAKE_RANLIB) {
QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
}
- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE CXXFLAGS="-I$$BOOST_INCLUDE_PATH" LDFLAGS="-L$$BOOST_LIB_PATH" $(MAKE) libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
+ LIBS += -lshlwapi
@Diapolo

Diapolo Jan 4, 2013

One comment, see line 388, where we also add shlwapi. Isn't that a pure Windows thing, where we can use win32.LIBS += -lshlwapi here and remove that library from line 388 below?

Edit: I made some tests and could remove that line here and it still links fine, because of line 388 I think :).

@sipa

sipa Jan 4, 2013

Owner

It's there to be sure shlwapi ends up in the linker command line after libleveldb.a, as that depends on shlwapi itself. It's possible it's right by default, but it won't hurt.

@Diapolo

Diapolo Jan 6, 2013

It' won't hurt, but IMO it would be cleaner to use win32.LIBS.

@sipa

sipa Jan 6, 2013

Owner

It's already inside a windows {} block, so that would be redundant.

+ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
}
genleveldb.target = $$PWD/src/leveldb/libleveldb.a
genleveldb.depends = FORCE
@@ -388,7 +389,6 @@ LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
# -lgdi32 has to happen after -lcrypto (see #681)
windows:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
-windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
contains(RELEASE, 1) {
!windows:!macx {
@@ -1,30 +1,30 @@
---
name: "boost"
suites:
-- "lucid"
+- "precise"
architectures:
- "i386"
packages:
-- "mingw32"
+- "mingw-w64"
- "faketime"
- "zip"
reference_datetime: "2011-01-30 00:00:00"
remotes: []
files:
-- "boost_1_50_0.tar.bz2"
+- "boost_1_52_0.tar.bz2"
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++
+ tar xjf boost_1_52_0.tar.bz2
+ cd boost_1_52_0
+ echo "using gcc : 4.6 : i686-w64-mingw32-g++
:
- <rc>i586-mingw32msvc-windres
- <archiver>i586-mingw32msvc-ar
+ <rc>i686-w64-mingw32-windres
+ <archiver>i686-w64-mingw32-ar
<cxxflags>-frandom-seed=boost1
;" > 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
+ ./bootstrap.sh --without-icu --without-libraries=context
+ ./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python --without-context -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)
@@ -34,5 +34,5 @@ script: |
cd $TMPDIR
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-w64-win32-1.52.0-gitian.zip *
+ cp boost-w64-win32-1.52.0-gitian.zip $OUTDIR
@@ -1,15 +1,16 @@
---
name: "bitcoin-deps"
suites:
-- "lucid"
+- "precise"
architectures:
- "i386"
packages:
-- "mingw32"
+- "mingw-w64"
- "git-core"
- "zip"
- "faketime"
- "wine"
+- "psmisc"
reference_datetime: "2011-01-30 00:00:00"
remotes: []
files:
@@ -27,42 +28,42 @@ script: |
#
tar xzf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c
- ./Configure --cross-compile-prefix=i586-mingw32msvc- mingw
+ ./Configure --cross-compile-prefix=i686-w64-mingw32- mingw
make
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"
+ ../dist/configure --enable-mingw --enable-cxx --host=i686-w64-mingw32 CFLAGS="-I/usr/i686-w64-mingw32/include"
make $MAKEOPTS
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
+ make -f Makefile.mingw DLLWRAP=i686-w64-mingw32-dllwrap CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar
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
+ make -f win32/Makefile.gcc PREFIX=i686-w64-mingw32- $MAKEOPTS
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/"
+ ./configure -disable-shared CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar STRIP=i686-w64-mingw32-strip RANLIB=i686-w64-mingw32-ranlib OBJDUMP=i686-w64-mingw32-objdump LD=i686-w64-mingw32-ld LDFLAGS="-L../zlib-1.2.6/" CFLAGS="-I../zlib-1.2.6/"
make $MAKEOPTS
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"
+ ./configure --build=mingw32 CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar STRIP=i686-w64-mingw32-strip RANLIB=i686-w64-mingw32-ranlib OBJDUMP=i686-w64-mingw32-objdump LD=i686-w64-mingw32-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
cd ..
#
- zip -r $OUTDIR/bitcoin-deps-0.0.5.zip \
+ zip -r $OUTDIR/bitcoin-deps-w64-win32-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) \
@@ -1,11 +1,11 @@
---
name: "bitcoin"
suites:
-- "lucid"
+- "precise"
architectures:
- "i386"
packages:
-- "mingw32"
+- "g++-mingw-w64"
- "git-core"
- "unzip"
- "nsis"
@@ -15,31 +15,31 @@ remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin"
files:
-- "qt-win32-4.8.3-gitian-r1.zip"
-- "boost-win32-1.50.0-gitian2.zip"
-- "bitcoin-deps-0.0.5.zip"
+- "qt-w64-win32-4.8.3-gitian-r1.zip"
+- "boost-w64-win32-1.52.0-gitian.zip"
+- "bitcoin-deps-w64-win32-0.0.5.zip"
script: |
#
mkdir $HOME/qt
cd $HOME/qt
- unzip ../build/qt-win32-4.8.3-gitian-r1.zip
+ unzip ../build/qt-w64-win32-4.8.3-gitian-r1.zip
cd $HOME/build/
export PATH=$PATH:$HOME/qt/bin/
#
- mkdir boost_1_50_0
- cd boost_1_50_0
+ mkdir boost_1_52_0
+ cd boost_1_52_0
mkdir -p stage/lib
- unzip ../boost-win32-1.50.0-gitian2.zip
+ unzip ../boost-w64-win32-1.52.0-gitian.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
+ i686-w64-mingw32-ar rc ../../stage/lib/libboost_${lib}-mt-s.a $lib/*.o
+ i686-w64-mingw32-ranlib ../../stage/lib/libboost_${lib}-mt-s.a
done
cd ../..
mv include/boost .
cd ..
#
- unzip bitcoin-deps-0.0.5.zip
+ unzip bitcoin-deps-w64-win32-0.0.5.zip
#
find -type f | xargs touch --date="$REFERENCE_DATETIME"
#
@@ -51,7 +51,7 @@ 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=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1
+ $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_52_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_52_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=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1
make $MAKEOPTS
cp release/bitcoin-qt.exe $OUTDIR/
#
@@ -60,7 +60,8 @@ script: |
export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC
make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoind.exe USE_UPNP=0 DEBUGFLAGS="-frandom-seed=bitcoin"
- i586-mingw32msvc-strip bitcoind.exe
+ i686-w64-mingw32-strip bitcoind.exe
+
mkdir $OUTDIR/daemon
cp bitcoind.exe $OUTDIR/daemon
cd ..
@@ -1,11 +1,11 @@
---
name: "qt"
suites:
-- "lucid"
+- "precise"
architectures:
- "i386"
packages:
-- "mingw32"
+- "mingw-w64"
- "zip"
- "faketime"
reference_datetime: "2011-01-30 00:00:00"
@@ -21,21 +21,21 @@ script: |
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-/i686-w64-mingw32-/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
+ sed --posix 's|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/i686-w64-mingw32/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= i686-w64-mingw32-moc/QMAKE_MOC\t\t= moc/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
+ sed --posix 's/QMAKE_RCC\t\t= i686-w64-mingw32-rcc/QMAKE_RCC\t\t= rcc/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
+ sed --posix 's/QMAKE_UIC\t\t= i686-w64-mingw32-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= i686-w64-mingw32-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 'i686-w64-mingw32-ar "$@"' >> $HOME/ar
chmod +x $HOME/ar
#export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
@@ -51,4 +51,4 @@ script: |
# 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-w64-win32-4.8.3-gitian-r1.zip *
View
@@ -6,3 +6,7 @@ build_config.mk
*.so.*
*_test
db_bench
+Release
+Debug
+Benchmark
+vs2010.*
Oops, something went wrong.