commit 4330efe4dab4be54cc5db528d2c1cba5e6e0f567 Author: Mike Perry mikeperry-git@torproject.org Date: Tue Sep 17 13:31:56 2013 -0700
Create separate debuginfo files for our Linux build. --- gitian/descriptors/linux/gitian-firefox.yml | 16 ++++++++++-- gitian/descriptors/linux/gitian-tor.yml | 36 ++++++++++++++++++++++----- gitian/mkbundle-linux.sh | 2 ++ 3 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/gitian/descriptors/linux/gitian-firefox.yml b/gitian/descriptors/linux/gitian-firefox.yml index f45d71e..013e972 100644 --- a/gitian/descriptors/linux/gitian-firefox.yml +++ b/gitian/descriptors/linux/gitian-firefox.yml @@ -54,6 +54,7 @@ script: | export PATH=$PATH:$INSTDIR/build/bin # mkdir -p $INSTDIR/App/Firefox/ + mkdir -p $INSTDIR/Debug/App/Firefox/ # cd tor-browser grep -v '^pref("torbrowser.version",' browser/app/profile/000-tor-browser.js > browser/app/profile/000-tor-browser.js.fixed @@ -68,9 +69,7 @@ script: | make -f client.mk configure find -type f | xargs touch --date="$REFERENCE_DATETIME" # - # The build sometimes randomly fails (faketime issues?) Just restart it until success make $MAKEOPTS -f client.mk build - # make -C obj-* package INNER_MAKE_PACKAGE=true cp -a obj-*/dist/firefox/* $INSTDIR/App/Firefox/ # TODO: There goes FIPS-140.. We could upload these somewhere unique and @@ -79,10 +78,23 @@ script: | rm -f $INSTDIR/App/Firefox/*.chk # cd $INSTDIR + # Strip and generate debuginfo for libs + objcopy --only-keep-debug $INSTDIR/App/Firefox/firefox $INSTDIR/Debug/App/Firefox/firefox + strip $INSTDIR/App/Firefox/firefox + objcopy --add-gnu-debuglink=./Debug/App/Firefox/firefox $INSTDIR/App/Firefox/firefox + for i in $INSTDIR/App/Firefox/*.so + do + LIB=`basename $i` + objcopy --only-keep-debug $INSTDIR/App/Firefox/$LIB $INSTDIR/Debug/App/Firefox/$LIB + strip $INSTDIR/App/Firefox/$LIB + objcopy --add-gnu-debuglink=./Debug/App/Firefox/$LIB $INSTDIR/App/Firefox/$LIB + done ~/build/re-dzip.sh App/Firefox/omni.ja ~/build/re-dzip.sh App/Firefox/webapprt/omni.ja ~/build/dzip.sh tor-browser-linux$GBUILD_BITS-gbuilt.zip App/ + ~/build/dzip.sh tor-browser-linux$GBUILD_BITS-debug.zip Debug/ cp tor-browser-linux$GBUILD_BITS-gbuilt.zip $OUTDIR/ + cp tor-browser-linux$GBUILD_BITS-debug.zip $OUTDIR/ # # XXX: Output the exact dpkgs we used to a txt file. Should this be # part of gitian? diff --git a/gitian/descriptors/linux/gitian-tor.yml b/gitian/descriptors/linux/gitian-tor.yml index d8f4460..f431222 100644 --- a/gitian/descriptors/linux/gitian-tor.yml +++ b/gitian/descriptors/linux/gitian-tor.yml @@ -43,6 +43,8 @@ script: | export DEB_BUILD_HARDENING_PIE=1 # mkdir -p $INSTDIR/App + mkdir -p $INSTDIR/Debug/Lib/libz + mkdir -p $INSTDIR/Debug/App mkdir -p $INSTDIR/Data/Tor/ mkdir -p $INSTDIR/Lib/libz/ # @@ -51,7 +53,7 @@ script: | ./configure --prefix=$INSTDIR/zlib make $MAKEOPTS SHARED_MODE=1 make $MAKEOPTS SHARED_MODE=1 install - cp $INSTDIR/zlib/lib/libz*so* $INSTDIR/Lib/libz/ + cp $INSTDIR/zlib/lib/libz.so.1 $INSTDIR/Lib/libz/ cd .. # cd libevent @@ -60,7 +62,7 @@ script: | ./configure --disable-static --prefix=$INSTDIR/libevent make $MAKEOPTS make install - cp $INSTDIR/libevent/lib/lib*so* $INSTDIR/Lib/ + cp $INSTDIR/libevent/lib/libevent-2.0.so.5 $INSTDIR/Lib/ cd .. # tar xzf openssl.tar.gz @@ -70,9 +72,13 @@ script: | ./config -shared --prefix=$INSTDIR/openssl make make install - cp $INSTDIR/openssl/lib/lib*so* $INSTDIR/Lib/ + cp $INSTDIR/openssl/lib/libssl.so.1.0.0 $INSTDIR/Lib/ + cp $INSTDIR/openssl/lib/libcrypto.so.1.0.0 $INSTDIR/Lib/ cd .. # + chmod 700 $INSTDIR/Lib/*so* + chmod 700 $INSTDIR/Lib/libz/*so* + # cd tor mkdir -p $OUTDIR/src #git archive HEAD | tar -x -C $OUTDIR/src @@ -81,10 +87,28 @@ script: | ./configure --disable-asciidoc --with-libevent-dir=$INSTDIR/libevent --with-openssl-dir=$INSTDIR/openssl --prefix=$INSTDIR --with-zlib-dir=$INSTDIR/zlib/ make $MAKEOPTS make install - cd .. - install -s $INSTDIR/bin/tor $INSTDIR/App/ cp $INSTDIR/share/tor/geoip $INSTDIR/Data/Tor/ - # + # Strip and generate debuginfo for libs cd $INSTDIR + objcopy --only-keep-debug $INSTDIR/bin/tor $INSTDIR/Debug/App/tor + install -s $INSTDIR/bin/tor $INSTDIR/App/ + objcopy --add-gnu-debuglink=./Debug/App/tor $INSTDIR/App/tor + for i in $INSTDIR/Lib/*so* + do + LIB=`basename $i` + objcopy --only-keep-debug $INSTDIR/Lib/$LIB $INSTDIR/Debug/Lib/$LIB + strip $INSTDIR/Lib/$LIB + objcopy --add-gnu-debuglink=./Debug/Lib/$LIB $INSTDIR/Lib/$LIB + done + for i in $INSTDIR/Lib/libz/*so* + do + LIB=`basename $i` + objcopy --only-keep-debug $INSTDIR/Lib/libz/$LIB $INSTDIR/Debug/Lib/libz/$LIB + strip $INSTDIR/Lib/libz/$LIB + objcopy --add-gnu-debuglink=./Debug/Lib/libz/$LIB $INSTDIR/Lib/libz/$LIB + done + # ~/build/dzip.sh tor-linux$GBUILD_BITS-gbuilt.zip Data/ App/ Lib/ + ~/build/dzip.sh tor-linux$GBUILD_BITS-debug.zip Debug/ cp tor-linux$GBUILD_BITS-gbuilt.zip $OUTDIR/ + cp tor-linux$GBUILD_BITS-debug.zip $OUTDIR/ diff --git a/gitian/mkbundle-linux.sh b/gitian/mkbundle-linux.sh index be2eacf..2f4d526 100755 --- a/gitian/mkbundle-linux.sh +++ b/gitian/mkbundle-linux.sh @@ -76,6 +76,7 @@ then fi
cp -a build/out/tor-linux*-gbuilt.zip $GITIAN_DIR/inputs/ + cp -a build/out/tor-linux*-debug.zip $GITIAN_DIR/inputs/ #cp -a result/tor-linux-res.yml $GITIAN_DIR/inputs/ else echo @@ -99,6 +100,7 @@ then fi
cp -a build/out/tor-browser-linux*-gbuilt.zip $GITIAN_DIR/inputs/ + cp -a build/out/tor-browser-linux*-debug.zip $GITIAN_DIR/inputs/ #cp -a result/torbrowser-linux-res.yml $GITIAN_DIR/inputs/ else echo
tor-commits@lists.torproject.org