Opened 5 years ago
Closed 5 years ago
#58507 closed defect (fixed)
libuv @1.29.1: Undefined symbols for architecture i386: "_close$NOCANCEL"
Reported by: | kencu (Ken) | Owned by: | michaelld (Michael Dickens) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | mopihopi | |
Port: | libuv |
Description
I haven't totally sorted this out yet.
There is a new function in src/unix/core.c
to make a non-cancellable close() function on systems that support that.
They have implemented this on darwin as close$NOCANCEL
, but I think this function might be only 64 bit. At least when I try to build it on a 32bit OS, or when I try to build it +universal
, I run into errors like the above.
Not fully sure what the right fix is. Adding an __LP64__
like this does fix the +universal
build. Maybe that is the right fix. Perhaps there is some other function to call for 32bit?
int uv__close_nocancel(int fd) { -#if defined(__APPLE__) +#if defined(__APPLE__) && __LP64__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension" extern int close$NOCANCEL(int); return close$NOCANCEL(fd); #pragma GCC diagnostic pop #elif defined(__linux__) return syscall(SYS_close, fd); #else return close(fd); #endif }
also - you'll notice some #pragma
calls inside the function definition in the function above, so gcc-4.2
barfs on that, and we have to remove those for gcc-4.2
.
Change History (6)
comment:1 Changed 5 years ago by mopihopi
Cc: | mopihopi added |
---|
comment:2 Changed 5 years ago by kencu (Ken)
comment:3 Changed 5 years ago by kencu (Ken)
This looks pretty comprehensive too: <https://github.com/lionheart/openradar-mirror/issues/4506>
comment:4 Changed 5 years ago by kencu (Ken)
This appears to work too, and looks probably better:
int uv__close_nocancel(int fd) { #if defined(__APPLE__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension" #if __LP64__ extern int close$NOCANCEL(int); return close$NOCANCEL(fd); #else extern int close$NOCANCEL$UNIX2003(int); return close$NOCANCEL$UNIX2003(fd); #endif #pragma GCC diagnostic pop #elif defined(__linux__) return syscall(SYS_close, fd); #else return close(fd); #endif }
This fix seems solid from 10.5 to 10.12. For Tiger, have to take the old pathway as there does not seem to be a close$NOCANCEL
implementation I can find.
comment:6 Changed 5 years ago by kencu (Ken)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
yuk <https://codereview.chromium.org/23455051/diff/1/base/mac/close_nocancel.cc#newcode33>