Bug 64648 - cannot cross compile dbus-1.6.10 on ARM
Summary: cannot cross compile dbus-1.6.10 on ARM
Status: RESOLVED NOTOURBUG
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: ARM Linux (All)
: medium blocker
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-15 19:40 UTC by Roberto
Modified: 2013-05-16 10:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
the config.log file (17.24 KB, text/plain)
2013-05-15 19:48 UTC, Roberto
Details
a work around (779.41 KB, text/plain)
2013-05-16 06:36 UTC, Roberto
Details

Description Roberto 2013-05-15 19:40:47 UTC
Hi all,

I need to install dbus-1.6.10 which is needed by Bluez-5.5;
I'm cross compiling on a Linux Ubuntu PC (12.10) and I have the arm-xilinx-linux-gnueabi tool-chain; I'm sure this tool-chain works 

I have a problem with configuring dbus (only with dbus);
the folder with the target file system is:
/home/zedboard/rootfs64M

and I use this command:

groupadd -g 18 messagebus &&
useradd -c "D-Bus Message Daemon User" -d /home/zedboard/rootfs64M/var/run/dbus \
-u 18 -g messagebus -s /home/zedboard/rootfs64M/bin/false messagebus

export LDFLAGS=-Wl,-L/home/zedboard/rootfs64M/usr/lib,-lexpat
export CPPFLAGS=-I/home/zedboard/rootfs64M/usr/include
./configure \
--host=arm-xilinx-linux-gnueabi \
--prefix=/home/zedboard/rootfs64M/usr \
--sysconfdir=/home/zedboard/rootfs64M/etc \
--localstatedir=/home/zedboard/rootfs64M/var \
--libexecdir=/home/zedboard/rootfs64M/usr/lib/dbus-1.0 \
--with-console-auth-dir=/home/zedboard/rootfs64M/run/console/ \
--without-systemdsystemunitdir \
--disable-systemd \
--disable-static

the result is:
...
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... yes
checking for gcc... arm-xilinx-linux-gnueabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/zedboard/git_folder/dbus-1.6.10':
configure: error: C compiler cannot create executables
See `config.log' for more details
zedboard:\>

and then it stops!

the config.log shows:

...
gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50) 
configure:3970: $? = 0
configure:3959: arm-xilinx-linux-gnueabi-gcc -V >&5
arm-xilinx-linux-gnueabi-gcc: error: unrecognized option '-V'
arm-xilinx-linux-gnueabi-gcc: fatal error: no input files
compilation terminated.
configure:3970: $? = 1
configure:3959: arm-xilinx-linux-gnueabi-gcc -qversion >&5
arm-xilinx-linux-gnueabi-gcc: error: unrecognized option '-qversion'
arm-xilinx-linux-gnueabi-gcc: fatal error: no input files
compilation terminated.
configure:3970: $? = 1
configure:3990: checking whether the C compiler works
configure:4012: arm-xilinx-linux-gnueabi-gcc  -I/home/zedboard/rootfs64M/usr/include -Wl,-L/home/zedboard/rootfs64M/usr/lib,-lexpat conftest.c  >&5
/opt/Xilinx/14.3/ISE_SE/common/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.6.1/../../../../arm-xilinx-linux-gnueabi/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
configure:4016: $? = 1
configure:4054: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "dbus"
| #define PACKAGE_TARNAME "dbus"
| #define PACKAGE_VERSION "1.6.10"
| #define PACKAGE_STRING "dbus 1.6.10"
| #define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=dbus"
| #define PACKAGE_URL ""
| #define PACKAGE "dbus"
| #define VERSION "1.6.10"
| #define GETTEXT_PACKAGE "dbus-1"
| #define DBUS_DAEMON_NAME "dbus-daemon"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4059: error: in `/home/zedboard/working_area/zedboardFS/git_folder/dbus-1.6.10':
configure:4061: error: C compiler cannot create executables
See `config.log' for more details
...

since the gcc is working, I could compile the package if I could avoid the check on the compiler

could you fix this problem in some way?

best regards,
Roberto
Comment 1 Roberto 2013-05-15 19:48:00 UTC
Created attachment 79364 [details]
the config.log file

in attachment the config.log
Comment 2 Roberto 2013-05-16 06:36:40 UTC
Created attachment 79379 [details]
a work around

I've found the problem, it is in the configure scripts: when the configure script tests if the compiler is a cross compiler it expects results (line 4157):
- 0: in this case is not cross compiler
- maybe: in this case is a cross compiler

"maybe" is a variable defined at line 1441:
# FIXME: To remove some day.
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi

and is from some old work around


in my case the result of the cross compilation test is 126, that is different from 0 and from "maybe"

my work around is modifying line 4157
from:
    if test "$cross_compiling" = maybe; then
to:
    if test "$cross_compiling" != 0; then

in this case the configure creates the Makefile
Comment 3 Simon McVittie 2013-05-16 09:52:32 UTC
> export LDFLAGS=-Wl,-L/home/zedboard/rootfs64M/usr/lib,-lexpat
...
> /opt/Xilinx/14.3/ISE_SE/common/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.6.1/../../../../arm-xilinx-linux-gnueabi/bin/ld: cannot find -lexpat

Don't set the LDFLAGS environment variable to point to a library that doesn't exist. If you do, your compiler won't compile very well.
Comment 4 Roberto 2013-05-16 10:11:19 UTC
(In reply to comment #3)
> > export LDFLAGS=-Wl,-L/home/zedboard/rootfs64M/usr/lib,-lexpat
> ...
> > /opt/Xilinx/14.3/ISE_SE/common/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.6.1/../../../../arm-xilinx-linux-gnueabi/bin/ld: cannot find -lexpat
> 
> Don't set the LDFLAGS environment variable to point to a library that
> doesn't exist. If you do, your compiler won't compile very well.

Hi,

the error above was due to a bad compilation of expat, now I cross-compiled expat and the files are in <TARGET>/usr/include and <TARGET>/usr/lib;

if I unset LDFLAGS when I launch the ./configure I receive this error:

checking for XML_ParserCreate_MM in -lexpat... no
configure: error: Could not find expat.h, check config.log for failed attempts

I think this is another bug in the configure script;

If I export the LDFLAGS the compilation is ok (at least no errors)

As soon as I have compiled the entire system I can check if everything is working fine,

thank you,
  Roberto


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.