Missing essential components to build nodejs serialport

I am missing some essential components when building nodejs serialport.
I am running Colibri iMX6ULL module with a fresh copy of Linux Console Image 2.8b3.111

I load the follwing packages:

# opkg install nodejs nodejs-npm 			
# opkg install python-dev python-misc python-compiler python-multiprocessing
# opkg install packagegroup-core-buildessential packagegroup-sdk-target gcc-dev

I run the follwing npm commands:

# npm init
# npm install node-gyp node-pre-gyp rebuild
# npm install serialport --unsafe-perm --build-from-source

I get the following error:

/usr/lib/gcc/arm-angstrom-linux-gnueabi/7.2.0/../../../../arm-angstrom-linux-gnueabi/bin/ld: error: cannot open crtbeginS.o: No such file or directory
/usr/lib/gcc/arm-angstrom-linux-gnueabi/7.2.0/../../../../arm-angstrom-linux-gnueabi/bin/ld: error: cannot open crtendS.o: No such file or directory
/usr/lib/gcc/arm-angstrom-linux-gnueabi/7.2.0/../../../../arm-angstrom-linux-gnueabi/bin/ld: error: cannot find -lgcc_s
/usr/lib/gcc/arm-angstrom-linux-gnueabi/7.2.0/../../../../arm-angstrom-linux-gnueabi/bin/ld: error: cannot find -lgcc_s
/usr/lib/gcc/arm-angstrom-linux-gnueabi/7.2.0/../../../../arm-angstrom-linux-gnueabi/bin/ld: error: Release/obj.target/serialport/src/poller.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
Release/obj.target/serialport/src/poller.o:poller.cpp:function Poller::New(Nan::FunctionCallbackInfo<v8::Value> const&): error: undefined reference to '__dso_handle'
Release/obj.target/serialport/src/poller.o:poller.cpp:function Poller::Init(v8::Local<v8::Object>): error: undefined reference to '__dso_handle'

I created symlink # ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so . This removes the errors related to -lgcc_s but the other errors remain.
There is no reference to crtbeginS or crtendS on the system.

  1. Where can i source crtbeginS.o and crtendS.o from. What package are they in?
  2. How can I specific the -fPIC flag. The source code for serialport that includes poller.cpp is downloaded when “# npm install serialport” is executed, and when it fails, the code is no longer on the system.

Thanks for your help

Hi

Please have a look to this community post. Thanks.

Max

Thanks. It is good to know there is a problem with gcc, not not me. As there any other way to get the missing files rather than rebuilding the entire image from source?

hello, no unfortunately there is no other way. You need to build the entire image again.

ok. thanks.
Easier to mqtt than to rebuild an entire image for one node module

What is mqtt??

I am trying to build the serialport module in nodejs to talk to the uart. If I cant do that, then I can use mqtt messaging to send the data back and forth to a ‘C’ program that talks to the UART. MQTT (I.E. mosquitto) is a message broker which works fine with nodejs on ARM.

Ok, thanks for the Information.