Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix npm install err on mips arch #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

212dandan
Copy link

@212dandan 212dandan commented Nov 23, 2017

[loongson@localhost github]$ npm install ffi
|
> ffi@2.2.0 install /home/loongson/node_modules/ffi
> node-gyp rebuild

make: Entering directory '/home/loongson/node_modules/ffi/build'
  CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o
../deps/libffi/src/prep_cif.c:26:17: Fatal error: ffi.h: No such file or directory
  #include <ffi.h>
                  ^
Compile interrupt.
deps/libffi/ffi.target.mk:96: recipe for target 'Release/obj.target/ffi/deps/libffi/src/prep_cif.o' failed
make: *** [Release/obj.target/ffi/deps/libffi/src/prep_cif.o] Error 1
make: Leaving directory '/home/loongson/node_modules/ffi/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib64/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.10.84-17.fc21.loongson.mips64el
gyp ERR! command "/usr/bin/node" "/usr/lib64/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/loongson/node_modules/ffi
gyp ERR! node -v v4.3.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Linux 3.10.84-17.fc21.loongson.mips64el
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "ffi"
npm ERR! node v4.3.1
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE

npm ERR! ffi@2.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ffi@2.2.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the ffi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls ffi
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/loongson/github/npm-debug.log

I tested the Example in README.md passed, looks well:

[loongson@localhost node-ffi]$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@0.10.6
gyp info using node@4.3.1 | linux | mips64el
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
gyp info spawn python
gyp info spawn args [ '/usr/bin/gyp',
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/loongson/github/node-ffi/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon-rpm.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/share/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/usr/share/node',
gyp info spawn args   '-Dmodule_root_dir=/home/loongson/github/node-ffi',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/loongson/github/node-ffi/build'
  CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o
  CC(target) Release/obj.target/ffi/deps/libffi/src/types.o
  CC(target) Release/obj.target/ffi/deps/libffi/src/raw_api.o
  CC(target) Release/obj.target/ffi/deps/libffi/src/java_raw_api.o
  CC(target) Release/obj.target/ffi/deps/libffi/src/closures.o
  CC(target) Release/obj.target/ffi/deps/libffi/src/mips/ffi.o
../deps/libffi/src/mips/ffi.c: In the function 'ffi_prep_args':
../deps/libffi/src/mips/ffi.c:84:13: Warning: Comparison Between Signed and Unsigned Integer Expressions [-Wsign-compare]
    if (bytes> 8 * sizeof (ffi_arg))
              ^
../deps/libffi/src/mips/ffi.c:107:47: Warning: Comparison Between Signed and Unsigned Integer Expressions [-Wsign-compare]
    for (i = 0, p_arg = ecif-> cif-> arg_types; i <ecif-> cif-> nargs; i ++, p_arg ++)
                                                ^
../deps/libffi/src/mips/ffi.c: In the function 'ffi_closure_mips_inner_O32':
../deps/libffi/src/mips/ffi.c:770:16: Warning: convert an integer to a pointer of a different size [-Wint-to-pointer-cast]
        rvalue = (void *) (UINT32) ar [0];
                 ^
../deps/libffi/src/mips/ffi.c: In the function 'ffi_closure_mips_inner_N32':
../deps/libffi/src/mips/ffi.c:946:45: Warning: convert a pointer to a different size integer [-Wpointer-to-int-cast]
           if ((arg_types[i]->type == FFI_TYPE_LONGDOUBLE) && ((unsigned)argp & (arg_types[i]->alignment-1)))
                                             ^
  CC(target) Release/obj.target/ffi/deps/libffi/src/mips/o32.o
  CC(target) Release/obj.target/ffi/deps/libffi/src/mips/n32.o
  AR(target) Release/obj.target/deps/libffi/libffi.a
  COPY Release/libffi.a
  CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
  CXX(target) Release/obj.target/ffi_bindings/src/callback_info.o
  CXX(target) Release/obj.target/ffi_bindings/src/threaded_callback_invokation.o
  SOLINK_MODULE(target) Release/obj.target/ffi_bindings.node
  SOLINK_MODULE(target) Release/obj.target/ffi_bindings.node: Finished
  COPY Release/ffi_bindings.node
make: Leaving directory '/home/loongson/github/node-ffi/build'
gyp info ok 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant