Skip to content

Commit f004d5a

Browse files
committed
build: compile with -D__DARWIN_64_BIT_INO_T on OS X
Fixes a struct stat size mismatch on 64 bits machines that made Node crash with a EXC_BAD_ACCESS on startup. Fixes #2061. Solution proposed by Paddy Byers.
1 parent 3f92031 commit f004d5a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

wscript

+5
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ def configure(conf):
461461
conf.env.append_value('CPPFLAGS', '-D_LARGEFILE_SOURCE')
462462
conf.env.append_value('CPPFLAGS', '-D_FILE_OFFSET_BITS=64')
463463

464+
# Apparently _LARGEFILE_SOURCE and _FILE_OFFSET_BITS isn't always enough
465+
# on OS X, see https://github.com/joyent/node/issues/2061 for details.
466+
if sys.platform.startswith('darwin') and conf.env['DEST_CPU'] == 'x64':
467+
conf.env.append_value('CPPFLAGS', '-D__DARWIN_64_BIT_INO_T=1')
468+
464469
# Makes select on windows support more than 64 FDs
465470
if sys.platform.startswith("win32"):
466471
conf.env.append_value('CPPFLAGS', '-DFD_SETSIZE=1024');

0 commit comments

Comments
 (0)