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

[bug] Boost cannot find "src/libs/process/build/advapi32" on MinGW GCC cross compile #17477

Open
floralrainfall opened this issue Dec 17, 2024 · 0 comments

Comments

@floralrainfall
Copy link

floralrainfall commented Dec 17, 2024

Describe the bug

Environment details: Arch Linux x86_64, Mingw GCC-14 (sourced from the Arch repositories), x86_64, libstdc++11

Default profile

  [settings]
  arch=x86_64
  build_type=Release
  compiler=clang
  compiler.cppstd=20
  compiler.libcxx=libstdc++11
  compiler.version=18
  os=Linux

Windows profile

  [settings]
  os=Windows
  arch=x86_64
  compiler=gcc
  compiler.libcxx=libstdc++11
  compiler.version=14
  
  [conf]
  tools.cmake.cmaketoolchain:generator=Ninja
  tools.build:sysroot=/usr/x86_64-w64-mingw32/
  
  [buildenv]
  CC=x86_64-w64-mingw32-gcc
  CXX=x86_64-w64-mingw32-g++
  LD=x86_64-w64-mingw32-ld
  STRIP=x86_64-w64-mingw32-strip
  RC=x86_64-w64-mingw32-windres

Boost has a problem with finding the proper windres, so I made it run a script called windres (which I had placed in /usr/bin)

  #!/bin/sh
  x86_64-w64-mingw32-windres -I/usr/x86_64-w64-mingw32/include $@

The error log:

  ======== Input profiles ========
  Profile host:
  [settings]
  arch=x86_64
  compiler=gcc
  compiler.libcxx=libstdc++11
  compiler.version=14
  os=Windows
  [conf]
  tools.build:sysroot=/usr/x86_64-w64-mingw32/
  tools.cmake.cmaketoolchain:generator=Ninja
  [buildenv]
  CC=x86_64-w64-mingw32-gcc
  CXX=x86_64-w64-mingw32-g++
  LD=x86_64-w64-mingw32-ld
  STRIP=x86_64-w64-mingw32-strip
  RC=x86_64-w64-mingw32-windres
  
  Profile build:
  [settings]
  arch=x86_64
  build_type=Release
  compiler=clang
  compiler.cppstd=20
  compiler.libcxx=libstdc++11
  compiler.version=18
  os=Linux
  
  
  ======== Computing dependency graph ========
  Graph root
      conanfile.txt: /tmp/test/conanfile.txt
  Requirements
      boost/1.86.0#d6fc1753c34b475fc7d4c23bdb8143fb - Cache
      bzip2/1.0.8#d00dac990f08d991998d624be81a9526 - Cache
      zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76 - Cache
  Build requirements
      b2/5.2.1#91bc73931a0acb655947a81569ed8b80 - Cache
  Resolved version ranges
      b2/[>=5.2 <6]: b2/5.2.1
      zlib/[>=1.2.11 <2]: zlib/1.3.1
  
  ======== Computing necessary packages ========
  Requirements
      boost/1.86.0#d6fc1753c34b475fc7d4c23bdb8143fb:f0e27e77731772683012a978879e6219244526d9 - Build
      bzip2/1.0.8#d00dac990f08d991998d624be81a9526:04fbf37ecccfda0e20dbc9054aa6832310a2337d#7f16b8bd67c1d5b2fccbc595874b7c44 - Cache
      zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76:79dc7de22d67ffd4993591bea53937255e4052db#aa51170c89fad2c554178e682eeeb98c - Cache
  Build requirements
      b2/5.2.1#91bc73931a0acb655947a81569ed8b80:63fead0844576fc02943e16909f08fcdddd6f44b#f9c46d924270b1920fa5398114be2576 - Cache
  
  ======== Installing packages ========
  b2/5.2.1: Already installed! (1 of 4)
  bzip2/1.0.8: Already installed! (2 of 4)
  zlib/1.3.1: Already installed! (3 of 4)
  
  -------- Installing package boost/1.86.0 (4 of 4) --------
  boost/1.86.0: Building from source
  boost/1.86.0: Package boost/1.86.0:f0e27e77731772683012a978879e6219244526d9
  boost/1.86.0: Building your package in /home/andi/.conan2/p/b/boostd7b6291ef070f/b
  boost/1.86.0: Calling generate()
  boost/1.86.0: Generators folder: /home/andi/.conan2/p/b/boostd7b6291ef070f/b/build/conan
  boost/1.86.0: Generating aggregated env files
  boost/1.86.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.bat']
  boost/1.86.0: Calling build()
  boost/1.86.0: WARN: replace_in_file didn't find pattern '$(>) > $(<)' in '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/libs/stacktrace/build/Jamfile.v2' file.
  boost/1.86.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
  boost/1.86.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/boost/stacktrace/detail/libbacktrace_impls.hpp' file.
  boost/1.86.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/tools/build/src/tools/gcc.jam' file.
  boost/1.86.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/tools/build/src/tools/gcc.jam' file.
  boost/1.86.0: WARN: replace_in_file didn't find pattern '    <conditional>@numa' in '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/libs/fiber/build/Jamfile.v2' file.
  boost/1.86.0: WARN: Patching user-config.jam
  boost/1.86.0: WARN: 
  using zlib : 1.3.1 : <include>"/home/andi/.conan2/p/b/zlib1024f8acc3c84/p/include" <search>"/home/andi/.conan2/p/b/zlib1024f8acc3c84/p/lib" <name>z ;
  using bzip2 : 1.0.8 : <include>"/home/andi/.conan2/p/b/bzip2d07f7778c88e7/p/include" <search>"/home/andi/.conan2/p/b/bzip2d07f7778c88e7/p/lib" <name>bz2 ;
  using "gcc" :  :  "x86_64-w64-mingw32-g++" : 
  <compileflags>"--sysroot=/usr/x86_64-w64-mingw32/" <linkflags>"--sysroot=/usr/x86_64-w64-mingw32/"  ;
  boost/1.86.0: Cross building, detecting compiler...
  boost/1.86.0: Cross building flags: []
  boost/1.86.0: WARN: b2 -q numa=on target-os=windows architecture=x86 address-model=64 binary-format=pe abi=ms --layout=system --user-config=/home/andi/.conan2/p/boost9e7ba8530cd75/s/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=off --disable-iconv threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-process --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=gcc cxxstd=14 define=_GLIBCXX_USE_CXX11_ABI=1 pch=on linkflags="" cxxflags="-fPIC" install --prefix=/home/andi/.conan2/p/b/boostd7b6291ef070f/p -j24 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/andi/.conan2/p/b/boostd7b6291ef070f/b/build"
  boost/1.86.0: RUN: b2 -q numa=on target-os=windows architecture=x86 address-model=64 binary-format=pe abi=ms --layout=system --user-config=/home/andi/.conan2/p/boost9e7ba8530cd75/s/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=off --disable-iconv threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-process --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=gcc cxxstd=14 define=_GLIBCXX_USE_CXX11_ABI=1 pch=on linkflags="" cxxflags="-fPIC" install --prefix=/home/andi/.conan2/p/b/boostd7b6291ef070f/p -j24 --abbreviate-paths -d0 --debug-configuration --build-dir="/home/andi/.conan2/p/b/boostd7b6291ef070f/b/build"
  notice: found boost-build.jam at /home/andi/.conan2/p/boost9e7ba8530cd75/s/src/boost-build.jam
  notice: loading B2 from /home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/build-system.jam
  notice: Searching '/etc' '/home/andi' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/util' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/tools' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/options' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/contrib' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/build' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2' for site-config configuration file 'site-config.jam'.
  notice: Configuration file 'site-config.jam' not found in '/etc' '/home/andi' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/util' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/tools' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/options' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/contrib' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2/build' '/home/andi/.conan2/p/b20717b8c0763fa/p/bin/.b2'.
  notice: Loading explicitly specified user configuration file:
      /home/andi/.conan2/p/boost9e7ba8530cd75/s/src/tools/build/user-config.jam
  notice: Searching '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/tools/build' for user-config configuration file 'user-config.jam'.
  notice: Loading user-config configuration file 'user-config.jam' from '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/tools/build'.
  notice: [zlib] Using pre-installed library
  notice: [zlib] Condition
  notice: [bzip2] Using pre-installed library
  notice: [bzip2] Condition
  notice: will use 'x86_64-w64-mingw32-g++' for gcc, condition <toolset>gcc-14
  notice: using gcc libraries :: <toolset>gcc-14 :: /usr/bin /usr/lib /usr/lib32 /usr/lib64
  notice: using gcc archiver :: <toolset>gcc-14 :: /usr/x86_64-w64-mingw32/bin/ar
  notice: using rc compiler :: <toolset>gcc-14 :: /usr/bin/windres
  notice: [openssl] Using pre-installed library
  notice: [openssl] Condition
  notice: using boost library auto_config <layout>system
  notice: [zlib] zlib is already configured
  notice: [bzip2] bzip is already configured
  notice: iostreams: not using lzma compression 
  notice: iostreams: not using zstd compression 
  notice: [python-cfg] Configuring python...
  notice: [python-cfg] Checking interpreter command "python"...
  notice: [python-cfg] running command 'python -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
  notice: [python-cfg] ...requested configuration matched!
  notice: [python-cfg] Details of this Python configuration:
  notice: [python-cfg]   interpreter command: "python"
  notice: [python-cfg]   include path: "/usr/include/python3.12"
  notice: [python-cfg]   library path: "/usr/lib/python3.12/config" "/usr/lib"
  notice: [python-cfg] Checking for NumPy...
  notice: [python-cfg] running command 'python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"'
  notice: [python-cfg] NumPy enabled
  Performing configuration checks
  
      - default address-model    : 64-bit [1]
      - default architecture     : x86 [1]
      - compiler supports SSE2   : yes [2]
      - compiler supports SSE4.1 : yes [2]
      - cxx11_static_assert      : yes [2]
      - has synchronization.lib  : yes [2]
      - cxx11_variadic_templates : yes [2]
      - cxx11_decltype           : yes [2]
      - GCC libquadmath and __float128 support : no [2]
      - cxx11_hdr_ratio          : yes [2]
      - cxx11_template_aliases   : yes [2]
      - cxx11_char16_t           : yes [2]
      - cxx11_char32_t           : yes [2]
      - has std::atomic_ref      : no [2]
      - has statx                : no [2]
      - has statx syscall        : no [2]
      - has BCrypt API           : yes [2]
      - cxx11_rvalue_references  : yes [2]
      - cxx11_scoped_enums       : yes [2]
      - cxx11_noexcept           : yes [2]
      - cxx11_nullptr            : yes [2]
      - cxx11_defaulted_functions : yes [2]
      - cxx11_defaulted_moves    : yes [2]
      - cxx11_deleted_functions  : yes [2]
      - cxx11_function_template_default_args : yes [2]
      - cxx11_final              : yes [2]
      - cxx11_override           : yes [2]
      - has init_priority attribute : yes [2]
      - has stat::st_blksize     : no [2]
      - has stat::st_mtim        : no [2]
      - has stat::st_mtimensec   : no [2]
      - has stat::st_mtimespec   : no [2]
      - has stat::st_birthtim    : no [2]
      - has stat::st_birthtimensec : no [2]
      - has stat::st_birthtimespec : no [2]
      - has fdopendir(O_NOFOLLOW) : no [2]
      - has dirent::d_type       : no [2]
      - has POSIX *at APIs       : no [2]
      - has fallocate            : no [2]
      - cxx11_auto_declarations  : yes [2]
      - cxx11_constexpr          : yes [2]
      - cxx11_hdr_mutex          : yes [2]
      - cxx11_hdr_tuple          : yes [2]
      - cxx11_lambdas            : yes [2]
      - cxx11_thread_local       : yes [2]
      - zlib                     : yes [2]
      - bzip2                    : yes [2]
      - cxx11_basic_alignas      : yes [2]
      - cxx11_hdr_functional     : yes [2]
      - cxx11_hdr_type_traits    : yes [2]
      - cxx11_range_based_for    : yes [2]
      - cxx11_smart_ptr          : yes [2]
      - native atomic int32 supported : yes [2]
  [errno 2] failed to scan file '/home/andi/.conan2/p/b/boostd7b6291ef070f/b/build/boost/bin.v2/libs/log/config/message-compiler/simple_event_log.rc': No such file or directory    - has message compiler     : no [2]
      - native syslog supported  : no [2]
      - pthread supports robust mutexes : no [2]
      - Boost.Regex is header-only : yes [2]
      - compiler supports SSSE3  : yes [2]
      - compiler supports AVX2   : yes [2]
      - gcc visibility           : yes [2]
      - sfinae_expr              : yes [2]
      - cxx11_unified_initialization_syntax : yes [2]
      - cxx11_hdr_initializer_list : yes [2]
      - cxx11_hdr_chrono         : yes [2]
      - cxx11_numeric_limits     : yes [2]
      - cxx11_hdr_array          : yes [2]
      - cxx11_hdr_atomic         : yes [2]
      - cxx11_allocator          : yes [2]
      - cxx11_explicit_conversion_operators : yes [2]
      - cxx14_decltype_auto      : yes [2]
      - cxx14_generic_lambdas    : yes [2]
      - cxx14_return_type_deduction : yes [2]
      - cxx14_variable_templates : yes [2]
      - gcc visibility           : yes [3]
      - cxx11_noexcept           : yes [3]
      - cxx11_rvalue_references  : yes [3]
      - sfinae_expr              : yes [3]
      - cxx11_auto_declarations  : yes [3]
      - cxx11_lambdas            : yes [3]
      - cxx11_unified_initialization_syntax : yes [3]
      - cxx11_hdr_tuple          : yes [3]
      - cxx11_hdr_initializer_list : yes [3]
      - cxx11_hdr_chrono         : yes [3]
      - cxx11_thread_local       : yes [3]
      - cxx11_constexpr          : yes [3]
      - cxx11_nullptr            : yes [3]
      - cxx11_numeric_limits     : yes [3]
      - cxx11_decltype           : yes [3]
      - cxx11_hdr_array          : yes [3]
      - cxx11_hdr_atomic         : yes [3]
      - cxx11_hdr_type_traits    : yes [3]
      - cxx11_allocator          : yes [3]
      - cxx11_explicit_conversion_operators : yes [3]
      - cxx14_decltype_auto      : yes [3]
      - cxx14_generic_lambdas    : yes [3]
      - cxx14_return_type_deduction : yes [3]
      - cxx14_variable_templates : yes [3]
      - long double support      : yes [3]
      - Has Large File Support   : yes [2]
      - Has attribute init_priority : yes [2]
  error: Unable to find file or target named
  error:     '/home/andi/.conan2/p/boost9e7ba8530cd75/s/src/libs/process/build//advapi32'
  error: referred to from project at
  error:     'libs/process/build'
  
  boost/1.86.0: ERROR: 
  Package 'f0e27e77731772683012a978879e6219244526d9' build failed
  boost/1.86.0: WARN: Build folder /home/andi/.conan2/p/b/boost4bf385e81a4e7/b/build
  ERROR: boost/1.86.0: Error in build() method, line 1167
	  self.run(full_command)
	  ConanException: Error 1 while executing

I have no idea if I've put this in the wrong place, but I am a little desperate right now.
The file "libadvapi32.a" does exist, at /usr/x86_64-w64-mingw32/lib/libadvapi32.a. I have installed the packages:
mingw-w64-binutils
mingw-w64-crt
mingw-w64-gcc
mingw-w64-headers
mingw-w64-winpthreads

How to reproduce it

Make sure to have installed the above MinGW packages.
Create a conanfile.txt in an empty directory, and make the contents of said file this:

[requires]
boost/1.86.0

[generators]
PkgConfigDeps
MesonToolchain # i have no idea if these are necessary for an empty project

Install the conan dependencies:

mkdir build
cd build
conan install .. --build=missing --profile=windows

It should show the error message above. With Clang it fails for different reasons.
Boost self identifies as using GCC rather then Clang, so don't worry about the default profile using a different compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant