Opened 9 months ago

Closed 5 weeks ago

#26148 closed task (fixed)

Update binutils to a version more recent than 2.26.1

Reported by: boklm Owned by: tbb-team
Priority: High Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-rbm, TorBrowserTeam201901R, boklm201901
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

In #16472 we are updating binutils to 2.26.1. We are not updating it to a more recent version due to an issue with reproducible builds on Windows with later binutils versions.

The issue seems to be caused by binutils commit 13e570f80cbfb299a8858ce6830e91a6cb40ab7b (which we revert in #16472).

Child Tickets

Change History (15)

comment:1 Changed 9 months ago by boklm

Keywords: boklm201806 added; boklm201805 removed

boklm201805 -> boklm201806

comment:2 Changed 8 months ago by boklm

Keywords: boklm201807 added; boklm201806 removed

boklm201806 -> boklm201807

comment:3 Changed 7 months ago by boklm

I filled an upstream binutils ticket for this issue:
https://sourceware.org/bugzilla/show_bug.cgi?id=23466

comment:4 Changed 6 months ago by boklm

Keywords: boklm201809 added; boklm201807 removed

boklm201807 -> boklm201809

comment:5 Changed 5 months ago by boklm

I will try a build using -Wl,-t to see if this can help understand the issue (as suggested in https://sourceware.org/bugzilla/show_bug.cgi?id=23466#c1).

comment:6 Changed 3 months ago by boklm

Keywords: boklm201811 added; boklm201809 removed

boklm201809 -> boklm201811

comment:7 Changed 6 weeks ago by gk

Keywords: TorBrowserTeam201901 added; TorBrowserTeam201805 removed
Priority: MediumHigh

comment:8 Changed 5 weeks ago by boklm

I have been building using -Wl,-t two times on one machine, and one time on an other one. The builds from the same machine were identical, but different on the second machine.

Comparing the logs from the non maching builds, the main difference was the order of .o files included inside libstdc++.a. It seems that with previous versions of binutils, the order of objects inside a .a file did not affect the output, but it is not the case anymore with more recent versions of binutils.

The reason why libstdc++.a is including objects in random order is that gcc is using an old version of libtool:
https://gcc.gnu.org/ml/gcc-patches/2018-06/msg01115.html

With the libtool patch sorting the output of find, I am now able to get matching builds on different machines.

I am now testing a patch to update binutils to 2.31.1.

comment:9 in reply to:  8 ; Changed 5 weeks ago by ld

Replying to boklm:

with previous versions of binutils, the order of objects inside a .a file did not affect the output, but it is not the case anymore with more recent versions of binutils.

Bug or feature for you?

I am now testing a patch to update binutils to 2.31.1.

Please test with the master branch instead, because of https://sourceware.org/ml/binutils/2019-01/msg00013.html and to avoid issues like https://sourceware.org/bugzilla/show_bug.cgi?id=23600.

comment:10 in reply to:  9 Changed 5 weeks ago by gk

Replying to ld:

Replying to boklm:

with previous versions of binutils, the order of objects inside a .a file did not affect the output, but it is not the case anymore with more recent versions of binutils.

Bug or feature for you?

I am now testing a patch to update binutils to 2.31.1.

Please test with the master branch instead, because of https://sourceware.org/ml/binutils/2019-01/msg00013.html and to avoid issues like https://sourceware.org/bugzilla/show_bug.cgi?id=23600.

No, 2.31.1 is fine for now I think (if nothing explodes). We'll want to switch to a newer binutils before 2.32 gets released if possible.

comment:11 Changed 5 weeks ago by boklm

Keywords: TorBrowserTeam201901R boklm201901 added; TorBrowserTeam201901 boklm201811 removed
Status: newneeds_review

In branch bug_26148_v6 we update binutils to 2.31.1:
https://gitweb.torproject.org/user/boklm/tor-browser-build.git/commit/?h=bug_26148_v6&id=f804709d68e9c4b3c7b606b89a8f555f21fe3e09

I checked that the linux and windows builds are reproductible on two machines, and the bundles created are running correctly.

comment:13 in reply to:  11 Changed 5 weeks ago by gk

Keywords: TorBrowserTeam201901 added; TorBrowserTeam201901R removed
Status: needs_reviewneeds_revision

Replying to boklm:

In branch bug_26148_v6 we update binutils to 2.31.1:
https://gitweb.torproject.org/user/boklm/tor-browser-build.git/commit/?h=bug_26148_v6&id=f804709d68e9c4b3c7b606b89a8f555f21fe3e09

I checked that the linux and windows builds are reproductible on two machines, and the bundles created are running correctly.

Thanks! Testing shows this works for me. What we could do is including the landed libtool patch instead of the mail. The patch is at least on GCC master (commit 494c17dc2bf45b8155fb9a14178ab48f01bc12a8) but not in any release yet.

One request: could you add https://sourceware.org/bugzilla/show_bug.cgi?id=17321 to the comment for the relocation patch so that we know this is on file at least?

comment:14 Changed 5 weeks ago by boklm

Keywords: TorBrowserTeam201901R added; TorBrowserTeam201901 removed
Status: needs_revisionneeds_review

There is a new version of the patch in branch bug_26148_v7:
https://gitweb.torproject.org/user/boklm/tor-browser-build.git/commit/?h=bug_26148_v7&id=5631b327ab3654af5f2b329cf46fd67921004f41

With the following changes:

comment:15 Changed 5 weeks ago by gk

Resolution: fixed
Status: needs_reviewclosed

Looks good, thanks! Merge to master (commit 5631b327ab3654af5f2b329cf46fd67921004f41).

Note: See TracTickets for help on using tickets.