Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 346353 - dev-libs/dbus-glib fails to crosscompile (fails when building examples)
Summary: dev-libs/dbus-glib fails to crosscompile (fails when building examples)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-21 18:21 UTC by Andrei Slavoiu
Modified: 2022-04-03 08:43 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,15.59 KB, text/plain)
2010-11-21 18:26 UTC, Andrei Slavoiu
Details
dbus-glib-0.86.ebuild.patch (dbus-glib-0.86.ebuild.patch,564 bytes, patch)
2010-11-21 19:14 UTC, Andrei Slavoiu
Details | Diff
Fix cross-compiling (dbus-glib-0.110-r1.ebuild,2.34 KB, text/plain)
2020-11-23 00:19 UTC, David Michael
Details
full build log (dbus-glib.log,225.48 KB, text/x-log)
2020-11-23 11:46 UTC, tt_1
Details
output from emerge --info (cross-target) (emerge-info,4.87 KB, text/plain)
2020-11-23 11:47 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Slavoiu 2010-11-21 18:21:38 UTC
When building examples it will try to run the dbus-binding-tool it just built, but this fails when crosscompiling:

Making all in examples
make[4]: Entering directory `/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/examples'
/bin/sh ../../libtool --mode=execute ../../dbus/dbus-binding-tool --prefix=some_object --mode=glib-server --output=example-service-glue.h /var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86/dbus/examples/example-service.xml
/bin/sh ../../libtool --mode=execute ../../dbus/dbus-binding-tool --prefix=test_object --mode=glib-server --output=example-signal-emitter-glue.h /var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86/dbus/examples/example-signal-emitter.xml
/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/examples/../../dbus/dbus-binding-tool: line 118: /var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/.libs/dbus-binding-tool: nu se poate executa fişierul binar
/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/examples/../../dbus/dbus-binding-tool: line 118: /var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/.libs/dbus-binding-tool: Success
make[4]: *** [example-service-glue.h] Error 1
make[4]: *** Waiting for unfinished jobs....
/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/examples/../../dbus/dbus-binding-tool: line 118: /var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/.libs/dbus-binding-tool: nu se poate executa fişierul binar
/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/examples/../../dbus/dbus-binding-tool: line 118: /var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/.libs/dbus-binding-tool: Success
make[4]: *** [example-signal-emitter-glue.h] Error 1
make[4]: Leaving directory `/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus/examples'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build/dbus'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-libs/dbus-glib-0.86/work/dbus-glib-0.86-build'
make: *** [all] Error 2
emake failed

Reproducible: Always

Steps to Reproduce:
Comment 1 Andrei Slavoiu 2010-11-21 18:24:13 UTC
Portage 2.2.0_alpha3 (default/linux/arm/10.0, gcc-4.5.1, unavailable, 2.6.36-gentoo-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-2.6.36-gentoo-r1-x86_64-AMD_Phenom-tm-_9350e_Quad-Core_Processor-with-gentoo-2.0.1
Timestamp of tree: Sun, 21 Nov 2010 11:25:01 +0000
ccache version 3.1.1 [enabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r2
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/ccache:     3.1.1
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.4
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.68
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.5.1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4
sys-devel/make:      3.82
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
Repositories: gentoo local sunrise
ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=armv4t -mtune=arm920t -Os -pipe"
CHOST="armv4tl-softfloat-linux-gnueabi"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=armv4t -mtune=arm920t -Os -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests binpkg-logs buildpkg ccache collision-protect distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirrors.evolva.ro/gentoo http://ftp.roedu.net/pub/mirrors/gentoo.org http://mirrors.xservers.ro/gentoo http://distfiles.gentoo.org"
LANG="ro_RO.UTF-8"
LC_ALL="ro_RO.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ro en eo"
MAKEOPTS="-j5 --load-average=8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/usr/armv4tl-softfloat-linux-gnueabi/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/sunrise"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X accessibility arm consolekit cracklib crypt dbus fam glib gmp hal iconv ipv6 jpeg lzma mng ncurses nls nptl pam passwdqc pch policykit readline sdl sha512 sqlite ssl symlink tiff truetype tslib unicode xcb xml xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="tslib" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ro en eo" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Andrei Slavoiu 2010-11-21 18:26:35 UTC
Created attachment 255045 [details]
build.log
Comment 3 Andrei Slavoiu 2010-11-21 19:14:43 UTC
Created attachment 255053 [details, diff]
dbus-glib-0.86.ebuild.patch

Fix the build error by instructing the build system to use the native dbus-binding-tool
Comment 4 Gilles Dartiguelongue (RETIRED) gentoo-dev 2010-11-21 22:31:14 UTC
Wouldn't it be even better to set this parameter always so that it also benefits prefix setups ?
Comment 5 Andrei Slavoiu 2010-11-23 19:16:12 UTC
I don't think prefix is affected by this, they compile for the same architecture as the host so running the just compiled dbus-binding-tool will not fail. And setting it all the time is dangerous as it might break regular builds, if the system did not previously have dbus-glib installed or are upgrading from a version that is too old.
Comment 6 Gilles Dartiguelongue (RETIRED) gentoo-dev 2010-11-24 09:26:45 UTC
this tool is owned by dbus, not dbus-glib :)

My comment was not about the arch problem but the location of the tool on a prefix system. CCing prefix anyway so they can give us the word :)
Comment 7 Fabian Groffen gentoo-dev 2010-11-24 09:37:34 UTC
(In reply to comment #6)
> this tool is owned by dbus, not dbus-glib :)

but dbus-glib seems to have it included (and built) as well :/

> My comment was not about the arch problem but the location of the tool on a
> prefix system. CCing prefix anyway so they can give us the word :)

It works fine because:
  [DBUS_BINDING_TOOL=$withval],[DBUS_BINDING_TOOL=\$\(top_builddir\)/dbus/dbus- binding-tool])

In other words, if you don't set that argument, it will always use the included version of the tool, which in Prefix is also correct.

It probably saves you some compilation (/me likes) if you don't use the included one, by indeed unconditionally doing something like:

  --with-dbus-binding-tool="${EPREFIX}"/usr/bin/dbus-binding-tool

on an EAPI=3 ebuild.
Comment 8 Gilles Dartiguelongue (RETIRED) gentoo-dev 2010-11-24 09:56:45 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > this tool is owned by dbus, not dbus-glib :)
> 
> but dbus-glib seems to have it included (and built) as well :/

erm, forget that, it's not in dbus package after all, my qfile foo failed me :)

so I guess the attached patch will do.
Comment 9 Arun Raghavan (RETIRED) gentoo-dev 2011-03-25 07:25:15 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > this tool is owned by dbus, not dbus-glib :)
> > 
> > but dbus-glib seems to have it included (and built) as well :/
> 
> erm, forget that, it's not in dbus package after all, my qfile foo failed me :)
> 
> so I guess the attached patch will do.

I don't think it's okay to depend on a host binary for this. Is building the examples really required?
Comment 10 Arun Raghavan (RETIRED) gentoo-dev 2011-03-25 07:32:30 UTC
(In reply to comment #9)
[...]
> I don't think it's okay to depend on a host binary for this. Is building the
> examples really required?

Scratch that, we need dbus-binding-tool in tools/ as well
Comment 11 Fabian Groffen gentoo-dev 2014-01-14 18:44:15 UTC
Prefix outta here
Comment 12 tt_1 2019-09-07 15:05:22 UTC
still a thing, as new firefox-69.0 always needs dbus-glib as a compile time dependency. it's possible to cross-compile the package and thus the library, by adding 

--with-dbus-binding-tool=/usr/bin/dbus-binding-tool

to local myconf=()

dbus-binding-tool is part of dbus-glib, so for this the host has to have dbus-glib installed before it can be cross compiled. 

I really hope this mess of depending on a long depreceated library get's cleaned up in the near future at mozilla.
Comment 13 David Michael 2020-11-23 00:19:16 UTC
Created attachment 674389 [details]
Fix cross-compiling

Here is a proper fix for this ebuild so you don't have to worry about whether a CBUILD dbus-glib was installed or not.
Comment 14 Larry the Git Cow gentoo-dev 2020-11-23 01:57:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12d36ad8ddbf9a7ac37feb4b7f51b48e93d3906c

commit 12d36ad8ddbf9a7ac37feb4b7f51b48e93d3906c
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-11-23 01:55:49 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-11-23 01:57:27 +0000

    dev-libs/dbus-glib: fix cross-compiles
    
    Thanks to David Michael for the ebuild changes
    
    Closes: https://bugs.gentoo.org/346353
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 dev-libs/dbus-glib/dbus-glib-0.110.ebuild | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)
Comment 15 tt_1 2020-11-23 11:46:43 UTC
this doesn't work for me with armv7 from amd64: 

libtool: link: x86_64-pc-linux-gnu-gcc -O2 -march=znver1 -pipe -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wfloat-equal -Wsign-compare -fno-strict-aliasing -Wl,-O1 -Wl,--as-needed -o .libs/dbus-binding-tool dbus-binding-tool-glib.o dbus-glib-tool.o  ./.libs/libdbus-gtool.a -L/usr/lib /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.110/work/dbus-glib-0.110-.arm-build/dbus/.libs/libdbus-glib-1.so ./.libs/libdbus-glib-1.so -ldbus-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lexpat
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libexpat.so when searching for -lexpat
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libdbus-1.so when searching for -ldbus-1
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgio-2.0.so when searching for -lgio-2.0
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgobject-2.0.so when searching for -lgobject-2.0
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libglib-2.0.so when searching for -lglib-2.0
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libdbus-1.so when searching for -ldbus-1
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgio-2.0.so when searching for -lgio-2.0
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgobject-2.0.so when searching for -lgobject-2.0
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libglib-2.0.so when searching for -lglib-2.0
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libexpat.so when searching for -lexpat
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
make[3]: Leaving directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.110/work/dbus-glib-0.110-.arm-build/dbus'
Making all in examples
Comment 16 tt_1 2020-11-23 11:46:59 UTC
Created attachment 674461 [details]
full build log
Comment 17 tt_1 2020-11-23 11:47:52 UTC
Created attachment 674464 [details]
output from emerge --info (cross-target)
Comment 18 David Michael 2020-11-23 14:52:11 UTC
I have no problems building for armv7a from amd64.  It seems odd that your CBUILD compiler says libraries in /usr/lib are incompatible.  Maybe you have a bad pkgconfig file adding -L/usr/lib when it should default to /usr/lib64?  My native linking command looks like this when cross-compiling:

libtool: link: x86_64-pc-linux-gnu-gcc -O1 -pipe -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wfloat-equal -Wsign-compare -fno-strict-aliasing -o .libs/test-profile test-profile.o  ../../dbus/.libs/libdbus-glib-1.so ../../dbus-gmain/tests/.libs/libtest.a -ldbus-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0

Maybe try adding tc-env_build before the emake call to reset the environment.
Comment 19 David Michael 2020-11-23 15:06:05 UTC
Oh, nevermind, I see your linking command didn't fail.  The program segfaulted.  I don't know what to tell you about that.  Try to reproduce it in gdb and see what broke.