Comments (12)
build at node_modules manually.
mkdir sodium
cd sodium
git clone https://github.com/paixaop/node-sodium.git
mv node-sodium/* ./
vi deps/libsodium-0.4.5/src/libsodium/crypto_onetimeauth/poly1305/donna/portable-jane.h
-change deps/libsodium.gyp as below diff.
6c6,7
< 'target_arch%': 'ia32'
---
> #'target_arch%': 'ia32'
> 'target_arch%': 'arm'
15,16c16,17
< 'HAVE_AMD64_ASM=1',
< 'SODIUM_HAVE_AMD64_ASM',
---
> #'HAVE_AMD64_ASM=1',
> #'SODIUM_HAVE_AMD64_ASM',
38c39
< 'HAVE_X86INTRIN_H=1',
---
> #'HAVE_X86INTRIN_H=1',
42,43c43,44
< 'HAVE_AMD64_ASM=1',
< 'HAVE_TI_MODE=1',
---
> #'HAVE_AMD64_ASM=1',
> #'HAVE_TI_MODE=1',
212c213
< 'libsodium-<(naclversion)/src/libsodium/crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S',
---
> #'libsodium-<(naclversion)/src/libsodium/crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S',
238c239
< }
\ No newline at end of file
---
> }
- then
node-gyp rebuild
from node-sodium.
just updated lib sodium to 1.0.0 and removed the ASM code. so if you update the arch in the lib sodium.gyp it should work now.
Please let me know.
from node-sodium.
It is working.
from node-sodium.
can you send me your gyp file so I can merge it?
from node-sodium.
FWIW I also reproduce this matter with i686 this means it works only on x86_64 apparently
from node-sodium.
Here is what I had to change to compile it:
diff --git a/deps/libsodium.gyp b/deps/libsodium.gyp
index f05456f..9ded9aa 100755
--- a/deps/libsodium.gyp
+++ b/deps/libsodium.gyp
@@ -53,7 +53,7 @@
'HAVE_FENV_H=1',
'NATIVE_LITTLE_ENDIAN=1',
#'HAVE_AMD64_ASM=1',
- 'HAVE_TI_MODE=1',
+ #'HAVE_TI_MODE=1',
'HAVE_CPUID=1',
'HAVE_LIBM=1'
],
Then node-gyp rebuild
from node-sodium.
I can confirm that this patch also works both on x86_64
and i686
from node-sodium.
See #30
from node-sodium.
@Natim Thanks, that fix enables me to compile master on 32bit. However, I get errors during make test
:
Error: /home/emotest/node-sodium/build/Release/sodium.node: undefined symbol: crypto_scalarmult_curve25519
at Error (native)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/home/emotest/node-sodium/test/test_auth.js:5:14)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at /home/emotest/node-sodium/node_modules/mocha/lib/mocha.js:184:27
at Array.forEach (native)
at Mocha.loadFiles (/home/emotest/node-sodium/node_modules/mocha/lib/mocha.js:181:14)
at Mocha.run (/home/emotest/node-sodium/node_modules/mocha/lib/mocha.js:393:31)
at Object.<anonymous> (/home/emotest/node-sodium/node_modules/mocha/bin/_mocha:380:16)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Function.Module.runMain (module.js:490:10)
at startup (node.js:124:16)
at node.js:807:3
make: *** [test-unit] Error 1
It might be important to note that I am also using @jonasfj's patches in order to compile vs. node 0.11.13. If I pull his fork directly and try to compile that on 32 bit, setting #'HAVE_TI_MODE=1',
, I get the same error.
I discovered the following:
node-sodium$ nm build/Release/sodium.node | grep scalarmult
0002dc80 T crypto_scalarmult
0002dc70 T crypto_scalarmult_base
0002dc40 T crypto_scalarmult_bytes
U crypto_scalarmult_curve25519
U crypto_scalarmult_curve25519_base
0002dc60 T crypto_scalarmult_primitive
0002dc50 T crypto_scalarmult_scalarbytes
000340a0 T crypto_sign_ed25519_ref10_ge_double_scalarmult_vartime
00035050 T crypto_sign_ed25519_ref10_ge_scalarmult_base
0001cdf0 T _Z22bind_crypto_scalarmultRKN2v820FunctionCallbackInfoINS_5ValueEEE
00017320 T _Z27bind_crypto_scalarmult_baseRKN2v820FunctionCallbackInfoINS_5ValueEEE
from node-sodium.
Does anyone have a hint for me how to fix this?
from node-sodium.
this sounds like a libsodium issue, not a node-sodium issue... Or maybe it part of how libsodium gets build...
Either way, I don't really have any good ideas. Perhaps start with getting libsodium to build...
Is this arm or i686 too? And any suggestions for how to reproduce, maybe supply a vagrant box...
from node-sodium.
can you try the develop branch?
from node-sodium.
Related Issues (20)
- Fails to compile on openSUSE LEAP 15 (../deps/build/lib/libsodium.a: No such file or directory ) HOT 8
- Cant install sodium on my Pi HOT 2
- Compiling sodium on TravisCI fails HOT 1
- Console error 'msvsversiion not defined' when invalid Visual Studio Version is found
- Invalid ELF Header HOT 1
- Error installing on Windows
- make libsodium exited with code 2, pwhash_argon2i fails HOT 3
- NPM install fails with node-gyp error: cannot use a string pattern on a bytes-like object
- package install errors HOT 3
- How to pre-build Node Sodium?
- install.js support vs2019 please HOT 1
- Installing on Windows Failed HOT 1
- Way to use exists keypair which generated in Java HOT 1
- libbtool/libsodium not installing on Petrodctyle panel
- ed25519 decode / decompress HOT 1
- Cannot install with yarn berry
- Can't install sodium, please help me (Windows) HOT 1
- Does not compile on Linux ARM. HOT 6
- Is this library still maintained?
- Can't Install (Windows) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-sodium.