Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Issue 2094273003: Disable --as-needed for libpthread to work around linker bug. (Closed)

Created:
4 years, 5 months ago by pcc1
Modified:
4 years, 5 months ago
Reviewers:
engedy, Nico
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Disable --as-needed for libpthread to work around linker bug. If a DSO is linked against with --as-needed and the program contains no strong references to any symbols in the DSO, the documented behaviour is that the linker should not create a DT_NEEDED entry for that DSO. However, if the program contains weak references to symbols in the DSO, this results in an incorrect resolution for that symbol. In Chromium this happens in particular for the symbol __pthread_key_create (as a result of code inlined from a pthread header), which causes the program to segfault. For more details, see the associated bug and the related LLVM bug: http://llvm.org/pr28335 Work around this by linking against libpthread with --no-as-needed. Because the problem only affects glibc, only do this when not targeting NaCl or Android, neither of which normally uses glibc as the C runtime library (NaCl can use glibc, but we haven't observed this problem there). BUG=623236 R=thakis@chromium.org,engedy@chromium.org Committed: https://crrev.com/7ebfaa0c5067c77db1b4891ac6571f8d1b97fc4d Cr-Commit-Position: refs/heads/master@{#402650}

Patch Set 1 #

Patch Set 2 : Disable for nacl #

Patch Set 3 : Disable for android #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -0 lines) Patch
M build/common.gypi View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M build/config/compiler/BUILD.gn View 1 2 1 chunk +8 lines, -0 lines 2 comments Download

Messages

Total messages: 23 (8 generated)
pcc1
4 years, 5 months ago (2016-06-27 22:48:12 UTC) #1
engedy
LGTM, thank you for preparing the workaround on such short notice.
4 years, 5 months ago (2016-06-28 05:30:23 UTC) #2
Nico
Do all our binaries currently link against pthread? If not, after this change they will. ...
4 years, 5 months ago (2016-06-28 13:29:01 UTC) #3
pcc1
On 2016/06/28 13:29:01, Nico wrote: > Do all our binaries currently link against pthread? If ...
4 years, 5 months ago (2016-06-28 20:02:08 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2094273003/20001
4 years, 5 months ago (2016-06-28 20:03:57 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/208783)
4 years, 5 months ago (2016-06-28 20:20:30 UTC) #9
pcc1
thakis@: PTAL.
4 years, 5 months ago (2016-06-28 21:33:23 UTC) #10
Nico
Looking through the output of `for f in out/gn/*; do if test -x $f -a ...
4 years, 5 months ago (2016-06-28 21:45:01 UTC) #11
pcc1
On 2016/06/28 21:45:01, Nico wrote: > Looking through the output of `for f in out/gn/*; ...
4 years, 5 months ago (2016-06-28 21:53:58 UTC) #12
Nico
https://codereview.chromium.org/2094273003/diff/40001/build/config/compiler/BUILD.gn File build/config/compiler/BUILD.gn (right): https://codereview.chromium.org/2094273003/diff/40001/build/config/compiler/BUILD.gn#newcode1283 build/config/compiler/BUILD.gn:1283: if (!is_nacl && !is_android) { what about chromeos? should ...
4 years, 5 months ago (2016-06-28 21:56:24 UTC) #13
pcc1
https://codereview.chromium.org/2094273003/diff/40001/build/config/compiler/BUILD.gn File build/config/compiler/BUILD.gn (right): https://codereview.chromium.org/2094273003/diff/40001/build/config/compiler/BUILD.gn#newcode1283 build/config/compiler/BUILD.gn:1283: if (!is_nacl && !is_android) { On 2016/06/28 21:56:23, Nico ...
4 years, 5 months ago (2016-06-28 22:19:35 UTC) #15
Nico
still lgtm
4 years, 5 months ago (2016-06-28 22:21:24 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2094273003/40001
4 years, 5 months ago (2016-06-28 22:21:44 UTC) #19
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 5 months ago (2016-06-29 01:59:04 UTC) #21
commit-bot: I haz the power
4 years, 5 months ago (2016-06-29 02:00:51 UTC) #23
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/7ebfaa0c5067c77db1b4891ac6571f8d1b97fc4d
Cr-Commit-Position: refs/heads/master@{#402650}

Powered by Google App Engine
This is Rietveld 408576698