Permalink
Browse files

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.
  • Loading branch information...
1 parent 3f92031 commit f004d5aeac0a91a1731575d3ac9a80d710a1f48a @bnoordhuis bnoordhuis committed Nov 18, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 wscript
View
5 wscript
@@ -461,6 +461,11 @@ def configure(conf):
conf.env.append_value('CPPFLAGS', '-D_LARGEFILE_SOURCE')
conf.env.append_value('CPPFLAGS', '-D_FILE_OFFSET_BITS=64')
+ # Apparently _LARGEFILE_SOURCE and _FILE_OFFSET_BITS isn't always enough
+ # on OS X, see https://github.com/joyent/node/issues/2061 for details.
+ if sys.platform.startswith('darwin') and conf.env['DEST_CPU'] == 'x64':
+ conf.env.append_value('CPPFLAGS', '-D__DARWIN_64_BIT_INO_T=1')
+
# Makes select on windows support more than 64 FDs
if sys.platform.startswith("win32"):
conf.env.append_value('CPPFLAGS', '-DFD_SETSIZE=1024');

0 comments on commit f004d5a

Please sign in to comment.