[OE-core] NativeSDK recipe trying to link against SDK installation path

Tobias Olausson tobias.olausson at pelagicore.com
Fri Sep 19 14:58:18 UTC 2014


I'm having issues with a package that I want to build for an SDK. The
package I want to build is dbus-c++ for nativesdk. I have used a recipe
converted from use for building the package for target (which works btw),
see below. The problem is that during the build of the package, the linker
looks for libraries in /opt/.../lib/ etc, which is the default location for
installing the SDK. Of course that fails, since the SDK has not yet been
installed when I'm building it!

I'm guessing this is an issue with the recipe, but looking at the automake
files in the library directory (using -c devshell) has not proven
successful as of yet. The package is configured with autotools.

====== begin nativesdk-dbus-c++.bb =======
inherit nativesdk

DESCRIPTION = "C++ bindings for dbus"
LICENSE = "LGPLv2.1+"
SECTION = "libs"
DEPENDS = "dbus expat glib-2.0"

SRCREV = "1f6f3e6e966e0b453edc4a82338dc27966c37505"

PE = "1"
PV = "0.6.0-pre1+gitr${SRCPV}"

SRC_URI = " \
    git://gitorious.org/dbus-cplusplus/mainline.git;protocol=git \
    file://dbus-c++.patch \
    "

S = "${WORKDIR}/git"

inherit autotools pkgconfig
EXTRA_OECONF += "--disable-ecore --disable-tests
--with-build-libdbus-cxx=${STAGING_LIBDIR}"

# Fix some build issues
do_configure_append () {
    sed -i 's#dbusxx_xml2cpp_LDADD = $(xml_LIBS)#dbusxx_xml2cpp_LDADD =
$(xml_LIBS) -L${STAGING_LIBDIR}#g' ${S}/tools/Makefile.am
    sed -i 's#libdbus_cxx_la = $(BUILD_LIBDBUS_CXX_DIR)/src/#libdbus_cxx_la
= $(BUILD_LIBDBUS_CXX_DIR)/#g' ${S}/tools/Makefile.am
    sed -i 's#-I$(top_builddir)/include#-I$(top_builddir)/include
-I${STAGING_INCDIR} -L${STAGING_LIBDIR}#g' ${S}/tools/Makefile.am
}

FILES_${PN} = "${libdir}/*.so.*"
LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
====== end nativesdk-dbus-c++.bb =======

I have tried both with and without the configure_append, it does not seem
to make any difference. The output from bitbake is this (dots in paths are
mine for readability):

<snip>
| g++  -DHAVE_CONFIG_H -I. -I..
-I/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/include/dbus-1.0
-I/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/lib/dbus-1.0/include
-I../include -I../include
-I/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/include
-L/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/lib -Wall
-isystem/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/include
-isystem/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/include -O2
-pipe -fvisibility=hidden -c -o introspect.o introspect.cpp
| make[2]: *** No rule to make target
'/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/lib/libdbus-c++-1.la',
needed by 'dbusxx-introspect'.  Stop.
</snip>

And if I just try it again I'm also getting this:

<snip>
| x86_64-bistrosdk-linux-libtool: link: g++
-isystem/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/include -O2
-pipe -fvisibility=hidden -Wl,-rpath-link
-Wl,/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/lib -Wl,-rpath
-Wl,/opt/.../usr/lib -Wl,-O1 -Wl,-rpath-link
-Wl,/home/zarniwoop/.../build-qemu/tmp/sysroots/.../lib -Wl,-rpath
-Wl,/opt/.../lib -Wl,-O1 -o dbusxx-xml2cpp xml.o xml2cpp.o
generate_adaptor.o generate_proxy.o generator_utils.o
-L/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/lib
-L/home/zarniwoop/.../build-qemu/tmp/sysroots/.../lib
/home/zarniwoop/.../build-qemu/tmp/sysroots/.../usr/lib/libexpat.so
-L=/opt/.../usr/lib -L=/opt/.../lib
| /usr/bin/ld: cannot find /opt/.../lib/libc.so.6
| /usr/bin/ld: cannot find /opt/.../usr/lib/libc_nonshared.a
| /usr/bin/ld: cannot find /opt/.../lib/ld-linux-x86-64.so.2
| collect2: error: ld returned 1 exit status
| Makefile:437: recipe for target 'dbusxx-xml2cpp' failed
</snip>

It SHOULD link only against libraries built for the SDK, right? But for
some reason it looks for some of them in /opt/ instead of
/home/zarniwoop/.../build-qemu/tmp/sysroots/.../opt/

-- 
Tobias Olausson
M.Sc
Software Engineer

PELAGICORE | Experience Change
Ekelundsgatan 4, 6tr, SE-411 18 Gothenburg, Sweden
Mobile: +46(0)709-949162
E-Mail: tobias.olausson at pelagicore.com
IRC: wto @ FreeNode
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20140919/48abce92/attachment-0002.html>


More information about the Openembedded-core mailing list