Thanks, but without the CXX settings there is no difference either, it still 
uses the wrong toolchain (or rather tries to and fails in the same way) . I 
have now removed the two export CXX type lines...


bitbake -c configure custom-image-mpet
Loading cache: 100% 
|#######################################################################################################################################|
 Time: 0:00:00
Loaded 5337 entries from dependency cache.
Parsing recipes: 100% 
|#####################################################################################################################################|
 Time: 0:00:00
Parsing of 3640 .bb files complete (3639 cached, 1 parsed). 5336 targets, 576 
skipped, 1 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.50.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-phytec-linux"
MACHINE              = "phyboard-pollux-imx8mp-2"
DISTRO               = "ampliphy-vendor"
DISTRO_VERSION       = "BSP-Yocto-NXP-i.MX8MP-PD22.1.1"
TUNE_FEATURES        = "aarch64 armv8a crc cortexa53 crypto"
TARGET_FPU           = ""
meta
meta-poky            = "HEAD:269265c00091fa65f93de6cad32bf24f1e7f72a3"
meta-oe
meta-networking
meta-python
meta-multimedia
meta-filesystems
meta-perl
meta-gnome           = "HEAD:f44e1a2b575826e88b8cb2725e54a7c5d29cf94a"
meta-bsp
meta-sdk
meta-ml              = "HEAD:cc4c2d1c845b48fdec989f089aee3c13d2b1e15b"
meta-chromium        = "HEAD:8be1d3a0ba0cf32e61144900597207af5698c10d"
meta-clang           = "HEAD:b0d805060791006d651efd3d7ae3dd5add8f70fe"
meta-freescale       = "HEAD:f0be684f01b53482cb43e016a5c5c1faf3ae448e"
meta-freescale-3rdparty = "HEAD:f8150f3b37cb83cba1f9e2378e57bb63e02d4610"
meta-freescale-distro = "HEAD:e6daa26ba1f748326546063d63a085ae671827d9"
meta-nxp-demo-experience = "HEAD:9dcc11ea9f525cffedbb28895e0abb443e56c3e0"
meta-python2         = "HEAD:8db9e4f6ceae33d7a4f55453d31e69f9858af4eb"
meta-qt5             = "HEAD:43f8f539d40070a70fe89136db89bf5bb1dfe7ed"
meta-virtualization  = "HEAD:7f719ef40896b6c78893add8485fda995b00d51d"
meta-rauc            = "HEAD:b344adecae6cef9a26b3c5b6a7bb344d18c074a6"
meta-phytec          = "HEAD:f023740382f01e85151a67843a08d9d965503961"
meta-ampliphy        = "HEAD:d761395629c0f8f0d06f9fd6fe128fdb001fdfec"
meta-security
meta-tpm             = "HEAD:c40e1e84da9624b9096a463dbed3b301c01c268e"
meta-custom-mpet     = "master:19ff82126c1239c9fe258555b10ee2e44d7f651a"

Initialising tasks: 100% 
|##################################################################################################################################|
 Time: 0:00:03
Sstate summary: Wanted 8 Local 4 Network 0 Missed 4 Current 193 (50% match, 98% 
complete)
Removing 1 stale sstate objects for arch phyboard_pollux_imx8mp_2: 100% 
|###################################################################################|
 Time: 0:00:00
NOTE: Executing Tasks
WARNING: optee-os-3.15.0.imx-r0 do_optee_warning: OP-TEE support is 
experimental and not ready for production use
NOTE: Tasks Summary: Attempted 891 tasks of which 885 didn't need to be rerun 
and all succeeded.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 3 seconds

Summary: There was 1 WARNING message shown.
dave@dave-TUXEDO-Aura-15-Gen1:~/Documents/Kymati/yocto/build$




bitbake -c compile custom-image-mpet
Loading cache: 100% 
|#######################################################################################################################################|
 Time: 0:00:00
Loaded 5337 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.50.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-phytec-linux"
MACHINE              = "phyboard-pollux-imx8mp-2"
DISTRO               = "ampliphy-vendor"
DISTRO_VERSION       = "BSP-Yocto-NXP-i.MX8MP-PD22.1.1"
TUNE_FEATURES        = "aarch64 armv8a crc cortexa53 crypto"
TARGET_FPU           = ""
meta
meta-poky            = "HEAD:269265c00091fa65f93de6cad32bf24f1e7f72a3"
meta-oe
meta-networking
meta-python
meta-multimedia
meta-filesystems
meta-perl
meta-gnome           = "HEAD:f44e1a2b575826e88b8cb2725e54a7c5d29cf94a"
meta-bsp
meta-sdk
meta-ml              = "HEAD:cc4c2d1c845b48fdec989f089aee3c13d2b1e15b"
meta-chromium        = "HEAD:8be1d3a0ba0cf32e61144900597207af5698c10d"
meta-clang           = "HEAD:b0d805060791006d651efd3d7ae3dd5add8f70fe"
meta-freescale       = "HEAD:f0be684f01b53482cb43e016a5c5c1faf3ae448e"
meta-freescale-3rdparty = "HEAD:f8150f3b37cb83cba1f9e2378e57bb63e02d4610"
meta-freescale-distro = "HEAD:e6daa26ba1f748326546063d63a085ae671827d9"
meta-nxp-demo-experience = "HEAD:9dcc11ea9f525cffedbb28895e0abb443e56c3e0"
meta-python2         = "HEAD:8db9e4f6ceae33d7a4f55453d31e69f9858af4eb"
meta-qt5             = "HEAD:43f8f539d40070a70fe89136db89bf5bb1dfe7ed"
meta-virtualization  = "HEAD:7f719ef40896b6c78893add8485fda995b00d51d"
meta-rauc            = "HEAD:b344adecae6cef9a26b3c5b6a7bb344d18c074a6"
meta-phytec          = "HEAD:f023740382f01e85151a67843a08d9d965503961"
meta-ampliphy        = "HEAD:d761395629c0f8f0d06f9fd6fe128fdb001fdfec"
meta-security
meta-tpm             = "HEAD:c40e1e84da9624b9096a463dbed3b301c01c268e"
meta-custom-mpet     = "master:19ff82126c1239c9fe258555b10ee2e44d7f651a"

Initialising tasks: 100% 
|##################################################################################################################################|
 Time: 0:00:02
Sstate summary: Wanted 7 Local 4 Network 0 Missed 3 Current 194 (57% match, 98% 
complete)
Removing 3 stale sstate objects for arch phyboard_pollux_imx8mp_2: 100% 
|###################################################################################|
 Time: 0:00:00
NOTE: Executing Tasks
WARNING: optee-os-3.15.0.imx-r0 do_optee_warning: OP-TEE support is 
experimental and not ready for production use
NOTE: Tasks Summary: Attempted 892 tasks of which 889 didn't need to be rerun 
and all succeeded.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 2 seconds

Summary: There was 1 WARNING message shown.




But when I build ...



bitbake custom-image-mpet
Loading cache: 100% 
|#######################################################################################################################################|
 Time: 0:00:00
Loaded 5337 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.50.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-phytec-linux"
MACHINE              = "phyboard-pollux-imx8mp-2"
DISTRO               = "ampliphy-vendor"
DISTRO_VERSION       = "BSP-Yocto-NXP-i.MX8MP-PD22.1.1"
TUNE_FEATURES        = "aarch64 armv8a crc cortexa53 crypto"
TARGET_FPU           = ""
meta
meta-poky            = "HEAD:269265c00091fa65f93de6cad32bf24f1e7f72a3"
meta-oe
meta-networking
meta-python
meta-multimedia
meta-filesystems
meta-perl
meta-gnome           = "HEAD:f44e1a2b575826e88b8cb2725e54a7c5d29cf94a"
meta-bsp
meta-sdk
meta-ml              = "HEAD:cc4c2d1c845b48fdec989f089aee3c13d2b1e15b"
meta-chromium        = "HEAD:8be1d3a0ba0cf32e61144900597207af5698c10d"
meta-clang           = "HEAD:b0d805060791006d651efd3d7ae3dd5add8f70fe"
meta-freescale       = "HEAD:f0be684f01b53482cb43e016a5c5c1faf3ae448e"
meta-freescale-3rdparty = "HEAD:f8150f3b37cb83cba1f9e2378e57bb63e02d4610"
meta-freescale-distro = "HEAD:e6daa26ba1f748326546063d63a085ae671827d9"
meta-nxp-demo-experience = "HEAD:9dcc11ea9f525cffedbb28895e0abb443e56c3e0"
meta-python2         = "HEAD:8db9e4f6ceae33d7a4f55453d31e69f9858af4eb"
meta-qt5             = "HEAD:43f8f539d40070a70fe89136db89bf5bb1dfe7ed"
meta-virtualization  = "HEAD:7f719ef40896b6c78893add8485fda995b00d51d"
meta-rauc            = "HEAD:b344adecae6cef9a26b3c5b6a7bb344d18c074a6"
meta-phytec          = "HEAD:f023740382f01e85151a67843a08d9d965503961"
meta-ampliphy        = "HEAD:d761395629c0f8f0d06f9fd6fe128fdb001fdfec"
meta-security
meta-tpm             = "HEAD:c40e1e84da9624b9096a463dbed3b301c01c268e"
meta-custom-mpet     = "master:19ff82126c1239c9fe258555b10ee2e44d7f651a"

Initialising tasks: 100% 
|##################################################################################################################################|
 Time: 0:00:04
Sstate summary: Wanted 139 Local 114 Network 0 Missed 25 Current 1038 (82% 
match, 97% complete)
Removing 9 stale sstate objects for arch phyboard_pollux_imx8mp_2: 100% 
|###################################################################################|
 Time: 0:00:00
Removing 3 stale sstate objects for arch cortexa53-crypto: 100% 
|###########################################################################################|
 Time: 0:00:00
NOTE: Executing Tasks
WARNING: optee-os-3.15.0.imx-r0 do_optee_warning: OP-TEE support is 
experimental and not ready for production use
ERROR: libkymati-1.0-r0 do_configure: Execution of 
'/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/temp/run.do_configure.1005716'
 failed with exit code 1
ERROR: Logfile of failure stored in: 
/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/temp/log.do_configure.1005716
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are 
['/home/dave/Documents/Kymati/yocto/sources/poky/../poky/meta/recipes-devtools/gcc/gcc-cross_10.2.bb:do_populate_sysroot',
 
'virtual:native:/home/dave/Documents/Kymati/yocto/sources/poky/../poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot',
 
'/home/dave/Documents/Kymati/yocto/sources/poky/../poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot',
 
'virtual:native:/home/dave/Documents/Kymati/yocto/sources/poky/../poky/meta/recipes-devtools/ninja/ninja_1.10.2.bb:do_populate_sysroot',
 
'/home/dave/Documents/Kymati/yocto/sources/poky/../poky/meta/recipes-core/glibc/glibc_2.33.bb:do_populate_sysroot',
 
'/home/dave/Documents/Kymati/yocto/sources/poky/../poky/meta/recipes-devtools/gcc/gcc-runtime_10.2.bb:do_populate_sysroot',
 
'/home/dave/Documents/Kymati/yocto/sources/poky/../poky/meta/recipes-devtools/cmake/cmake-native_3.19.5.bb:do_populate_sysroot',
 
'virtual:native:/home/dave/Documents/Kymati/yocto/sources/poky/../poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['gcc-cross-aarch64', 
'pseudo-native', 'quilt-native', 'ninja-native', 'glibc', 'gcc-runtime', 
'cmake-native', 'patch-native', 'binutils-cross-aarch64', 'flex-native', 
'libmpc-native', 'libtool-native', 'texinfo-dummy-native', 'xz-native', 
'gnu-config-native', 'zlib-native', 'mpfr-native', 'autoconf-native', 
'automake-native', 'gmp-native', 'linux-libc-headers', 're2c-native', 'libgcc', 
'bzip2-native', 'ncurses-native', 'curl-native', 'attr-native', 'm4-native', 
'gettext-minimal-native', 'pkgconfig-native', 'openssl-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_configure
| -- The CXX compiler identification is GNU 9.4.0
| -- The C compiler identification is GNU 9.4.0
| -- Detecting CXX compiler ABI info
| -- Detecting CXX compiler ABI info - failed
| -- Check for working CXX compiler: /usr/bin/g++
| -- Check for working CXX compiler: /usr/bin/g++ - broken
| CMake Error at 
/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/CMakeTestCXXCompiler.cmake:59
 (message):
|   The C++ compiler
|
|     "/usr/bin/g++"
|
|   is not able to compile a simple test program.
|
|   It fails with the following output:
|
|     Change Dir: 
/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/git/CMakeFiles/CMakeTmp
|
|     Run Build Command(s):ninja cmTC_e06e9 && [1/2] Building CXX object 
CMakeFiles/cmTC_e06e9.dir/testCXXCompiler.cxx.o
|     FAILED: CMakeFiles/cmTC_e06e9.dir/testCXXCompiler.cxx.o
|     /usr/bin/g++   -O2 -pipe -g -feliminate-unused-debug-types 
-fmacro-prefix-map=/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0=/usr/src/debug/libkymati/1.0-r0
                      
-fdebug-prefix-map=/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0=/usr/src/debug/libkymati/1.0-r0
                      
-fdebug-prefix-map=/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/recipe-sysroot=
                      
-fdebug-prefix-map=/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/recipe-sysroot-native=
  -fvisibility-inlines-hidden  -mcpu=cortex-a53 -march=armv8-a+crc+crypto 
-fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security 
-Werror=format-security  
--sysroot=/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/recipe-sysroot
 -o CMakeFiles/cmTC_e06e9.dir/testCXXCompiler.cxx.o -c testCXXCompiler.cxx
|     g++: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead
|     cc1plus: error: bad value (‘armv8-a+crc+crypto’) for ‘-march=’ switch
|     cc1plus: note: valid arguments to ‘-march=’ switch are: nocona core2 
nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell 
core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client 
icelake-server cascadelake tigerlake bonnell atom silvermont slm goldmont 
goldmont-plus tremont knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 
nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 
athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 
btver2 native
|     cc1plus: error: bad value (‘cortex-a53’) for ‘-mtune=’ switch
|     cc1plus: note: valid arguments to ‘-mtune=’ switch are: nocona core2 
nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell 
core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client 
icelake-server cascadelake tigerlake bonnell atom silvermont slm goldmont 
goldmont-plus tremont knl knm intel x86-64 eden-x2 nano nano-1000 nano-2000 
nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 
athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 
znver2 btver1 btver2 generic native
|     ninja: build stopped: subcommand failed.
|
|
|
|
|
|   CMake will not be able to correctly generate this project.
| Call Stack (most recent call first):
|   CMakeLists.txt:3 (project)
|
|
| -- Configuring incomplete, errors occurred!
| See also 
"/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/git/CMakeFiles/CMakeOutput.log".
| See also 
"/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/git/CMakeFiles/CMakeError.log".
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of 
'/home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/temp/run.do_configure.1005716'
 failed with exit code 1
ERROR: Task 
(/home/dave/Documents/Kymati/yocto/sources/poky/../meta-custom-mpet/recipes-apps/libkymati/libkymati.bb:do_configure)
 failed with exit code '1'
NOTE: Tasks Summary: Attempted 2684 tasks of which 2680 didn't need to be rerun 
and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 3 seconds

Summary: 1 task failed:
  
/home/dave/Documents/Kymati/yocto/sources/poky/../meta-custom-mpet/recipes-apps/libkymati/libkymati.bb:do_configure
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.







________________________________
From: Mikko Rapeli <mikko.rap...@linaro.org>
Sent: 17 October 2023 12:22
To: Dave Hitchman <dave.hitch...@kymati.com>
Cc: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org>
Subject: Re: [yocto] Using cmake... how?

Hi,

On Tue, Oct 17, 2023 at 10:09:42AM +0000, Dave Hitchman wrote:
> Thanks
>
> So, first, I thought - as I had seen examples that I had to put these flags 
> etc. in the configuration function but it appears that was a wrong thing.
> Now my recipe looks like:
> SUMMARY = "mylib"
> DESCRIPTION = "Fetch and build mylibi"
> LICENSE = "CLOSED"
> LIC_FILES_CHKSUM = ""
>
> ##EXTRA_OECMAKE = "all"
> inherit cmake
>
> python do_display_banner() {
>     bb.plain("***********************************************");
>     bb.plain("*                                             *");
>     bb.plain("*  mylibrecipe created by mei         *");
>     bb.plain("*                                             *");
>     bb.plain("***********************************************");
> }
>
> addtask display_banner before do_build
>
> # where and how to get source
> ## this is via git
> SRC_URI = "git://git@correct git - this works;"
>
> # where to source is stored
> S = "${WORKDIR}/git"
>
> ## was using target flags but Mikko suggested EXTRA_OECMAKE which at least 
> doesnt complain
> ##TARGET_CFLAGS += "-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON 
> -DBUILD_TOOLS=ON"
> ##TARGET_CXXFLAGS += "-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON 
> -DBUILD_TOOLS=ON"
> EXTRA_OECMAKE += "-DBUILD_PYTHON_BINDINGS=ON -DBUILD_SHARED=ON 
> -DBUILD_TOOLS=ON"
>
> ## this I think is needed to ensure the correct compilers are used... I think 
> anyway.
> export CXX="/usr/bin/arm-none-gnueabi-g++"
> export CMAKE_CXX_COMPILER="/usr/bin/arm-none-gnueabi-g++"

This is wrong. cmake.bbclass generates a toolchain file which is given
to cmake binary and this has all the compiler, binary, module, header file etc
search paths set correctly. It's up to the CMake scripts of the SW component to 
obey
these settings and not overwrite them. The SW component can amend them by 
appending
to them but not overwriting. An overwrite of any variable from toolchain.cmake
will break things in various ways. Run the "bitbake -c configure && bitbake -c 
compile" steps
manually and check the environment in a "bitbake -c devshell", for example.

> However:
> | DEBUG: Python function extend_recipe_sysroot finished
> | DEBUG: Executing shell function do_configure
> | -- The CXX compiler identification is GNU 9.4.0
> | -- The C compiler identification is GNU 9.4.0
> | -- Detecting CXX compiler ABI info
> | -- Detecting CXX compiler ABI info - failed
> | -- Check for working CXX compiler: /usr/bin/g++
> | -- Check for working CXX compiler: /usr/bin/g++ - broken
> | CMake Error at 
> /home/dave/Documents/Kymati/yocto/build/tmp/work/cortexa53-crypto-phytec-linux/libkymati/1.0-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/CMakeTestCXXCompiler.cmake:59
>  (message):
> |   The C++ compiler
> |
> |     "/usr/bin/g++"
> |
> |   is not able to compile a simple test program.
> |
>
> suggesting it is not using the c++ I thought it should be.

Yes, as said before, using the host compiled from the Linux machine instead of
yocto cross compiler for real target.

Cheers,

-Mikko
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#61371): https://lists.yoctoproject.org/g/yocto/message/61371
Mute This Topic: https://lists.yoctoproject.org/mt/101998042/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to