generate a node-gyp compiled class over 2gb

I'm trying to configure and build a c file that links ~ 2GB of space. When I try to build this file using node-gyp, I get the following message:

relocation truncated to fit: R_X86_64_PC32 against `.bss'

In conventional gcc compiling, I could use the -mcmodel=medium option, but I'm not sure how I would pass that through to node-gyp when it finally compiles the file using gcc.

Any ideas?

So the solution is quite simple with node-gyp's binding.gyp file. I simply added:

'cflags': [ '-mcmodel=medium' ]

under my target, and it compiled correctly.