DescriptionAdd #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 #Messages
Total messages: 8 (1 generated)
|