Bitbake build errors

Hello,

I have an application that is comprised of C++ and C code modules. I have two bitbake builds, prod and dev. The dev image builds 100% of the time. The difference between prod and dev, dev has debug tools, prod build the main application and attempts to include it in the image. I cannot build the prod image. I am getting two errors that I cannot resolve. Note that my build script works on the target hardware as well as the development Ubnuntu platform.

I am using autotools, autogen.sh, configure.ac and makefile.am to build my application. The files are uploaded to this question.
mainapplication_0.0.bb (752 Bytes)
autogen.sh (142 Bytes)
build_project.sh (822 Bytes)
configure.ac (371 Bytes)
Makefile.am (316 Bytes)
myapplication.bb (160 Bytes)
myapplication.inc (1.4 KB)
myapplication-dev.bb (311 Bytes)

I have also attached my main image .inc and .bb files. I have installed can-utils and boost as required by my project.

The errors I am getting are as follows.
The following come from the same area of interest:

arm-poky-linux-gnueabi-gcc  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot -DPACKAGE_NAME=\"MAIN_Application\" -DPACKAGE_TARNAME=\"main_application\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"MAIN_Application\ 0.0.1\" -DPACKAGE_BUGREPORT=\"michaelminer@smartrendmfg.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"main_application\" -DVERSION=\"0.0.1\" -I. -I../MAIN_Application  -D_REENTRANT -D__X86_VERSION__ -DLINUX -I../MAIN_Application/include -I../MAIN_Application/include/comms/CAN -I../MAIN_Application/include/comms/PLC -I../MAIN_Application/include/comms/UART -I../MAIN_Application/include/CML_Integration -I../MAIN_Application/include/config_parsing -I../MAIN_Application/include/utilities -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/include -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/EV -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/EV/model/Generic -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/EV/net -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/EV/state -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/EVVisitor -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/common -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/common/configuration -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/common/configuration/ev -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/common/msg -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/common/net -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/common/states -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/v2g/ApiV2g/ev -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/v2g/appHandshake -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/v2g/codec -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/v2g/iso1 -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/v2g/iso2 -I../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/v2g/xmldsig -I../MAIN_Application/vendor/carmedialab/SMG/trunk/TmCommon/sources/CmlCommon -I../MAIN_Application/vendor/carmedialab/SMG/trunk/TmCommon/sources/DccCommon   -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0=/usr/src/debug/mainapplication/0.0-r0                      -fdebug-prefix-map=/home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0=/usr/src/debug/mainapplication/0.0-r0                      -fdebug-prefix-map=/home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot-native=  -c -o src/utilities/dictionary.o ../MAIN_Application/src/utilities/dictionary.c
In file included from /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/boost/config/detail/select_stdlib_config.hpp:24,
                 from /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/boost/config.hpp:44,
                 from /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/boost/smart_ptr/bad_weak_ptr.hpp:20,
                 from /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/boost/smart_ptr/detail/shared_count.hpp:25,
                 from /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/boost/smart_ptr/shared_ptr.hpp:17,
                 from /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/boost/shared_ptr.hpp:17,
                 from ../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/EV/state/IsoStatesMachine.h:6,
                 from ../MAIN_Application/include/CML_Integration/cml_integration.hpp:18,
                 from ../MAIN_Application/src/main.cpp:13:
../MAIN_Application/version:1:1: error: too many decimal points in number
    1 | 0.0.0
      | ^~~~~
	  
version:1:1: error: expected unqualified-id before numeric constant

This is coming from /build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/c++/10.2.0

The next is


In file included from /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/sys/socket.h:33,
                 from /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/netinet/in.h:23,
                 from ../MAIN_Application/vendor/carmedialab/SMG/trunk/ISO15118_Stack/sources/common/net/v2gtp.h:34,
                 from ../MAIN_Application/src/CML_Integration/sources/EV/state/dc/SMG_EvStateImpl.cpp:7:
/home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/recipe-sysroot/usr/include/bits/socket.h:260:5: error: 'socklen_t' does not name a type; did you mean 'locale_t'?

socklen_t is defined in unistd.h which is present in my recipe-sysroot folder under usr/include. Is there a clear issue with my build files? I have been searching for an answer for a few days now and I have come up empty handed. Hoping someone here can assist.

I changed my mainapplication_0.0.bb to remove autotools and to run my build script as so.

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "\
    file://MAIN_Application \
        file://services \   
    "

inherit systemd

S = "${WORKDIR}/MAIN_Application"

DEPENDS = "\
	libsocketcan \
	boost \
	dbcppp \
	"

SYSTEMD_SERVICE_${PN} = "mainapplication.service"

do_compile (){
    cd ${S}
    ./build_project.sh
}

do_install_append () {
    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/services/mainapplication.service ${D}${systemd_system_unitdir}
    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/mainapplication.service
    
    #install -d ${D}${bindir}
    #install -m 0755 ${WORKDIR}/MAIN_Application/MAIN_Application ${D}${bindir}
}

My bitbake now performs autogen and configuration, fails on the compilation with the boost errors.

Hi @MichaelBMiner,

I couldn’t see any obvious errors in your files. Let me ask some questions to better understand your scenario:

  • Which module and carrier board are you using? Are you trying to build the Dunfell version?
  • The only difference between the dev and the production is the recipe myapplication.bb and myapplication-dev.bb, is that correct?
  • When you say the build script is working in the OS Host machine, can you please check if it’s using the same compiler version from your recipe build?
  • Which image are you trying to build? tdx-reference-minimal-image?

Best Regards,
Hiago.

  • I am using an imx system, but I have found these forums to be very helpful.
  • The difference between the two builds is specified in the the bb files. -dev contains debug tweaks, and eclipse support. -dev does not build my main application.
  • When I run build_project.sh in ubuntu this works and I get a runnable binary. Of course this binary only runs in Ubuntu. The compiler is arm-poky-linux-gnueabi-gcc for C and arm-poky-linux-gnueabi-g++ for C++. This appears to be the same on both platforms.

Hi Michael,
Thank you for reaching out. We know our forums and documentation have been helpful to a lot of our HW customers as well as others using similar silicon that we use. Unfortunately as much as we want to help out we do have to prioritize support requests and of course since it is a value add we give to our customers for free we have to prioritize those questions. Also, we can easily go down a rabbit hole when looking to do support without being able to check on the same HW or build systems. I would recommend checking with the hardware vendor you are using.
Best regards,

Here’s a really stupid question from Captain Obvious.

Are you performing a full clean between each build?

Yocto/Bitbake is not a partial build friendly system. You have to nuke all of the object and generated files prior to trying to build with even a slightly (let alone PROD/DEV) different set of recipes. Yes, on a really good machine a full build takes 3.5 hours and on a feeble machine will take over a day, but that’s how the eggs are fried. You can’t skip steps or take shortcuts.

Assuming you created a “standard” development directory structure under Ubuntu, save the following as ~/bin/nuke-yocto-build and make certain you make it executable.

cd ~/yocto_work
rm -rf sstate-cache/
cd build-torizon/
rm -rf cache/
mkdir cache
rm -rf tmp
mkdir tmp
rm -rf buildhistory
mkdir buildhistory
rm -rf deploy
mkdir deploy

Nothing will get rid of unexplained weirdness faster than a nuclear strike.