Tried cross compiling file but it is throwing error: cannot find -lbluetooth

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tried cross compiling file but it is throwing error: cannot find -lbluetooth

210 Views
SaiBharat
Contributor I

Greetings,

I am trying to integrate LBEE5PK2AE-564 WiFi/BT module with USB interface (using CYW4373E chipset) with imx8mm (Android) and want to test WiFi/BT in Android, 

I have tested the WiFi successfully and now trying to integrate and test Bluetooth, but in order to test the Bluetooth we used a binary (brcm_patchram_plus_usb_64bit) to load the firmware in the Linux but in Android the binary does not work as it is different linker.

For Example:

This is the binary they have provided:

# file brcm_patchram_plus_usb_64bit                                                                                

brcm_patchram_plus_usb_64bit: ELF shared object, 64-bit LSB arm64, dynamic (/lib/ld-linux-aarch64.so.1), BuildID=403983701e4aaf5728177f1e9b6e91db9354cdd1, not stripped

 

And this is present in our source for reference architecture:

# file cmd

cmd: ELF shared object, 64-bit LSB arm64, dynamic (/system/bin/linker64), for Android 30, BuildID=f97435a45132606a0c701ed5c1709bd5, stripped

 

And as you can see the dynamic lib linker is different. And when i execute the binary you they provided(given all permissions), I am getting the following error:

phyboard_polis:/vendor/bin # ./brcm_patchram_plus_usb_64bit

/system/bin/sh: ./brcm_patchram_plus_usb_64bit: No such file or directory

1|phyboard_polis:/vendor/bin #

1|phyboard_polis:/vendor/bin # ls -l brcm_patchram_plus_usb_64bit

-rwxr-xr-x 1 root shell 23840 2024-03-18 06:18 brcm_patchram_plus_usb_64bit

 

 

So I tried cross compiling by downloading the source code from GitHub but it throwing error. Please have a look at the error:

 

$ aarch64-linux-gnu-gcc -o brcm_patchram_plus_usb brcm_patchram_plus_usb.c -lbluetooth

brcm_patchram_plus_usb.c: In function ‘hci_send_cmd_func’:

brcm_patchram_plus_usb.c:311:9: warning: implicit declaration of function ‘writev’; did you mean ‘write’? [-Wimplicit-function-declaration]

 while (writev(sock, iv, ivn) < 0) {

        ^~~~~~

        write

/usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld: cannot find -lbluetooth

collect2: error: ld returned 1 exit status

 

And there is no libbluetooth.so in our toolchain.

 I request you to provide us with some procedure to cross compile the program for our architecture and the have the linker.

 Thanks.

0 Kudos
Reply
0 Replies