Reputation: 11
I am trying to set the bit-rate in i.Mx6 processor in android. I am using iproute2 utility to set bitrate for CAN controller. The command used to set the bitrate is given below:
#ip link set can0 type can bitrate 125000
While I am trying to set the bitrate in android using below command, I am getting error message.
The error message is given below:
Garbage instead of arguments \"bitrate ...\". " "Try \"ip link help\""
I analysed and debugged inside the source code of this utility and compared with the Linux utility source. I found that the error was occurred in the system call dlsym().
l = dlsym(dlh, buf);
if (l == NULL)
return NULL;
This function suppose to return some valid address. But in my case, its returning the NULL.
Upvotes: 1
Views: 1045
Reputation: 41
(1) (Android Source Code)/external/iproute2/ip/iplink.c
#define LIBDIR "/usr/lib/"
to
#define LIBDIR "/usr/lib"
(2) (Android Source Code)/external/iproute2/ip/Android.mk
+LOCAL_LDFLAGS := -Wl,-export-dynamic -Wl,--no-gc-sections
include $(BUILD_EXECUTABLE)
PS. This bug only on Android ICS(4.0.4).
Upvotes: 0
Reputation: 1
Add the following line to external/iproute2/ip/Android.mk
+LOCAL_LDFLAGS := -Wl,-export-dynamic -Wl,--no-gc-sections
include $(BUILD_EXECUTABLE)
Compile again, and it should work.
Upvotes: 0