Hi Bin Lan,
thanks for the link to the yocto patches and discussion. When I cross-compile babeltrace2 locally without being in the context of poky, the cross-compiled shared libraries are in ".libs".
Eg.
# Environment variables elided
# On an x86_64 build host
./configure --host=aarch64-linux-gnu
make -j
find tests/ -iname "*.so*"
If the change you are proposing is to simply remove ".libs" that would break the default behaviour for tests run following both native and cross compilation outside of the yocto context. Do you have a more general solution in mind?
I'm still familiarizing myself with the poky environment, but from what I can see when I use bitbake to build the babeltrace2 recipe, the build dir contains ".libs/" with shared objects as expected. E.g.,
debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ find tests/ -iname '*.so'
tests/lib/test-plugin-plugins/.libs/plugin-sfs.so
tests/lib/test-plugin-plugins/.libs/plugin-minimal.so
Furthermore, the LT_OBJDIR
/objdir
for libtool seem to be ".libs" within the poky build directory:
debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ grep -r LT_OBJDIR
config.status:D["LT_OBJDIR"]=" \".libs/\""
src/common/config.h:#define LT_OBJDIR ".libs/"
config.log:| #define LT_OBJDIR ".libs/"
config.log:| #define LT_OBJDIR ".libs/"
config.log:| #define LT_OBJDIR ".libs/"
config.log:| #define LT_OBJDIR ".libs/"
config.log:#define LT_OBJDIR ".libs/"
debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ grep -r objdir config*
config.log:configure:12953: checking for objdir
config.log:lt_cv_objdir=.libs
config.status:objdir='.libs'
config.status:archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
config.status: cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
config.status: echo "local: *; };" >> $output_objdir/$libname.ver~
config.status: $CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
config.status:objdir=$objdir
Is the recipe running the tests with only the contents of the "install" step or something like that?
thanks,
kienan
P.S. With respect to libtool itself the objdir
is not always ".libs". On ms-dos, for example, it would be "_libs". One way to get this information could be a short function e.g.
OBJDIR=$(
source < <(libtool --config)
echo $objdir
)