@@ -21,6 +21,7 @@ script: |
21
21
# Defines
22
22
export TZ=UTC
23
23
INDIR=$HOME/build
24
+ TEMPDIR=$HOME/tmp
24
25
# Qt: workaround for determinism in resource ordering
25
26
# Qt5's rcc uses a QHash to store the files for the resource.
26
27
# A security fix in QHash makes the ordering of keys to be different on every run
@@ -58,21 +59,34 @@ script: |
58
59
sed 's/qt_instdate=`date +%Y-%m-%d`/qt_instdate=2011-01-30/' -i qtbase/configure
59
60
sed --posix "s|QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport|QMAKE_CFLAGS\t\t= -pipe -fno-keep-inline-dllexport -isystem /usr/$HOST/include/ -frandom-seed=qtbuild -I$DEPSDIR/include|" -i ${SPECFILE}
60
61
sed --posix "s|QMAKE_LFLAGS =|QMAKE_LFLAGS\t\t= -L$DEPSDIR/lib|" -i ${SPECFILE}
62
+ # Before we tried to pass arguments to ar (static linking) in using QMAKE_LIB, however
63
+ # qt removes the arguments for ar and provides a script which makes it impossible to pass the determinism flag -
64
+ # so rather than try to replace ar, post-process all libraries and plugins at the end.
65
+ #
61
66
# Don't load faketime while compiling Qt, qmake will get stuck in nearly infinite loops
62
67
#export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
63
- export FAKETIME=$REFERENCE_DATETIME
68
+ # export FAKETIME=$REFERENCE_DATETIME
64
69
#
65
70
# Compile static libraries, and use statically linked openssl (-openssl-linked):
66
71
OPENSSL_LIBS="-L$DEPSDIR/lib -lssl -lcrypto -lgdi32" ./configure -prefix $INSTALLPREFIX -bindir $INSTALLPREFIX/host/bin -confirm-license -release -opensource -static -xplatform $SPECNAME -device-option CROSS_COMPILE="$HOST-" -no-audio-backend -no-javascript-jit -no-sql-sqlite -no-sql-odbc -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-opengl -no-compile-examples -no-feature-style-windowsce -no-feature-style-windowsmobile -no-qml-debug -openssl-linked -skip qtsvg -skip qtwebkit -skip qtwebkit-examples -skip qtserialport -skip qtdeclarative -skip qtmultimedia -skip qtimageformats -skip qtlocation -skip qtsensors -skip qtquick1 -skip qtquickcontrols -skip qtactiveqt -skip qtconnectivity -skip qtwinextras -skip qtxmlpatterns -skip qtscript -skip qtdoc -system-libpng -system-zlib
67
72
make $MAKEOPTS install
73
+ # post-process all generated libraries and plugins to be deterministic
74
+ # extract them to a temporary directory then re-build them deterministically
75
+ for LIB in $(find $INSTALLPREFIX -name *.a); do
76
+ rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR
77
+ $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt
78
+ rm $LIB
79
+ $HOST-ar crsD $LIB $(cat /tmp/list.txt)
80
+ done
68
81
#
69
82
cd $INSTALLPREFIX
70
83
# Remove unused non-deterministic stuff
71
84
rm host/bin/qtpaths.exe lib/libQt5Bootstrap.a lib/libQt5Bootstrap.la
72
85
# as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date
73
86
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
87
+ export FAKETIME=$REFERENCE_DATETIME
74
88
find -print0 | xargs -r0 touch # fix up timestamps before packaging
75
- find | sort | zip -@ $OUTDIR/qt-win${BITS}-5.2.0-gitian-r2.zip
89
+ find | sort | zip -X @ $OUTDIR/qt-win${BITS}-5.2.0-gitian-r2.zip
76
90
unset LD_PRELOAD
77
91
unset FAKETIME
78
92
done # for BITS in
0 commit comments