Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Pavi  
View profile  
 More options Aug 28 2012, 6:34 pm
From: Pavi <pavinc...@gmail.com>
Date: Tue, 28 Aug 2012 15:34:57 -0700 (PDT)
Local: Tues, Aug 28 2012 6:34 pm
Subject: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

Hi,

I have successfully cross compiled the node binary for version0.8. and
running the same in the hardware.
Now i wrote *.cc and wscript file which helps in interfacing the C++ with
the Java.
When i compile and build the same as "node-waf configure build" the
compilation steps are successful, and i get a *.node file inside
./build/Release folder.
I copied the same from the ubuntu to the Target, but i get the below error.

*root@bosch-nemid:~/Release-2# node ARM.js*
*[ 2971.577489] Alignment trap: not handling instruction e1923f9f at
[<ffff0fc4>]*
*[ 2971.586303] Unhandled fault: alignment exception (0x011) at 0x0001bad5*
*Illegal instruction*
*
*
Please find below the code of wscript:
srcdir = '.'
blddir = 'build'
VERSION = '0.1'

def set_options(opt):
  opt.tool_options("compiler_cxx")

def configure(conf):
  conf.check_tool("compiler_cxx")
  conf.check_tool("node_addon")

def build(bld):
  arch = ""
  if bld.env['DEST_CPU'] == 'x86_64':
    arch = "arch=x64"
    print "x86"
  elif bld.env['DEST_CPU'] == 'x86':
    arch = "arch=x86"
    print "x86"
  elif bld.env['DEST_CPU'] == 'arm':
    arch = "arch=arm"
    print "arm_1"
  elif bld.env['DEST_CPU'] == 'mips':
    arch = "arch=mips"
    print "arm_2"
  else:
    raise Exception(bld.env['DEST_CPU'], "is not one of these supported
architectures: x86, x86_64, arm, mips")
  print "Working fine with arm"
  arch = "arch=arm"
  cross_arch = True
  bld.env['AR'] =
'/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueab i/bin/arm-montavista-linux-gnueabi-ar'
  bld.env['CC'] =
'/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueab i/bin/arm-montavista-linux-gnueabi-gcc'
  bld.env['LINK_CC'] =
'/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueab i/bin/arm-montavista-linux-gnueabi-gcc'
  bld.env['LIBDIR'] = '/home/pavincoll/Desktop/ARMRFS3/usr/lib'
  obj = bld.new_task_gen("cxx", "shlib", "node_addon")
  obj.target = "aqARM"
  obj.source = "NJSAQ.cc"
  obj.includes = ["/home/pavincoll/Desktop/ARMRFS3/usr/include",
"/home/pavincoll/Desktop/ARMRFS3/usr/include/alsa",
"/home/pavincoll/Desktop/ARMRFS3/usr/include/curl",
"/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueab i/arm-montavista-linux-gnueabi/target-toolchain/arm-montavista-linux-gnueab i/libc/usr/bin"
, "/home/pavincoll/Desktop/ARMRFS3/usr/lib",
"/home/pavincoll/workspace/aqstub/src" ]
  obj.lib = ["pthread","aqARM", "sqARM_1", "spARM"]

Note:

I have a folder in my Ubuntu which replicated my Target Root file system,
And i have made sure i point to that as the Library Directory path.
Also i am not using the Default Gcc compiler instead i am using the
MontaVista C++ compiler.
I set system env like CC,CPP,AR,RANLIB Variables to point to the rite
Montavista binary path.

can some one help.
thanks in advance.

Pavi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mscdex  
View profile  
 More options Aug 28 2012, 6:40 pm
From: mscdex <msc...@gmail.com>
Date: Tue, 28 Aug 2012 15:40:15 -0700 (PDT)
Local: Tues, Aug 28 2012 6:40 pm
Subject: Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe
On Aug 28, 6:34 pm, Pavi <pavinc...@gmail.com> wrote:

> Please find below the code of wscript:

First thing you should do is switch to gyp.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavi  
View profile  
 More options Aug 29 2012, 2:51 pm
From: Pavi <manicka...@gmail.com>
Date: Wed, 29 Aug 2012 11:51:34 -0700 (PDT)
Local: Wed, Aug 29 2012 2:51 pm
Subject: Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

Hi,

I shifted to gyp, and wrote binding.gyp, but still when i copy over the
*.node file to Hardware which is successfully created in my ubuntu cause me
the following error,

*[11893.676924] Alignment trap: not handling instruction e1923f9f at
[<ffff0fc4>]*
*[11893.686520] Unhandled fault: alignment exception (0x011) at 0x0001ba4d*
*Illegal instruction*
*
*
Please find below my Binding.gyp code,
{
  'targets' : [
    {
      'target_name': 'hu',
      'type': 'shared_library',
      'sourcess': [ 'NJSAQ.cc' ],
      'include_dirs': ['/home/pavincoll/Desktop/ARMRFS3/usr/include',
'/home/pavincoll/Desktop/ARMRFS3/usr/include/alsa',
'/home/pavincoll/Desktop/ARMRFS3/usr/include/curl',
'/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueab i/arm-montavista-linux-gnueabi/target-toolchain/arm-montavista-linux-gnueab i/libc/usr/bin'
, '/home/pavincoll/Desktop/ARMRFS3/usr/lib',
'/home/pavincoll/workspace/aqstub/src'],
      'link_settings': {
        'libraries': ['/usr/local/lib/libaqARM.so',
'/usr/local/lib/libsqARM_1.so', '/usr/local/lib/libspARM.so']
       }
    }
  ]

}

Pavi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavi  
View profile  
 More options Aug 29 2012, 3:03 pm
From: Pavi <manicka...@gmail.com>
Date: Wed, 29 Aug 2012 12:03:48 -0700 (PDT)
Local: Wed, Aug 29 2012 3:03 pm
Subject: Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

Some times for the same i get the below error, when created the *.node
using gyp in the Ubuntu platform and copied in to the Target.

root@bosch-nemid:~/Release-2/build/Release/lib.target# node ARM.js

module.js:480
  process.dlopen(filename, module.exports);
          ^
Error: /home/root/Release-2/build/Release/lib.target/hu.node: undefined
symbol: init
    at Object.Module._extensions..node (module.js:480:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous>
(/home/root/Release-2/build/Release/lib.target/ARM.js:1:78)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

Please find below my binding.gyp code,
{
  'targets' : [
    {
      'target_name': 'hu',
      'type': 'shared_library',
      'sourcess': [ 'NJSAQ.cc' ],
      'include_dirs': ['/home/pavincoll/Desktop/ARMRFS3/usr/include',
'/home/pavincoll/Desktop/ARMRFS3/usr/include/alsa',
'/home/pavincoll/Desktop/ARMRFS3/usr/include/curl',
'/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueab i/arm-montavista-linux-gnueabi/target-toolchain/arm-montavista-linux-gnueab i/libc/usr/bin'
, '/home/pavincoll/Desktop/ARMRFS3/usr/lib',
'/home/pavincoll/workspace/aqstub/src'],
      'link_settings': {
        'libraries': ['/usr/local/lib/libaqARM.so',
'/usr/local/lib/libsqARM_1.so', '/usr/local/lib/libspARM.so']
       }
    }
  ]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavi  
View profile  
 More options Aug 29 2012, 7:08 pm
From: Pavi <manicka...@gmail.com>
Date: Wed, 29 Aug 2012 16:08:17 -0700 (PDT)
Local: Wed, Aug 29 2012 7:08 pm
Subject: Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

I finaaly managed to  get the below error, when created the *.node using
gyp in the Ubuntu platform and copied in to the Target.

root@bosch-nemid:~/Release-2/build/Release/lib.target# node ARM.js

module.js:480
  process.dlopen(filename, module.exports);
          ^
Error: /home/root/Release-2/build/Release/lib.target/hu.node: undefined
symbol: init
    at Object.Module._extensions..node (module.js:480:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous>
(/home/root/Release-2/build/Release/lib.target/ARM.js:1:78)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

Please find below my binding.gyp code,
{
  'targets' : [
    {
      'target_name': 'hu',
      'type': 'shared_library',
      'sourcess': [ 'NJSAQ.cc' ],
      'include_dirs': ['/home/pavincoll/Desktop/ARMRFS3/usr/include',
'/home/pavincoll/Desktop/ARMRFS3/usr/include/alsa',
'/home/pavincoll/Desktop/ARMRFS3/usr/include/curl',
'/opt/tooling/mvista/MV_20110822/symphony-ivi-2.6.34/tools/tools/arm-gnueab i/arm-montavista-linux-gnueabi/target-toolchain/arm-montavista-linux-gnueab i/libc/usr/bin'
, '/home/pavincoll/Desktop/ARMRFS3/usr/lib',
'/home/pavincoll/workspace/aqstub/src'],
      'link_settings': {
        'libraries': ['/usr/local/lib/libaqARM.so',
'/usr/local/lib/libsqARM_1.so', '/usr/local/lib/libspARM.so']
       }
    }
  ]

Please find below the *.cc code,
 #include <v8.h>
#include <node.h>

#include "aq_api.h"

using namespace node;
using namespace v8;

/**
 * Checks that the passed V8 Object is of type Function and casts it
 * to a Function with the specified name.
 *
 * @param I Object to be cast to a Function.
 * @param VAR Name of the local Function variable to be created and set
 * to I.
 */
#define REQ_FUN_ARG(I, VAR)                                           \
if (args.Length() <= (I) || !args[I]->IsFunction())               \
return ThrowException(Exception::TypeError(                   \
String::New("Argument " #I " must be a function")));  \
Local<Function> VAR = Local<Function>::Cast(args[I]);

/**
 * Node.js V8 addon wrapper class for the Audio Manager.
 */
class NJSAQ : ObjectWrap
{
private:
static const int SET_PHONE_CALL_PERMISSION =2;
aq _aq;

public:

static Persistent<FunctionTemplate> s_ct;

/**
 * V8 module initializer.
 */
static void Init(Handle<Object> target)
{
HandleScope scope;

Local<FunctionTemplate> t = FunctionTemplate::New(New);

s_ct = Persistent<FunctionTemplate>::New(t);
s_ct->InstanceTemplate()->SetInternalFieldCount(1);
s_ct->SetClassName(String::NewSymbol("NJSAQ"));

NODE_SET_PROTOTYPE_METHOD(s_ct, "aqSetPhoneCallPermission",
aqSetPhoneCallPermissionAsync);

target->Set(String::NewSymbol("NJSAQ"),
s_ct->GetFunction());

}

/**
 * Default constructor.
 */
NJSAQ()
{

}

/**
 * Default destructor.
 */
~NJSAQ()
{

}

/**
 * V8 module constructor.
 */
static Handle<Value> New(const Arguments& args)
{
HandleScope scope;
NJSAQ* am = new NJSAQ();
am->Wrap(args.This());
return args.This();

}

/**
 * Data passed between dictationAsync() asynchronous functions.
 */

struct AQ_SET_PHONECALL_PERMISSIONBaton_t
{

NJSAQ *am;
Persistent<Function> callback;
bool bCallpermission;

};

static Handle<Value> aqSetPhoneCallPermissionAsync(const Arguments& args)
{

HandleScope scope;

REQ_FUN_ARG(SET_PHONE_CALL_PERMISSION - 1, callback);

NJSAQ* am = ObjectWrap::Unwrap<NJSAQ>(args.This());

AQ_SET_PHONECALL_PERMISSIONBaton_t * baton = new
AQ_SET_PHONECALL_PERMISSIONBaton_t();

baton->callback = Persistent<Function>::New(callback);
baton->am = am;

baton->bCallpermission = args[0]->BooleanValue();

am->Ref();

eio_custom(eioaqSetPhoneCallPermissionAsync, EIO_PRI_DEFAULT,
eioaqSetPhoneCallPermissionAsyncPost, baton);
ev_ref(EV_DEFAULT_UC);

return Undefined();

}

/**
 *
 */
static void eioaqSetPhoneCallPermissionAsync(eio_req *req)
{

AQ_SET_PHONECALL_PERMISSIONBaton_t *baton =
static_cast<AQ_SET_PHONECALL_PERMISSIONBaton_t*>(req->data);

baton->am->_aq.aqSetPhoneCallPermission(baton->bCallpermission);

}

/**
 *
 */
static int eioaqSetPhoneCallPermissionAsyncPost(eio_req *req)
{

HandleScope scope;
AQ_SET_PHONECALL_PERMISSIONBaton_t *baton =
static_cast<AQ_SET_PHONECALL_PERMISSIONBaton_t *>(req->data);
ev_unref(EV_DEFAULT_UC);
baton->am->Unref();

Local<Value> argv[0];

TryCatch try_catch;

baton->callback->Call(Context::GetCurrent()->Global(), 0, argv);

if (try_catch.HasCaught()) {
FatalException(try_catch);

}

baton->callback.Dispose();

delete baton;

return 0;

}
};

Persistent<FunctionTemplate> NJSAQ::s_ct;

extern "C" {
  static void init (Handle<Object> target)
  {
  NJSAQ::Init(target);
  }

  NODE_MODULE(aqARM, init);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Noordhuis  
View profile  
 More options Aug 29 2012, 7:18 pm
From: Ben Noordhuis <i...@bnoordhuis.nl>
Date: Thu, 30 Aug 2012 01:18:16 +0200
Local: Wed, Aug 29 2012 7:18 pm
Subject: Re: [nodejs] Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

On Thu, Aug 30, 2012 at 1:08 AM, Pavi <manicka...@gmail.com> wrote:
> extern "C" {
>   static void init (Handle<Object> target)

init must be non-static or it won't be visible to dlsym(). But
preferably use the NODE_MODULE macro.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavi  
View profile  
 More options Aug 29 2012, 7:59 pm
From: Pavi <manicka...@gmail.com>
Date: Wed, 29 Aug 2012 16:59:40 -0700 (PDT)
Local: Wed, Aug 29 2012 7:59 pm
Subject: Re: [nodejs] Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

Hi Ben,

I removed the static from all the places from the above code, and i still
get the same error.
Also do you mean NODE_SET_METHOD, since i am using NODE_MODULE to call init
function.

Pavi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Skyler Brungardt  
View profile  
 More options Aug 29 2012, 9:23 pm
From: Skyler Brungardt <colorfulf...@gmail.com>
Date: Wed, 29 Aug 2012 18:23:14 -0700
Local: Wed, Aug 29 2012 9:23 pm
Subject: Re: [nodejs] Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

4

--
Skyler Brungardt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Noordhuis  
View profile  
 More options Aug 30 2012, 7:54 am
From: Ben Noordhuis <i...@bnoordhuis.nl>
Date: Thu, 30 Aug 2012 13:54:10 +0200
Local: Thurs, Aug 30 2012 7:54 am
Subject: Re: [nodejs] Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

On Thu, Aug 30, 2012 at 1:59 AM, Pavi <manicka...@gmail.com> wrote:
> Hi Ben,

> I removed the static from all the places from the above code, and i still
> get the same error.
> Also do you mean NODE_SET_METHOD, since i am using NODE_MODULE to call init
> function.

Sorry, for some reason my mail reader didn't show the last two lines
of your email. What does `nm yourmodule.node | grep -E 'init|_module'`
print?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavi  
View profile  
 More options Aug 30 2012, 1:31 pm
From: Pavi <manicka...@gmail.com>
Date: Thu, 30 Aug 2012 10:31:38 -0700 (PDT)
Local: Thurs, Aug 30 2012 1:31 pm
Subject: Re: [nodejs] Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

 I removed the static from all the places from the above code, and i
still  get the same error.Also do you mean NODE_SET_METHOD, since i am
using NODE_MODULE to call init function.  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavi  
View profile  
 More options Aug 30 2012, 1:33 pm
From: Pavi <manicka...@gmail.com>
Date: Thu, 30 Aug 2012 10:33:19 -0700 (PDT)
Local: Thurs, Aug 30 2012 1:33 pm
Subject: Re: [nodejs] Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

Hi Skyler,

For some reason i am not able to view your mess , it just shows "4 --".
Can you please reply back.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Skyler Brungardt  
View profile  
 More options Aug 30 2012, 1:38 pm
From: Skyler Brungardt <colorfulf...@gmail.com>
Date: Thu, 30 Aug 2012 10:37:57 -0700
Local: Thurs, Aug 30 2012 1:37 pm
Subject: Re: [nodejs] Re: node-waf cross compilation, creating a *.node file which is created under ubuntu and run in ARM processoe

Hi Pavi,

That's a mail-reader fail.  That was meant for another thread.  Kindly disregard!  :-)

--
Skyler Brungardt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »