LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-27-2015, 01:58 AM   #1
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Rep: Reputation: Disabled
Compiling bluez


Hello Linux Community,

i try to compile (not install, only compile!) bluez-libs-3.36, because i need it for bluez-utils-3.36.

I navigated into the bluez-libs folder and executed these commands in this order:
  1. aclocal
  2. autoheader
  3. autoconf
  4. automake --add-missing
  5. ./configure

It configures successfully. But if i try to execute make, then i get this:

Quote:
make[2]: Betrete Verzeichnis '/home/me/bluetooth/bluez-libs-3.36/src'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../i nclude -Wall -O2 -D_FORTIFY_SOURCE=2 -fPIC -MT bluetooth.lo -MD -MP -MF .deps /bluetooth.Tpo -c -o bluetooth.lo bluetooth.c
../libtool: line 821: X--tag=CC: command not found
../libtool: line 854: libtool: ignoring unknown tag : command not found
../libtool: line 821: X--mode=compile: command not found
../libtool: line 988: *** Warning: inferring the mode of operation is deprecated .: command not found
../libtool: line 989: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 1132: Xgcc: command not found
../libtool: line 1132: X-DHAVE_CONFIG_H: command not found
../libtool: line 1132: X-I.: command not found
../libtool: line 1132: X-I..: command not found
../libtool: line 1132: X-I../include: No such file or directory
../libtool: line 1132: X-Wall: command not found
../libtool: line 1132: X-O2: command not found
../libtool: line 1132: X-D_FORTIFY_SOURCE=2: command not found
../libtool: line 1132: X-fPIC: command not found
../libtool: line 1132: X-MT: command not found
../libtool: line 1132: Xbluetooth.lo: command not found
../libtool: line 1132: X-MD: command not found
../libtool: line 1132: X-MP: command not found
../libtool: line 1132: X-MF: command not found
../libtool: line 1132: X.deps/bluetooth.Tpo: No such file or directory
../libtool: line 1132: X-c: command not found
../libtool: line 1184: Xbluetooth.lo: command not found
../libtool: line 1189: libtool: compile: cannot determine name of library object from `': command not found
make[2]: *** [bluetooth.lo] Fehler 1
Does someone know what i did wrong?

Thank you in advance!
 
Old 08-27-2015, 02:40 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,316
Blog Entries: 9

Rep: Reputation: 4402Reputation: 4402Reputation: 4402Reputation: 4402Reputation: 4402Reputation: 4402Reputation: 4402Reputation: 4402Reputation: 4402Reputation: 4402Reputation: 4402
yes, well something went wrong there.

but let's take a step back.

why do you think you need to compile this from source? (*)
(and why do you think you wouldn't need to install it afterwards)

(*) answer should include general info about your system & setup. see first link in my signature.
 
Old 08-27-2015, 03:22 AM   #3
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
yes, well something went wrong there.

but let's take a step back.

why do you think you need to compile this from source? (*)
(and why do you think you wouldn't need to install it afterwards)

(*) answer should include general info about your system & setup. see first link in my signature.
Hi, i need to compile it from source, because my sysadmin does not allow me to install anything on this machine, because it is a developer machine and he can't risk any vulnerabilities. It's the same machine on where we create our new firmware for our company devices. But if it is necessary to install anything, then i will ask him.
I won't need to install it afterwards, because i want to cross compile it for another machine (ARM).

I simplified it a bit.
For real i used this command:

Quote:
./configure --host=arm-linux
But even when i compile it without my cross compiler, i get the same error. So i doubt that my toolchain is the source of the problem.

Edit: I just noticed that i don't have to execute "./configure" and "make", because it is already done with "autoconf" and "automake" isn't it?

Edit: More Info:

Host machine (machine where i build the code)

Quote:
Processor: Intel(R) Xeon(R) CPU E5-2420 0 @ 1.90GHz
OS Version: Linux 2.6.32-44 generic
Target machine: (the target on which the compiled file should run)

Quote:
Processor: ARM926EJ-S rev 5 (v5l)
OS Version: Linux 2.6.35.3-571

Last edited by _n00b; 08-27-2015 at 04:10 AM.
 
Old 08-27-2015, 04:44 AM   #4
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Original Poster
Rep: Reputation: Disabled
Ok i made another fresh start. I deleted all files and got new ones. I tried it without adlocal, autoheaders and all this, i only executed
Code:
./configure --host=arm-linux
then i executed make. Now it compiled successfully.

Then i finally tried to compile bluez-utils-3.36. First i executed
Code:
./configure \
--host=arm-linux \
BLUEZ_CFLAGS=-I/home/shortened_the_path/bluetooth/bluez-libs-3.36/include \
BLUEZ_LIBS="-L/home/shortened_the_path/bluetooth/bluez-libs-3.36/src/.libs -lbluetooth"
Configure was sucessfully. Then i executed make.

Now i get this error:
Code:
/usr/lib/libgmodule-2.0.so: could not read symbols: File in wrong format
Is my libgmodule-2.0.so corrupted?? Does anyone know how i can possibly solve this?

Last edited by _n00b; 08-31-2015 at 02:40 AM.
 
Old 08-27-2015, 09:16 AM   #5
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Original Poster
Rep: Reputation: Disabled
In the README i found this:
Quote:
In order to compile Bluetooth utilities you need following software packages: - Linux Bluetooth protocol stack (BlueZ)
So do i need to install BlueZ before compiling bluez-libs and bluez-utils?!
 
Old 08-28-2015, 01:21 AM   #6
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Original Poster
Rep: Reputation: Disabled
Can someone help?
 
Old 08-28-2015, 05:42 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,384

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
./configure --host=arm-linux
.
.
/usr/lib/libgmodule-2.0.so: could not read symbols: File in wrong format
All the libraries that you are going to use to compile into Bluez, must be compiled for arm-linux.

And : When you are not using an arm computer ...
... The compiler must be a cross compiler, like gcc-arm-linux !
I.e. a complete tool-chain for that particular arm** : Binutils, libc, gcc.

The easier solution : Use an arm computer identical to the target machine,
... with the same "arm OS" as the target.

-

Last edited by knudfl; 08-28-2015 at 05:52 AM.
 
1 members found this post helpful.
Old 08-28-2015, 05:53 AM   #8
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Original Poster
Rep: Reputation: Disabled
I know, i already use a toolchain. I use this one: arm-linux-gcc-4.4.3 which can be found on the following site:
https://www.mediafire.com/folder/9cs...#8wdvqqe9hfjxz

Last edited by _n00b; 08-28-2015 at 05:56 AM.
 
Old 08-28-2015, 05:56 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,384

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Re #7.


P.S. : Example, blues-libs-3.36 for arm >>>

libbluetooth2_3.36-1_arm.deb
http://archive.debian.org/debian-arc...3.36-1_arm.deb


-
 
Old 08-28-2015, 06:26 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,384

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Re #8.

Well, then you must set the compiler to 'arm-linux-gcc-4.4.3',
.. and also set the "arm libraries" at configure time, like :

Code:
$ export CC=arm-linux-gcc-4.4.3 && export LD_LIBRARY_PATH=/opt/arm/lib && export LD=/opt/arm/bin/ld-arm-linux-** && ./configure --host=arm-linux
.. to make sure that none of your system "i386 / x86_64 libs" are used.


About libgmodule-2.0.so : Must be the same glib version as the target.
I.e. you must compile glib-2.** for arm, like :
Code:
$ export CC=arm-linux-gcc-4.4.3 && export LD_LIBRARY_PATH=/opt/arm/lib  && export LD=/opt/arm/bin/ld-arm-linux-** && ./configure --host=arm-linux --prefix=/opt/arm
.. where the arm linker must be fully specified, like ld-arm-linux-??? ( arm-ld ? )


-

Last edited by knudfl; 08-28-2015 at 06:37 AM.
 
1 members found this post helpful.
Old 08-28-2015, 07:47 AM   #11
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Original Poster
Rep: Reputation: Disabled
Thank you for your answer! I just have a question about LD_LIBRARY_PATH.
In my case the path "/opt/arm/lib" does not exist. Should i set the path for LD_LIBRARY_PATH to the location where my toolchain is located (/home/mbc/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/lib) ?

EDIT:
I tried to cross compile glib-2.45.6.
First i executed these three commands:

export CC=arm-linux-gcc-4.4.3
export LD_LIBRARY_PATH=/home/mbc/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/lib
export LD=/home/mbc/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld


After this i executed:
./configure --host=arm-linux

But i get this error message:

checking for growing stack pointer... configure: error: in `/home/mbc/imx28/ltib/rpm/BUILD/mbc-tools-1.0/bluetooth/glib-2.45.6':
configure: error: cannot run test program while cross compiling


Should i create an extra thread for this problem?

Last edited by _n00b; 08-28-2015 at 08:08 AM.
 
Old 08-28-2015, 08:00 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,384

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Should I set the .. LD_LIBRARY_PATH to the location where my toolchain is located
(/home/mbc/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/lib) ?
That's the idea.
The /opt/ path was an example only.

** Make sure you have the target arm glib-2.xx version, either in the same location :
--prefix=/home/mbc/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi
(Or you will have to export the actual LD_LIBRARY_PATH for the "arm glib-2.xx").


-
 
1 members found this post helpful.
Old 08-28-2015, 09:21 AM   #13
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Original Poster
Rep: Reputation: Disabled
Thank you very much for these infos.
Do you know by any chance how to solve this other error from my last post (configure: error: cannot run test program while cross compiling). Google was not my friend this time..
 
Old 08-28-2015, 10:22 AM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,384

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Re #13.

First : You will have to start from scratch, with a new unpacked /bluez-libs_3.36.orig.tar.gz
http://archive.debian.org/debian-arc...36.orig.tar.gz

... And do not use any 'aclocal && autoheader && automake --add-missing && autoconf'.
Which will destroy the perfectly OK configure script. Therefore all the errors, post #1.

.. I don't see anything test related in bluez-libs-3.36/.
.. And I get no configure errors with my "cross-compile configuring example" :
$ export CC=avr-gcc
$ export LD=avr-ld
$ ./configure --prefix=/home/knudfl/9tmp/bluez-libs-3.36/result --host=avr


-
 
1 members found this post helpful.
Old 08-29-2015, 08:54 AM   #15
_n00b
Member
 
Registered: Aug 2015
Posts: 35

Original Poster
Rep: Reputation: Disabled
Hi, i don't get the error on bluez-libs-3.36, i get it on glib-2.45.6. I don't use 'aclocal && autoheader && automake --add-missing && autoconf' anymore since post #4.
 
  


Reply

Tags
bluetooth, bluez, cross-compile, crostool-ng


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bluez-utils cross-compiling error cloudlast Linux - Embedded & Single-board computer 5 08-27-2015 03:10 AM
Compiling and Deploying Bluez 4.x (Bluetooth Protocol Stack) linuxbawks Linux - Software 3 08-04-2013 03:02 PM
Error in cross-compiling bluez-utils mrmuds Linux - Wireless Networking 0 06-30-2009 05:49 AM
Bluez 3.36 cross compiling + cannot find library kewl Linux - Software 1 06-17-2009 12:47 PM
Cross compiling Bluez-utils for ARM deshu Linux - Software 1 03-06-2009 01:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration