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

Issue 1036123003: Add #include of <unistd.h> to close_nocancel.cc. (Closed)

Created:
5 years, 9 months ago by pcc1
Modified:
5 years, 9 months ago
Reviewers:
Mark Mentovai, Nico
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add #include of <unistd.h> to close_nocancel.cc. On OS X the declaration of the close function looks like this: int close(int) __asm("_close" optional extra stuff); If we do not include unistd.h the close_nocancel.cc translation unit does not see the asm label. This is technically an ODR violation, but not normally a significant one, because close will get mangled to _close by the compiler anyway. However under LLVM LTO the mangled symbol is internally given a different name to the unmangled symbol, and the linker gets confused by the multiple declarations with the same mangled name. This also lets us simplify this code by defining the close function itself (which will receive its name from the asm label in the declaration) rather than trying to guess what the extra stuff is and naming the function we define after that. BUG=471146 R=thakis@chromium.org,mark@chromium.org Committed: https://crrev.com/f16a8246620a9494b5d38a45b8da72d51a305ec8 Cr-Commit-Position: refs/heads/master@{#322620}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Reword comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -20 lines) Patch
M base/mac/close_nocancel.cc View 1 2 chunks +11 lines, -20 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
pcc1
5 years, 9 months ago (2015-03-27 04:26:49 UTC) #1
Mark Mentovai
https://codereview.chromium.org/1036123003/diff/1/base/mac/close_nocancel.cc File base/mac/close_nocancel.cc (right): https://codereview.chromium.org/1036123003/diff/1/base/mac/close_nocancel.cc#newcode32 base/mac/close_nocancel.cc:32: // label on the declaration of the close function, ...
5 years, 9 months ago (2015-03-27 12:12:51 UTC) #2
pcc1
https://codereview.chromium.org/1036123003/diff/1/base/mac/close_nocancel.cc File base/mac/close_nocancel.cc (right): https://codereview.chromium.org/1036123003/diff/1/base/mac/close_nocancel.cc#newcode32 base/mac/close_nocancel.cc:32: // label on the declaration of the close function, ...
5 years, 9 months ago (2015-03-27 17:46:56 UTC) #3
Mark Mentovai
LGTM
5 years, 9 months ago (2015-03-27 17:49:58 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1036123003/20001
5 years, 9 months ago (2015-03-27 17:51:59 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 9 months ago (2015-03-27 19:05:32 UTC) #7
commit-bot: I haz the power
5 years, 9 months ago (2015-03-27 19:06:45 UTC) #8
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/f16a8246620a9494b5d38a45b8da72d51a305ec8
Cr-Commit-Position: refs/heads/master@{#322620}

Powered by Google App Engine
This is Rietveld 408576698