I'm able to successfully build and run your code sample on an AIX 6.1 box with GNU Make 3.82, gcc 4.6.1 and Node v0.11.13 built from v0.11.13-release-ppc from andrewlow/node on GitHub.
I created a simple binding.gyp file:
-bash-4.2$ cat binding.gyp
{
'targets': [
{
'target_name': 'helloworld',
'sources': [ 'helloworld.cc' ]
}
]
}
-bash-4.2$
Following has been set:
-bash-4.2$ export CC=/opt/freeware/bin/gcc
-bash-4.2$ export CXX=/opt/freeware/bin/g++
I've had to export
LDR_CNTRL=MAXDATA otherwise I was getting "process out of memory" from node-gyp when it attempts to grab and expand
http://nodejs.org/dist/v0.11.13/node-v0.11.13.tar.gz.
-bash-4.2$ export LDR_CNTRL=MAXDATA=0x10000000@DSA
-bash-4.2$
˜/sandbox/scratch/node-v0.11.13-aix-ppc64/bin/node
˜/sandbox/scratch/node-v0.11.13-aix-ppc64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
configure build
gyp info it worked if it ends with ok
gyp info using
node...@0.13.0gyp info using
no...@0.11.13 | aix | ppc64
gyp http GET
http://nodejs.org/dist/v0.11.13/node-v0.11.13.tar.gzgyp http 200
http://nodejs.org/dist/v0.11.13/node-v0.11.13.tar.gzgyp http GET
http://nodejs.org/dist/v0.11.13/SHASUMS.txtgyp http GET
http://nodejs.org/dist/v0.11.13/SHASUMS.txtgyp http 200
http://nodejs.org/dist/v0.11.13/SHASUMS.txtgyp
info node-gyp configure common.gypi copying "common.gypi" from
/home/users/riclau/sandbox/scratch/node-v0.11.13-aix-ppc64/include/node/common.gypi
to /home/users/riclau/.node-gyp/0.11.13/common.gypi
gyp http 200
http://nodejs.org/dist/v0.11.13/SHASUMS.txtgyp
info node-gyp configure node.exp copying "node.exp" from
/home/users/riclau/sandbox/scratch/node-v0.11.13-aix-ppc64/include/node/node.exp
to /home/users/riclau/.node-gyp/0.11.13/node.exp
gyp info spawn python
gyp
info spawn args [
'/home/users/riclau/sandbox/scratch/node-v0.11.13-aix-ppc64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/users/riclau/sandbox/scratch/aixaddon/build/config.gypi',
gyp info spawn args '-I',
gyp
info spawn args
'/home/users/riclau/sandbox/scratch/node-v0.11.13-aix-ppc64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/users/riclau/.node-gyp/0.11.13/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/users/riclau/.node-gyp/0.11.13',
gyp info spawn args '-Dmodule_root_dir=/home/users/riclau/sandbox/scratch/aixaddon',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn gmake
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
gmake: Entering directory `/home/users/riclau/sandbox/scratch/aixaddon/build'
gmake: Nothing to be done for `all'.
gmake: Leaving directory `/home/users/riclau/sandbox/scratch/aixaddon/build'
gyp info ok
-bash-4.2$ ˜/sandbox/scratch/node-v0.11.13-aix-ppc64/bin/node
> addon=require('./build/Release/helloworld.node')
{ HelloWorld: [Function: HelloWorld] }
> obj=new addon.HelloWorld()
{}
> obj.hello()
'world'
>
I'll see if I can get a later version of gcc.