[OE-core] question about -native and prefix

Richard Purdie richard.purdie at linuxfoundation.org
Sun Jun 5 22:02:18 UTC 2016


Hi,

On Sun, 2016-06-05 at 23:35 +0200, Nicolas Dechesne wrote:
> i was looking at log files and I noticed that when building a
> 'native'
> recipe ${prefix} is set to the sysroot path, e.g.
> 
> export prefix="/home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb
> -glibc/sysroots/x86_64-linux/usr"
> 
> as such during do_install() files are typically installed in
> ${DESTDIR}${prefix}, and as such we end up with a 'weird' path, such
> as :
> 
> x86_64-linux-libtool: install: /usr/bin/install -c
> .libs/libopkg.so.1.0.0
> /home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb
> -glibc/work/x86_64-linux/opkg-native/1_0.3.0
> -r0/image/home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb
> -glibc/sysroots/x86_64-linux/usr/lib/libopkg.so.1.\
> 
> e.g. the 'full path' of the sysroot is recreated inside ${D}. It
> doesn't seem to make anything bad, but i just noticed it, and it
> surprised me. what's the rationale for that?
> 
> I would have expected to find the sysroot 'relative' path in ${D}. n
> the the absolute path.

Whilst this looks a bit ugly, it is actually doing the right thing.
Native binaries are designed to install and run in $prefix. When we
install them in do_install, there is a DESTDIR as you mention which is
within WORKDIR, then a $prefix beyond that.

If you try and do anything else you end up handcrafting do_install for
natives, or the sysroot or some other solution and you end up having to
hack things. With this approach, whilst the paths are long, "it just
works". So it is actually by design and in the big picture does make
sense when you step back and think about it.

Cheers,

Richard




More information about the Openembedded-core mailing list