Newbie - Building tdx-reference-multimedia-image fails

Hi, just getting started over here using the Colibri eval board, BSP 5, yocto 3.1, on a Centos 7 system. My target is the Colibri imx6ull.

I followed all of the setup pretty successfully. I did have to build a new buildtools package as mentioned in the yocto mega-manual because my Centos 7 system is a bit outdated but I can’t move too much around there. That all worked fine and I’m able to source and use the new dev tools (and other stuff) just fine.

I then proceeded to build my first image using the tdx-reference-minimal-image target. That actually failed with:

ERROR: Logfile of failure stored in: /home/dmoore/oe-core/build/tmp/work/all-tdx-linux/autoconf-archive/2019.01.06-r0/temp/log.do_package_write_ipk.11583
ERROR: Task (/home/dmoore/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/autoconf-archive/autoconf-archive_2019.01.06.bb:do_package_write_ipk) failed with exit code '1'
ERROR: shadow-securetty-4.6-r3 do_package_write_ipk: Fatal errors occurred in subprocesses:
Command 'PATH="/home/dmoore/oe-core/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/dmoore/oe-core/layers/openembedded-core/scripts:/home/dmoore/oe-core/build/tmp/work/colibri_imx6ull-tdx-linux-gnueabi/shadow-securetty/4.6-r3/recipe-sysroot-native/usr/bin/arm-tdx-linux-gnueabi:/home/dmoore/oe-core/build/tmp/work/colibri_imx6ull-tdx-linux-gnueabi/shadow-securetty/4.6-r3/recipe-sysroot/usr/bin/crossscripts:/home/dmoore/oe-core/build/tmp/work/colibri_imx6ull-tdx-linux-gnueabi/shadow-securetty/4.6-r3/recipe-sysroot-native/usr/sbin:/home/dmoore/oe-core/build/tmp/work/colibri_imx6ull-tdx-linux-gnueabi/shadow-securetty/4.6-r3/recipe-sysroot-native/usr/bin:/home/dmoore/oe-core/build/tmp/work/colibri_imx6ull-tdx-linux-gnueabi/shadow-securetty/4.6-r3/recipe-sysroot-native/sbin:/home/dmoore/oe-core/build/tmp/work/colibri_imx6ull-tdx-linux-gnueabi/shadow-securetty/4.6-r3/recipe-sysroot-native/bin:/home/dmoore/oe-core/layers/openembedded-core/bitbake/bin:/home/dmoore/oe-core/build/tmp/hosttools" opkg-build -Z xz -a "--memlimit=50% --threads=16" shadow-securetty /home/dmoore/oe-core/build/tmp/work/colibri_imx6ull-tdx-linux-gnueabi/shadow-securetty/4.6-r3/deploy-ipks/colibri_imx6ull' returned non-zero exit status 1.
Subprocess output:tar: unrecognized option '--clamp-mtime'
Try `tar --help' or `tar --usage' for more information.

I fixed that one by grabbing the new tar from the buildtools area and moving it into my /usr/bin path. I guess the opkg-build utility hard codes the tar path or something. Anyhow, I just mention it for completeness. Once I made that change, the minimal image build worked just fine.

I then moved to the tdx-reference-multimedia-image target and gave that shot. I got new errors surrounding the qtbase builds:

compiling /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/corelib/global/qt_pch.h
rcc /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/corelib/mimetypes/mimetypes.qrc
In file included from ../../include/QtCore/qbasicatomic.h:1:0,
                 from ../../include/QtCore/../../../git/src/corelib/thread/qatomic.h:46,
                 from ../../include/QtCore/qatomic.h:1,
                 from ../../include/QtCore/../../../git/src/corelib/global/qglobal.h:1302,
                 from ../../include/QtCore/qglobal.h:1,
                 from /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/corelib/global/qt_pch.h:56:
../../include/QtCore/../../../git/src/corelib/thread/qbasicatomic.h:61:4: error: #error "Qt requires C++11 support"
 #  error "Qt requires C++11 support"
    ^
../../include/QtCore/../../../git/src/corelib/thread/qbasicatomic.h:94:13: error: ‘QAtomicOps’ does not name a type
     typedef QAtomicOps<T> Ops;
             ^
In file included from ../../include/QtCore/qglobal.h:1:0,
                 from /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/corelib/global/qt_pch.h:56:
../../include/QtCore/../../../git/src/corelib/thread/qbasicatomic.h:97:23: error: ‘QAtomicOpsSupport’ was not declared in this scope
     Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform");
                       ^
../../include/QtCore/../../../git/src/corelib/global/qglobal.h:121:68: note: in definition of macro ‘Q_STATIC_ASSERT_X’
 #  define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
                                                                    ^
../../include/QtCore/../../../git/src/corelib/thread/qbasicatomic.h:97:51: error: ‘::IsSupported’ has not been declared
     Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform");
                                                   ^
../../include/QtCore/../../../git/src/corelib/global/qglobal.h:121:68: note: in definition of macro ‘Q_STATIC_ASSERT_X’
 #  define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
                                                                    ^
../../include/QtCore/../../../git/src/corelib/global/qglobal.h:121:49: error: non-constant condition for static assertion
 #  define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
                                                 ^
../../include/QtCore/../../../git/src/corelib/thread/qbasicatomic.h:97:5: note: in expansion of macro ‘Q_STATIC_ASSERT_X’
     Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform");
     ^
../../include/QtCore/../../../git/src/corelib/thread/qbasicatomic.h:97: confused by earlier errors, bailing out
compiling[f16c] /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/corelib/global/qfloat16_f16c.c
compiling /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/3rdparty/harfbuzz/src/harfbuzz-buffer.c
compiling /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/3rdparty/harfbuzz/src/harfbuzz-gdef.c
compiling /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/3rdparty/harfbuzz/src/harfbuzz-gsub.c
compiling /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/3rdparty/harfbuzz/src/harfbuzz-impl.c
compiling /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
compiling /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/3rdparty/harfbuzz/src/harfbuzz-open.c
compiling /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/3rdparty/harfbuzz/src/harfbuzz-stream.c
make[2]: *** [.pch/Qt5Core.gch/c++] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/build/src/corelib'
make[1]: *** [sub-corelib-make_first] Error 2
make[1]: Leaving directory `/home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/build/src'
make: *** [sub-src-make_first] Error 2
ERROR: oe_runmake failed
WARNING: /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/temp/run.do_compile.10994:1 exit 1 from 'exit 1'
ERROR: Execution of '/home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/temp/run.do_compile.10994' failed with exit code 1:
cd src/ && ( test -e Makefile || /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/build/bin/qmake -o Makefile /home/dmoore/oe-core/buil
d/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/src.pro ) && make -f Makefile
cd qmake/ && ( test -e Makefile.qmake-aux || /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/build/bin/qmake -o Makefile.qmake-aux /ho
me/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/qmake/qmake-aux.pro ) && make -f Makefile.qmake-aux
cd doc/ && ( test -e Makefile || /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/build/bin/qmake -o Makefile /home/dmoore/oe-core/buil
d/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/doc/doc.pro ) && make -f Makefile

and another of:

make[1]: Entering directory `/home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/build/qmake'
make binary
make[2]: Entering directory `/home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/build/qmake'
In file included from ../include/QtCore/qglobal.h:1:0,
                 from ../include/QtCore/../../../git/src/corelib/text/qchar.h:43,
                 from ../include/QtCore/qchar.h:1,
                 from ../include/QtCore/../../../git/src/corelib/text/qstring.h:49,
                 from ../include/QtCore/qstring.h:1,
                 from ../include/QtCore/../../../git/src/corelib/io/qdir.h:43,
                 from ../include/QtCore/qdir.h:1,
                 from /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/corelib/global/qlibraryinfo.cpp:41:
../include/QtCore/../../../git/src/corelib/global/qglobal.h:86:30: error: division by zero in #if
 #define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
                              ^
/home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/src/corelib/global/qlibraryinfo.cpp:679:7: note: in expansion of macro ‘QT_CONFIG’
 #elif QT_CONFIG(relocatable)
       ^

I found some references to the first error and it seems like the “fix” was to add

-std=c++11

to the build environment some way. I hesitated to move down that road as I was just starting out following the documentation to the letter.

Anyhow, long-winded but hopefully all relevant information to help me move forward?

Thanks

Hi @DaveM

Since you mentioned that you are on an outdated CentOS 7 build system, I wonder if you might have better luck building in a docker container based on something newer. I use the crops/yocto docker containers regularly and that helps isolate me from changes in my underlying OS install. Is that a feasible solution for you?

Drew

I guess I could give it a shot, but was hoping all of that yocto buildtools-extended stuff would magically solve all of my environment woes. It seemed to work with the minimal package, but I know that Qt is a beast all on its own. Although, the issue with opk-build looking specifically for tar in /usr/bin doesn’t seem like the same type of thing as this other issue.

I did notice inside some of the log.do_configure files:

> g++  -c -pipe -isystem/home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/recipe-sysroot-native/usr/include -O2 -pipe -O2 -std=gnu++11 -
w -fPIC  -I/home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/config.tests/verifyspec -I. -I/home/dmoore/oe-core/build/tmp/work/x86_6
4-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8df521-r0/git/mkspecs/linux-oe-g++ -o verifyspec.o /home/dmoore/oe-core/build/tmp/work/x86_64-linux/qtbase-native/5.14.2+gitAUTOINC+3a6d8
df521-r0/git/config.tests/verifyspec/verifyspec.cpp

So, not sure if it’s calling the right binary or not really. It also sends a -std=gnu++11 in there, and I saw lots of mention regarding -std=c++11 as the way to avoid that issue.

Ug. I thought I’d be able to nurse this Centos 7 install along forever (or at least a very long while).

Thanks for the suggestion about the continers.

I was able to reproduce this in a docker container locally. I suspect the issue is due to QT still being on Zeus while Toradex is on dunfell/LTS. As such QT probably has not tested this so I think using a container is probably your easiest solution.

Drew

Yes, if you were able to reproduce my error using a centos 7 container, I doubt I’ll have much success moving forward with the (if I want to use Qt).

One other thing…I built the toolchain according to the instructions in the yocto manual https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#required-git-tar-python-and-gcc-versions . I had to use the buildtools-extended method because of my downrev toolchain. This was all successful and I just source the newly created environment before I source my export script in the toradex environment.

Toradex also has documentation about installing a cross development toolchain at How to setup environment for Embedded Linux application development | Toradex Developer Center. I did not perform this step, as I figured the yocto way did the same thing. Should I go down that road at all?

Thanks.

Hi @DaveM,

That link is for setting up the cross-toolchain to build the boot-loader and kernel. It’s never been tested for cross-building the entire Yocto user space. I know you can setup an external toolchain with Yocto so it’s possible you can make it work. Please let me know your results if you try that.

Drew

Hi Drew,

Thanks for the info. I’m going the container route now to ease ongoing pain points.

I’m curious now why I would need that other cross-toolchain for boot-loader and kernel? If using yocto, wouldn’t it build uboot and kernel using the toolchain it has (along with all the other things in the recipes)?

– Dave

Sorry I was not clearer. Yocto still uses the toolchain it builds for building kernel and u-boot. However if you want to build either outside of Yocto you can use the external toolchain.

Drew

Got it… Thanks!

FYI, up and running with containers and both minimal and multimedia built just fine.

Thanks!

– Dave