boost and btrfs-tools failed with Yocto build - boost

I am trying to build a custom Linux image using the Poky 2.6(thud) with ROS meta layer(thud-draft) in it. The image is built for a x86-64 system . The contents of my bblayers.conf file are given below
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
ROS_DISTRO = "melodic"
BBLAYERS ?= " \
/home/kogrob/devel/poky/meta \
/home/kogrob/devel/poky/meta-poky \
/home/kogrob/devel/poky/meta-yocto-bsp \
/home/kogrob/devel/poky/meta-openembedded/meta-oe \
/home/kogrob/devel/poky/meta-ros/meta-ros-common \
/home/kogrob/devel/poky/meta-ros/meta-ros1-melodic \
/home/kogrob/devel/poky/meta-openembedded/meta-python \
/home/kogrob/devel/poky/meta-ros/meta-ros-backports-warrior \
/home/kogrob/devel/poky/meta-ros/meta-ros1 \
"
The build failed with the following errors
Function failed: do_compile (log file is located at /home/kogrob/poky/build-toaster-2/tmp/work/core2-64-poky-linux/btrfs-tools/4.17.1-r0/temp/log.do_compile.26496)
Function failed: do_compile (log file is located at /home/kogrob/poky/build-toaster-2/tmp/work/core2-64-poky-linux/boost/1.68.0-r0/temp/log.do_compile.27908)
The boost build when it is build seperately using bitbake boost but the btrfs-tools fails everytime. What is the need of btrfs-tools and Is it possible to remove btrfs-tools and build an image without it.
The log files can be found here:
log.do_compile.26496
log.do_compile.27908

On my Unbuntu host (Ubuntu 16.04.6 LTS x86_64), try the command:
pip install setuptools
but it doens't work, because the do_compile() use yocto generated python binary, not the one Ubuntu builtin, something like this:
build/tmp/work/aarch64-sdrv-linux/btrfs-tools/4.17.1-r0/recipe-sysroot-native/usr/bin/python3-native/python3
.

Related

"File format not recognized" when building Petalinux app

I am using Petalinux 2017.2 and the included tools to build a Linux image for a Zynq ZC702 board. I am trying to add a pre-compiled executable to my rootfs with a bitbake recipe.
SUMMARY = "Demo on ARM-Linux"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = " \
file://Demo1.out \
"
FILES_${PN} = " \
/home/root/Demo/ \
/home/root/Demo/Demo1.out \
"
S = "${WORKDIR}"
do_install() {
install -d ${D}/home/root/Demo
install -m 0755 ${S}/Demo1.out ${D}/home/root/Demo
}
When I attempt to build the rootfs with my app included I get this error:
ERROR: demo-1.0-r0 do_package: objcopy failed with exit code 1 (cmd was 'arm-xilinx-linux-gnueabi-objcopy' --only-keep-debug '/home/common/peta_proj_2017.2_secure/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/demo/1.0-r0/package/home/root/Demo/Demo1.out' '/home/common/peta_proj_2017.2_secure/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/demo/1.0-r0/package/home/root/Demo/.debug/Demo1.out'):
arm-xilinx-linux-gnueabi-objcopy:/home/common/peta_proj_2017.2_secure/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/demo/1.0-r0/package/home/root/Demo/Demo1.out: File format not recognized
ERROR: demo-1.0-r0 do_package: Function failed: split_and_strip_files
I assume objcopy has an issue with my file having been compiled for arm-linux-gnueabihf, but I already know it works since I've tried copying it to the rootfs manually after Linux is booted and tested it. I would try to recompile it with the arm-xilinx-linux-gnueabi toolchain but it's missing some of the libraries I need. I don't know why objcopy is being called for this operation anyway. All I want is for it to move the file to the rootfs, but for some reason it's doing all this extra work on it. Is there a way I can make bitbake ignore the file's format?
looks like the problem is that objcopy is trying to strip symbols, and as you said, the toolchain used is not the same as the one it was used to build it.
You can try to setting:
INHIBIT_PACKAGE_STRIP="1"
somewhere (perhaps in your local.conf).
It should skip the step on which the build system tries to strip debug symbols from binaries hence will probably not invoke objcopy.
1 [https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-INHIBIT_PACKAGE_STRIP]1

OpenCV error file INSTALL cannot find /bin/opencv_annotation

I have a problem on compiling OpenCV 3.X.X on Debian but It is OK on Ubuntu. I compile OpenCV with these commands:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/opt/opencv-3.3.0/build \
-D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib-3.3.0/modules \
-D BUILD_SHARED_LIBS=ON \
-D WITH_FFMPEG=ON \
-D PYTHON_EXECUTABLE=/opt/virtualenvs/cv/bin/python \
-D BUILD_EXAMPLES=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D WITH_TBB=OFF \
-D WITH_OPENMP=ON \
-D BUILD_opencv_apps=ON \
-D BUILD_DOCS=ON ..
make -j12
sudo make install - j12
After "make install" I get this error and all shared library in build/lib that were built successfully before error, are deleted!
CMake Error at apps/annotation/cmake_install.cmake:42 (file):
file INSTALL cannot find "/opt/opencv-3.3.0/build/bin/opencv_annotation".
Call Stack (most recent call first):
apps/cmake_install.cmake:39 (include)
cmake_install.cmake:88 (include)
Makefile:66: recipe for target 'install' failed
make: *** [install] Error 1
If I set -D BUILD_opencv_apps=OFF, there is no error in compiling but again at the end all *.so files in build/lib are deleted.
Once in another computer I manage to compile OpenCV successfully but I don't know what exactly I had done.
My system has:
OpenCV 3.3.0
Debian GNU/Linux 8.9 (jessie) 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
cmake version 3.0.2
gcc (Debian 4.9.2-10) 4.9.2
What's the problem?
I found the solution. This error happens when build directory is the same with install directory, At least on some Linux distributions!
I should change install directory.

Building Qt 5.6 on macOS for the Raspberry Pi 3

I am trying to set up a cross compiling environment for the Raspberry Pi 3 on my Mac because compiling on the Pi just became to slow.
Following this guide I successfully created a cross compiler using crosstool-ng that is able to compile a simple "Hello World" program that runs on the Pi.
I try to follow the RaspberryPi2EGLFS-Guide on the Qt wiki.
It is written for Ubuntu but that should not make a difference when you have a compiler for your host system, does it?
I created the sysroot and fixed symbolic links as described in the guide, but the configure command for Qt fails.
./configure \
-release \
-opensource -confirm-license \
-make libs \
-opengl es2 \
-device linux-rpi3-g++ \
-sysroot $SYSROOT \
-opensource -confirm-license -make libs \
-prefix /usr/local/qt5pi -extprefix ~/dev/raspi/qt5pi \
-hostprefix ~/dev/raspi/qt5 \
-device-option CROSS_COMPILE=$TOOLCHAIN \
-v
There, $TOOLCHAIN points to the toolchain I compiled and $SYSROOT is the sysroot I set up according to the guide.
But the command fails with a bunch of errors because header files could not be found:
fatal error: sys/cdefs.h: No such file or directory
fatal error: zconf.h: No such file or directory
fatal error: sys/types.h: No such file or directory
Edit 12-14-2016
Apparently the compiler can't determine the cpu architecture:
/Volumes/xtools/armv8-rpi3-linux-gnueabihf/lib/gcc/armv8-rpi3-linux-gnueabihf/5.2.0/../../../../armv8-rpi3-linux-gnueabihf/bin/ld.gold: error: /Volumes/xtools/armv8-rpi3-linux-gnueabihf/armv8-rpi3-linux-gnueabihf/sysroot/usr/lib/crti.o: unknown CPU architecture
From my (limited) understanding, these headers should apear somewhere in $SYSROOT.
I have checked my sysroot, the missing headers a located in $SYSROOT/usr/include/arm-arm-linux-gnueabihf/.
I created a symlink from there to $SYSROOT/sys but that did not work either.
Am I missing something?
Other threads suggest installing g++-multilib on the host system, but there is no multlib-equivalent on macOS.

'make install' failed after 'make' KiCad on OS X 10.10

i'm trying to install kicad on osx 10.10. After successfully build make, failed
make install at
-- fixup_bundle
-- app='/Users/bolor/Downloads/KiCad/bin/eeschema.app/Contents/MacOS/eeschema'
-- libs=''
-- dirs=''
-- fixup_bundle: preparing...
-- warning: embedded item does not exist '/Users/bolor/Downloads/KiCad/bin/eeschema.app/Contents/MacOS/libboost_chrono-mt.dylib'
--
warning: cannot resolve item '#loader_path/libboost_chrono-mt.dylib'
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: #loader_path/libboost_chrono-mt.dylib (No such file or directory)
CMake was configured like below:
cmake ../kicad \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 \
-DwxWidgets_CONFIG_EXECUTABLE=../wx-bin/bin/wx-config \
-DKICAD_SCRIPTING=OFF \
-DKICAD_SCRIPTING_MODULES=OFF \
-DKICAD_SCRIPTING_WXPYTHON=OFF \
-DCMAKE_INSTALL_PREFIX=../bin \
-DCMAKE_BUILD_TYPE=Release \
-DKICAD_SKIP_BOOST=ON \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
does anyone know how to solve this?
thanks!
i have saved all the build log in a txt file and put on dropbox readable
here
I am pretty sure that's a bug in kicad's CMake script.
Other have the same problem, see https://gist.github.com/rhaamo/497d3c94929b69874411
In
http://www.mikrocontroller.net/topic/380428
they say it either works with -DKICAD_SKIP_BOOST=ON or with letting kicad build its own Boost library.

Cross-compiling static QEMU for Windows

I've been trying to compile a static QEMU executable for Windows on a Debian box, and ran into some problems. (I'm using this guide as a reference.)
When I compile without the static flag everything works but when I compile using the static flag I get the following error during the call to configure:
ERROR: zlib check failed
Make sure to have the zlib libs and headers installed.
This is the command line:
WORK=/media/Work/qemu
cd $WORK/build/w32
(export PKG_CONFIG_PATH=$WORK/install/w32/lib/pkgconfig ;
export PKG_CONFIG_PREFIX=$WORK/install/w32 ;
#export BASH_X=-x ;
bash $BASH_X ../../qemu.git/configure --target-list="i386-softmmu" \
--cross-prefix=i686-w64-mingw32- \
--extra-ldflags="-L$WORK/install/w32/lib" \
--extra-cflags="-I$WORK/install/w32/include" \
--static \
)
You can disable the zlib test using the command line input
./configure --disable-zlib-test
Zlib will be needed to build qemu, but it will not test for the library during configure. If the library is available in the proper location during build process, you can try the above command to proceed.

Resources