forked from NodeOS/NodeOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode
More file actions
executable file
·29 lines (16 loc) · 750 Bytes
/
node
File metadata and controls
executable file
·29 lines (16 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env node
var spawn = require('child_process').spawn
var processArguments = require('./processArguments')
const QEMU = require('qemu')+'/bin/qemu-'
var args = processArguments(process.argv.slice(2))
var cpu = args.cpu
// [Hack] Can't be able to use x86_64 as generic x86 64 bits CPU
var toolchainCpu = (cpu === 'nocona') ? 'x86_64' : cpu
const LD_LIBRARY_PATH = '../nodeos-cross-toolchain/out/'+toolchainCpu+'-nodeos-linux-'+args.libc+'/lib'
process.env.LD_LIBRARY_PATH = LD_LIBRARY_PATH
var command = QEMU+args.cpu_family
var argv = [LD_LIBRARY_PATH+'/libc.so', 'obj/'+cpu+'/node', '--interactive']
if(args.argv)
argv = argv.concat(args.argv)
spawn(command, argv, {stdio: 'inherit'})
.on('exit', process.exit.bind(process))