Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] boost/1.79.0: CXX not picked up from buildenv after recent update #15211

Closed
camm73 opened this issue Jan 11, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@camm73
Copy link
Contributor

camm73 commented Jan 11, 2023

Description

Previously I was setting CXX with the cross-compiler I'm using in the buildenv section of the profile; however, that has stopped working since this PR was merged: #14776. Now it cannot find the cross-compiler binary location (yields a can not find user-provided command error). Is this potentially a PATH issues with the switch to VirtualBuildEnv?

Is there a new way that I should be passing in the cross-compiler now instead?

Package and Environment Details

  • Package Name/Version: boost/1.79.0
  • Operating System+version: Linux v5.15.49
  • Compiler+version: aarch64-poky-linux-g++ (GCC) 10.2.0
  • Docker image: crops/poky:ubuntu-20.04
  • Conan version: conan 1.54.0
  • Python version: Python 3.8.10

Conan profile

Build profile:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]

Host Profile:
[settings]
os_build=Linux
arch_build=x86_64
os=Linux
arch=armv8
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++11
build_type=Release

[buildenv]
AR=aarch64-poky-linux-gcc-ar
RANLIB=aarch64-poky-linux-gcc-ranlib
CXX=aarch64-poky-linux-g++ -mcpu=cortex-a53 -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot
CPPFLAGS=
ASFLAGS=

[options]
boost:without_stacktrace=True
sentry-native:backend=none

Steps to reproduce

conan install . --profile:host=host_profile --profile:build=default --build=missing

Logs

Click to expand log
| warning: toolset gcc initialization:
| warning: can not find user-provided command 'aarch64-poky-linux-g++  -mcpu=cortex-a53 -march=armv8-a+crc -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot'
@camm73 camm73 added the bug Something isn't working label Jan 11, 2023
@camm73 camm73 changed the title [package] [package] boost/1.79.0: CXX not picked up from buildenv after recent update [package] boost/1.79.0: CXX not picked up from buildenv after recent update Jan 11, 2023
@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 11, 2023

CXX=aarch64-poky-linux-g++ -mcpu=cortex-a53 -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot

CXX should only refer to compiler executable name or path, not compiler options. CXXFLAGS (or better: tools.build.cxxflags in [conf]) is your friend.

@camm73
Copy link
Contributor Author

camm73 commented Jan 11, 2023

Thanks @SpaceIm for the help on that. I was previously populating CXX with the contents of the CXX Yocto variable which contains the flags as well. Ended up having to make a few other changes to the profile as well with regards to linking flags since I'm using a sysroot.

Will detail what I found and how I fixed it here in case someone else runs into this issue:

So I updated CXX to just be the compiler which gets rid of the command not found error. Also moved the flags to tools.build.cxxflags, however b2 is still failing in this case which was not happening before the PR I linked above:

ConanException: Error 1 while executing b2 -q target-os=linux architecture=arm address-model=64 binary-format=elf abi=aapcs --layout=system --user-config=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/source/src/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=on boost.locale.iconv.lib=libc threading=multi visibility=hidden link=static variant=release --with-atomic --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-system --with-test --with-thread --with-timer --with-type_erasure --with-wave toolset=gcc define=_GLIBCXX_USE_CXX11_ABI=1 pch=on linkflags="" cxxflags="-fPIC" install --prefix=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/package/c17c623c92e6f18eee4b972ffcd4ba7b9e6d36a9 -j5 --abbreviate-paths -d0 --debug-configuration --build-dir="/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/build/c17c623c92e6f18eee4b972ffcd4ba7b9e6d36a9/build-release"
| WARNING: /workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/temp/run.do_configure.83108:159 exit 1 from 'conan install /workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/on-network-collector-1.0.3 --profile:host=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/profiles/meta-conan_deploy --profile:build=default --build=missing -if /workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/conan_cmake_files'

Looking into config.log for the boost package the linking command fails since it appears as though the sysroot option in cxxflags is not being included in the linking command, leading to the necessary libraries not being found:

gcc.compile.c++ /workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/build/c17c623c92e6f18eee4b972ffcd4ba7b9e6d36a9/build-release/boost/bin.v2/libs/locale/build/gcc-10/rls/lnk-sttc/thrd-mlt/vsblt-hdn/has_iconv_libc_obj.o

    "aarch64-poky-linux-g++"   -fvisibility-inlines-hidden -mcpu=cortex-a53 -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security --sysroot=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot -pthread -O3 -finline-functions -Wno-inline -Wall -fvisibility=hidden -fPIC -DBOOST_ALL_NO_LIB=1 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1  -I"."  -c -o "/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/build/c17c623c92e6f18eee4b972ffcd4ba7b9e6d36a9/build-release/boost/bin.v2/libs/locale/build/gcc-10/rls/lnk-sttc/thrd-mlt/vsblt-hdn/has_iconv_libc_obj.o" "libs/locale/src/../build/has_iconv.cpp"

gcc.link /workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/build/c17c623c92e6f18eee4b972ffcd4ba7b9e6d36a9/build-release/boost/bin.v2/libs/locale/build/gcc-10/rls/lnk-sttc/thrd-mlt/vsblt-hdn/has_iconv

    "aarch64-poky-linux-g++"    -o "/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/build/c17c623c92e6f18eee4b972ffcd4ba7b9e6d36a9/build-release/boost/bin.v2/libs/locale/build/gcc-10/rls/lnk-sttc/thrd-mlt/vsblt-hdn/has_iconv" -Wl,--start-group "/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/build/c17c623c92e6f18eee4b972ffcd4ba7b9e6d36a9/build-release/boost/bin.v2/libs/locale/build/gcc-10/rls/lnk-sttc/thrd-mlt/vsblt-hdn/has_iconv_libc_obj.o"  -Wl,-Bstatic  -Wl,-Bdynamic -lrt -Wl,--end-group -pthread -fvisibility=hidden -fvisibility-inlines-hidden 

/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/10.2.0/ld: cannot find Scrt1.o: No such file or directory
/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/10.2.0/ld: cannot find crti.o: No such file or directory
/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/10.2.0/ld: cannot find crtbeginS.o: No such file or directory
/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/10.2.0/ld: cannot find -lrt
collect2: error: ld returned 1 exit status
...failed gcc.link /workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/.conan/data/boost/1.79.0/_/_/build/c17c623c92e6f18eee4b972ffcd4ba7b9e6d36a9/build-release/boost/bin.v2/libs/locale/build/gcc-10/rls/lnk-sttc/thrd-mlt/vsblt-hdn/has_iconv...
...failed updating 1 target...
...updated 8 targets...

To resolve this I also filled in the tools.build:sharedlinkflags and tools.build:exelinkflags fields in the [conf] section of the profile.

My final profile which ended up resolving this issue was:

[settings]
os_build=Linux
arch_build=x86_64
os=Linux
arch=armv8
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++11
build_type=Release

[conf]
tools.build:cflags=["-mcpu=cortex-a53", "-march=armv8-a+crc", "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-Wformat", "-Wformat-security", "--sysroot=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot"]
tools.build:cxxflags=["-mcpu=cortex-a53", "-march=armv8-a+crc", "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-Wformat", "-Wformat-security", "--sysroot=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot"]
tools.build:sharedlinkflags=["--sysroot=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot"]
tools.build:exelinkflags=["--sysroot=/workdir/kas-xilinx/build/tmp/work/cortexa53-poky-linux/python3-custom-pkg/1.0.3-r0/recipe-sysroot"]

[buildenv]
AR=aarch64-poky-linux-gcc-ar
RANLIB=aarch64-poky-linux-gcc-ranlib
CXX=aarch64-poky-linux-g++
CXXFLAGS=
CPPFLAGS=
ASFLAGS=

[options]
boost:debug_level=2
boost:without_stacktrace=True
boost:without_fiber=True
boost:without_python=True
sentry-native:backend=none

@camm73 camm73 closed this as completed Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants