1

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.

j0k
  • 22,600
  • 28
  • 79
  • 90
Salih
  • 11
  • 1

2 Answers2

0

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.

Luís Ramalho
  • 10,018
  • 4
  • 52
  • 67
asdf
  • 1
0

(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).