node-ffi-napi / ref-napi

Turn Buffer instances into "pointers"
MIT License
123 stars 67 forks source link

AIX Compatibility #48

Closed mauroballestra closed 3 years ago

mauroballestra commented 3 years ago

Hello,

I use ref-napi together with ffi-napi to run the nodejs driver of the company I work for.

I successfully use it on Windows, Linux, MacOS and FreeBSD now I'd like to use this driver on AIX 7.1 as well.

When I try to install my dependencies I get the following error during the C/C++ build: CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o AR(target) Release/obj.target/../node-addon-api/src/nothing.a COPY Release/nothing.a CXX(target) Release/obj.target/binding/src/binding.o SOLINK_MODULE(target) Release/obj.target/binding.node collect2: fatal error: Release/obj.target/../node-addon-api/src/nothing.a: not a COFF file In order to fix the AR archiving issue is enough to change the cmd_alink in the Makefile from: cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) to: cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) --target=aixcoff-rs6000

Unfortunately if I fix the makefile and run npm install again my changes are overwritten and I'm unable to continue. As I'm not familiar with node-gyp build system I have no idea how I can instruct ref-napi build scripts to use --target=aixcoff-rs6000 when running on AIX Power (RISC) systems.

Can someone help changing the build script to include AIX compatibility?

Thanks

addaleax commented 3 years ago

As you pointed out correctly, this file is generated by node-gyp, not ref-napi. You should probably open an issue in https://github.com/nodejs/node-gyp/, not here, unless there’s a reason to believe that there’s any action that ref-napi can take on its own. (If you do open an issue, feel free to ping me.)

mauroballestra commented 3 years ago

Thank you for your answer Anna. I'm relatively new to the NodeJS and GitHub world so I may not report the issues in the correct way. I'm creating an Issue in node-gyp and see what happens. Again, thank your your indications,