Dan Ballard pushed to branch maint-14.0 at The Tor Project / Applications / tor-browser-build
Commits: 90a754f9 by Dan Ballard at 2025-02-19T13:50:34-08:00 bug 41337: always copy gcc/stdlibc++ into firefox and remove from tor-expert-bundle
- - - - -
4 changed files:
- projects/browser/build - projects/firefox/build - projects/tor/README.md - projects/tor/build
Changes:
===================================== projects/browser/build ===================================== @@ -120,12 +120,6 @@ mv [% c('input_files_by_name/noscript') %] "$TBDIR/$EXTSPATH/{73a6fe31-595d-460b # Move tor and dependencies to where TB expects them mv_tbdir tor/* "$TORBINPATH"
- # on linux, libstdc++ lives in it's own directory - [% IF c("var/linux") %] - mkdir -p "$TBDIR/$TORBINPATH/libstdc++" - mv "$TBDIR/$TORBINPATH"/libstdc++.so.* "$TBDIR/$TORBINPATH/libstdc++" - [% END %] - # the expert bundle includes tor-gencert, which isn't needed for browser releases [% IF c("var/windows") %] rm "$TBDIR/$TORBINPATH/tor-gencert.exe" @@ -189,6 +183,13 @@ tar -C "${TB_STAGE_DIR}" -xf [% c('input_files_by_name/firefox') %]/browser.tar. done popd rm -rf $TMP_MANUAL_PATH + + # on linux, libstdc++ lives in it's own directory + [% IF c("var/linux") %] + # For legacy reasons, libstdc++ is with tor binaries in Tor Browser. + # We would have to test the updater to move it outside. + mv "$TBDIR/libstdc++" "$TBDIR/$TORBINPATH/libstdc++" + [% END %] [% END -%]
[% IF c("var/namecoin") %]
===================================== projects/firefox/build ===================================== @@ -329,16 +329,20 @@ END;
[% IF c("var/linux") -%] /var/tmp/dist/gcc/bin/g++ $rootdir/abicheck.cc -o Browser/abicheck -std=c++17 - [% IF !c("var/tor-browser") -%] - libdest=Browser/libstdc++ - mkdir -p "$libdest" - # FIXME: tor-browser-build#40749 - cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libstdc++.so.* "$libdest" - [% IF c("var/asan") -%] - cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libasan.so.* "$libdest" - cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libubsan.so.* "$libdest" - [% END -%] + libdest=Browser/libstdc++ + mkdir -p "$libdest" + # Not copying libstdc++.so.* as that dups with the full libstdc++.so.6.0.xx the .6 links to + # and libstdc++.so.6.0.28-gdb.py which is also not needed + cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libstdc++.so.* "$libdest" + [% IF c("var/asan") -%] + cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libasan.so.* "$libdest" + cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libubsan.so.* "$libdest" [% END -%] + # Strip and generate debuginfo for libs + for LIB in "$libdest"/*so* + do + "$STRIP" "$LIB" + done [% END -%]
echo "Starting to package artifacts $(date)"
===================================== projects/tor/README.md ===================================== @@ -38,8 +38,5 @@ We plan to do it also on desktop platforms, see
## Other Linux libraries
-For Linux we also include here libstdc++ (and the sanitizers, if enabled), even -though they aren't needed by tor. - -Also, on we provide debug symbols, but only for Linux, and only in +For Linux we provide debug symbols, but only for Linux, and only in `tor-expert-bundle`.
===================================== projects/tor/build ===================================== @@ -52,22 +52,7 @@ openssldir=/var/tmp/dist/openssl cp $openssldir/lib/libssl.so.3 "$TORBINDIR" cp $openssldir/lib/libcrypto.so.3 "$TORBINDIR" cp $libeventdir/lib/libevent-2.1.so.7 "$TORBINDIR" - # We need to copy the libstdc++.so.6 for Tor Browser on older Linux distros. - # Copying it into /Browser, which feels more natural, and amending - # LD_LIBRARY_PATH breaks updates from a Tor Browser with the old - # LD_LIBRARY_PATH value to the Tor Browser with the newer one. Thus, we copy - # the libstdc++ into the directory with the libs tor depends on, too. See bug - # 13359 for further details. - libdir=[% c("var/libdir") %] - [% IF c("var/linux-cross") -%] - libdir="[% c("var/crosstarget") %]/$libdir" - [% END -%] - cp "/var/tmp/dist/gcc/$libdir/libstdc++.so.6" "$TORBINDIR" - [% IF c("var/asan") -%] - cp "/var/tmp/dist/gcc/$libdir/libasan.so.6" "$TORBINDIR" - cp "/var/tmp/dist/gcc/$libdir/libubsan.so.1" "$TORBINDIR" - [% END -%] - chmod 700 "$TORBINDIR"/*.so* + # This is needed to make RPATH unavailable. See bug 9150. export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TORBINDIR" [% END %] @@ -136,17 +121,9 @@ cd $distdir do LIB=`basename $i`
- if [ $LIB == 'libstdc++.so.6' ]; then - # keeping this separate to maintain reproducibility; we can probably - # treat this the same as the rest (though it seems libstdc++ doesn't come with - # any useful debug symbols since we don't build it, so maybe we should figure - # out how to package them - "$STRIP" "$TORBINDIR/$LIB" - else - "$OBJCOPY" --only-keep-debug "$TORBINDIR/$LIB" "$TORDEBUGDIR/$LIB" - "$STRIP" "$TORBINDIR/$LIB" - "$OBJCOPY" --add-gnu-debuglink="$TORDEBUGDIR/$LIB" "$TORBINDIR/$LIB" - fi + "$OBJCOPY" --only-keep-debug "$TORBINDIR/$LIB" "$TORDEBUGDIR/$LIB" + "$STRIP" "$TORBINDIR/$LIB" + "$OBJCOPY" --add-gnu-debuglink="$TORDEBUGDIR/$LIB" "$TORBINDIR/$LIB" done [% END %]
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/90...
tor-commits@lists.torproject.org