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

[boost-container] Build error on wasm32-emscripten #38668

Open
tekinas opened this issue May 10, 2024 · 6 comments
Open

[boost-container] Build error on wasm32-emscripten #38668

tekinas opened this issue May 10, 2024 · 6 comments
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team.

Comments

@tekinas
Copy link

tekinas commented May 10, 2024

Package: boost-container:wasm32-emscripten@1.85.0

Host Environment

  • Host: x64-linux
  • Compiler: Clang 19.0.0
  • vcpkg-tool version: 2024-04-23-d6945642ee5c3076addd1a42c331bbf4cfc97457
    vcpkg-scripts version: cbf4a66 2024-05-09 (62 minutes ago)

To Reproduce

vcpkg install boost-math:wasm32-emscripten

Failure logs

-- Using cached boostorg-container-boost-1.85.0.tar.gz.
-- Cleaning sources at /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/tekinas/Documents/vcpkg/downloads/boostorg-container-boost-1.85.0.tar.gz
-- Using source at /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean
-- Configuring wasm32-emscripten
-- Building wasm32-emscripten-rel
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: /usr/bin/cmake --build . --config Release --target install -- -v -j9
    Working Directory: /home/tekinas/Documents/vcpkg/buildtrees/boost-container/wasm32-emscripten-rel
    See logs for more information:
      /home/tekinas/Documents/vcpkg/buildtrees/boost-container/install-wasm32-emscripten-rel-out.log

Call Stack (most recent call first):
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  installed/x64-linux/share/vcpkg-boost/boost-install.cmake:65 (vcpkg_cmake_install)
  ports/boost-container/portfile.cmake:12 (boost_configure_and_install)
  scripts/ports.cmake:175 (include)



/home/tekinas/Documents/vcpkg/buildtrees/boost-container/install-wasm32-emscripten-rel-out.log
Change Dir: '/home/tekinas/Documents/vcpkg/buildtrees/boost-container/wasm32-emscripten-rel'

Run Build Command(s): /home/tekinas/Documents/vcpkg/downloads/tools/ninja/1.10.2-linux/ninja -v -v -j9 install
[1/9] /home/tekinas/Documents/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/tekinas/Documents/vcpkg/installed/wasm32-emscripten/include -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/dlmalloc.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/dlmalloc.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/dlmalloc.cpp.o -c /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/dlmalloc.cpp
[2/9] /home/tekinas/Documents/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/tekinas/Documents/vcpkg/installed/wasm32-emscripten/include -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/unsynchronized_pool_resource.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/unsynchronized_pool_resource.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/unsynchronized_pool_resource.cpp.o -c /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/unsynchronized_pool_resource.cpp
[3/9] /home/tekinas/Documents/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/tekinas/Documents/vcpkg/installed/wasm32-emscripten/include -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o -c /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/synchronized_pool_resource.cpp
FAILED: libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o 
/home/tekinas/Documents/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/tekinas/Documents/vcpkg/installed/wasm32-emscripten/include -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o -c /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/synchronized_pool_resource.cpp
In file included from /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/synchronized_pool_resource.cpp:14:
/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:109:12: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
  109 | extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(::_RTL_CRITICAL_SECTION *);
      |            ^
/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:109:39: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
  109 | extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(::_RTL_CRITICAL_SECTION *);
      |                                       ^
/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:111:12: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
  111 | extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(::_RTL_CRITICAL_SECTION *);
      |            ^
/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:111:39: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
  111 | extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(::_RTL_CRITICAL_SECTION *);
      |                                       ^
/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:112:12: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
  112 | extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(::_RTL_CRITICAL_SECTION *);
      |            ^
/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:112:39: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
  112 | extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(::_RTL_CRITICAL_SECTION *);
      |                                       ^
/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:113:12: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
  113 | extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(::_RTL_CRITICAL_SECTION *);
      |            ^
/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:113:39: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
  113 | extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(::_RTL_CRITICAL_SECTION *);
      |                                       ^
4 warnings and 4 errors generated.
[4/9] /home/tekinas/Documents/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/tekinas/Documents/vcpkg/installed/wasm32-emscripten/include -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/monotonic_buffer_resource.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/monotonic_buffer_resource.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/monotonic_buffer_resource.cpp.o -c /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/monotonic_buffer_resource.cpp
[5/9] /home/tekinas/Documents/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/tekinas/Documents/vcpkg/installed/wasm32-emscripten/include -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/pool_resource.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/pool_resource.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/pool_resource.cpp.o -c /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/pool_resource.cpp
[6/9] /home/tekinas/Documents/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/tekinas/Documents/vcpkg/installed/wasm32-emscripten/include -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/global_resource.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/global_resource.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/global_resource.cpp.o -c /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/global_resource.cpp
[7/9] /home/tekinas/Documents/emsdk/upstream/emscripten/emcc -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/tekinas/Documents/vcpkg/installed/wasm32-emscripten/include -O3 -DNDEBUG -fvisibility=hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/alloc_lib.c.o -MF libs/container/CMakeFiles/boost_container.dir/src/alloc_lib.c.o.d -o libs/container/CMakeFiles/boost_container.dir/src/alloc_lib.c.o -c /home/tekinas/Documents/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/alloc_lib.c
ninja: build stopped: subcommand failed.
@JonLiu1993 JonLiu1993 added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label May 10, 2024
@rjindael
Copy link

rjindael commented May 15, 2024

Also having this issue. Full logs:

[4/9] /home/rj/dev/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/rj/dev/kiseki/aya/build/vcpkg_installed/wasm32-emscripten/include -g -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o -c /home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/synchronized_pool_resource.cpp
FAILED: libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o
/home/rj/dev/emsdk/upstream/emscripten/em++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -I/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include -isystem /home/rj/dev/kiseki/aya/build/vcpkg_installed/wasm32-emscripten/include -g -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o -MF libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o.d -o libs/container/CMakeFiles/boost_container.dir/src/synchronized_pool_resource.cpp.o -c /home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/synchronized_pool_resource.cpp
In file included from /home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/src/synchronized_pool_resource.cpp:14:
/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:109:12: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
  109 | extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(::_RTL_CRITICAL_SECTION *);
      |            ^
/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:109:39: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
  109 | extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(::_RTL_CRITICAL_SECTION *);
      |                                       ^
/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:111:12: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
  111 | extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(::_RTL_CRITICAL_SECTION *);
      |            ^
/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:111:39: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
  111 | extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(::_RTL_CRITICAL_SECTION *);
      |                                       ^
/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:112:12: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
  112 | extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(::_RTL_CRITICAL_SECTION *);
      |            ^
/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:112:39: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
  112 | extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(::_RTL_CRITICAL_SECTION *);
      |                                       ^
/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:113:12: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
  113 | extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(::_RTL_CRITICAL_SECTION *);
      |            ^
/home/rj/dev/vcpkg/buildtrees/boost-container/src/ost-1.85.0-b589bd4c0b.clean/libs/container/include/boost/container/detail/thread_mutex.hpp:113:39: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
  113 | extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(::_RTL_CRITICAL_SECTION *);
      |                                       ^
4 warnings and 4 errors generated.

Adding -fdeclspec/-fms-extensions to my CMAKE_CXX_COMPILER_FLAGS, either in my configure settings or through my CMakeLists (using add_compile_options) doesn't seem to work either.

@Kojoley
Copy link

Kojoley commented May 16, 2024

It seems like either you or Boost.Container (or both) forgot to link to Threads::Threads.

@rjindael
Copy link

rjindael commented May 16, 2024

It seems like either you or Boost.Container (or both) forgot to link to Threads::Threads.

I am not sure how this would be the source of the problem. In my case, I am installing "boost" entirely in my vcpkg JSON manifest, and in my app's CMakeLists I run find_package(Boost COMPONENTS filesystem system iostreams thread exception program_options REQUIRED). I am convinced it is a problem with Boost itself -- however, if that is the case, then it is more likely because of the __declspec keyword not being recognized by the compiler since it is not being run with the -fms-extensions flag.

@Kojoley
Copy link

Kojoley commented May 16, 2024

It seems like either you or Boost.Container (or both) forgot to link to Threads::Threads.

I am not sure how this would be the source of the problem. In my case, I am installing "boost" entirely in my vcpkg JSON manifest, and in my app's CMakeLists I run find_package(Boost COMPONENTS filesystem system iostreams thread exception program_options REQUIRED). I am convinced it is a problem with Boost itself -- however, if that is the case, then it is more likely because of the __declspec keyword not being recognized by the compiler since it is not being run with the -fms-extensions flag.

Because Boost.Container code is structured the way that windows platform specific code is a 'fallback' - when pthreads wasn't enabled (emscripten is not windows, it doesn't have winapi) you are getting these errors. Emscripten shouldn't get in that code path in the first place.

@rezzeted
Copy link

I have the same problem

@dg0yt
Copy link
Contributor

dg0yt commented May 18, 2024

Duplicates #38469.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team.
Projects
None yet
Development

No branches or pull requests

6 participants