conan-center-index: [question] Wrong arch-type in meson build command line

What is your question?

Hi,

Trying to compile dpdk recipe (not in mainline yet) which is ‘meson’ based. While cross compiling (x86_64 on x86_64), build fails. Reason is: for cross gcc tool, -march=x86_64 arg is being passed while it expects -march=x86-64.

Out conan profiles are common - used for both CMake and Meson. i.e. settings are correct and works well for CMake cross builds.
Any clue/help on this regard is appreciated.

Snippet of error msg: Build machine cpu family: x86_64 Build machine cpu: x86_64 Host machine cpu family: x86_64 Host machine cpu: x86_64 Target machine cpu family: x86_64 Target machine cpu: x86_64 Program pkg-config found: YES Program check-symbols.sh found: YES (/home/aos-dev/.conan2/p/b/dpdk97a5832e92632/b/src/buildtools/check-symbols.sh) Program options-ibverbs-static.sh found: YES (/home/aos-dev/.conan2/p/b/dpdk97a5832e92632/b/src/buildtools/options-ibverbs-static.sh) Program python3 (elftools) found: YES (/usr/bin/python3) modules: elftools Program cat found: YES (/usr/bin/cat) Running command: /usr/bin/cat /home/aos-dev/.conan2/p/b/dpdk97a5832e92632/b/src/ABI_VERSION — stdout — 24.2

— stderr —

Running compile: Working directory: /home/aos-dev/.conan2/p/b/dpdk97a5832e92632/b/build-relwithdebinfo/meson-private/tmp6xw4hc5y Code: extern int i; int i;


Command line:

/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-gcc -I/home/aos-dev/.conan2/p/linux406bd3fc64180/p/include /home/aos-dev/.conan2/p/b/dpdk97a5832e92632/b/build-relwithdebinfo/meson-private/tmp6xw4hc5y/testfile.c -o /home/aos-dev/.conan2/p/b/dpdk97a5832e92632/b/build-relwithdebinfo/meson-private/tmp6xw4hc5y/output.obj -c --sysroot=/usr/raicilla-sysroot -D_FILE_OFFSET_BITS=64 -O0 -march=x86_64 -> 1 stderr: cc1: error: bad value (‘x86_64’) for ‘-march=’ switch cc1: 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 cooperlake 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 znver3 btver1 btver2 native; did you mean ‘x86-64’?


Compiler for C supports arguments -march=x86_64: NO

…/src/config/meson.build:186:8: ERROR: Problem encountered: Compiler does not support “x86_64” arch flag.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

. If you think, its dpdk which has to handle, then will raise a bug against it.

We think this is an issue of dpdk, where they are mapping the host_machine.cpu() value returned by meson, directly to the -march= flag for the compiler. From what we’ve seen, meson uses x86_64, and the compiler expects x86-64. I believe this is not an issue they have encountered because it is “less frequent” to cross-build with x86_64 as the target - so it sounds like reaching out to the upstream maintainers would be a good place to start.

Just to be sure, I had to set “tools.build.cross_building:cross_build=True” flag as build/host had same arch and for it to treat it as cross compilation.

Profile host: [settings] arch=x86_64 build_type=RelWithDebInfo compiler=gcc compiler.cppstd=gnu14 compiler.libc=glibc compiler.libc.version=2.34 compiler.libcxx=libstdc++ compiler.version=10.3 os=Linux os.platform=raicilla os.version=5.10.209 [options] :fPIC=True :shared=True boost/:addr2line_location=/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-addr2line dpdk/:with_jansson=False dpdk/:with_libarchive=False dpdk/:with_libbpf=False dpdk/:with_openssl=False libcurl/:with_ntlm=False libcurl/:with_ntlm_wb=False openssl/:no_async=True openssl/*:no_zlib=True [conf] tools.build.cross_building:can_run=False tools.build.cross_building:cross_build=True tools.build:skip_test=True tools.build:sysroot=/usr/raicilla-sysroot tools.cmake.cmake_layout:build_folder_vars=[‘settings.os.platform’] tools.gnu:host_triplet=x86_64-aruba-linux-gnu [buildenv] CONAN_CMAKE_FIND_ROOT_PATH=/usr/x86-10.3-glibc-2.34 CONAN_CMAKE_SYSROOT=/usr/raicilla-sysroot CC=/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-gcc CXX=/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-g++ STRIP=/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-strip AR=/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-ar AS=/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-as LD=/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-ld RANLIB=/usr/x86-10.3-glibc-2.34/bin/x86_64-aruba_buildroot-linux-gnu-ranlib

Profile build: [settings] arch=x86_64 build_type=RelWithDebInfo compiler=gcc compiler.cppstd=gnu14 compiler.libc=glibc compiler.libc.version=2.31 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux os.platform=native os.version=5.15 [options] :fPIC=True :shared=True libcurl/:with_ntlm=False libcurl/:with_ntlm_wb=False openssl/:no_async=True openssl/:no_zlib=True [conf] tools.build:compiler_executables={‘c’: ‘/usr/bin/gcc’} tools.cmake.cmake_layout:build_folder_vars=[‘settings.os.platform’]