Skip to content

Could not build stacktrace_from_exception with MinGWΒ #196

Open
@uilianries

Description

Summary

Greetings!

I am reporting a bug encountered when attempting to build stacktrace with MinGW while the boost.stacktrace.from_exception feature is enabled. This issue does not occur with MSVC on Windows. The error was identified while trying to incorporate this feature into the Conan recipe for Boost in ConanCenterIndex

Error Details:

During the build, the follow error occurs:

gcc.compile.c++ C:\Users\uilia\.conan2\p\b\boosta27812415810e\b\build-release\boost\bin.v2\libs\stacktrace\build\gcc-13\rls\x86_6\cxstd-14-gnu\lnk-sttc\nm-on\thrdp-wn32\thrd-mlt\vsblt-hdn\from_exception.o

    "C:/Users/uilia/.conan2/p/mingwf3629a0c4f698/p/bin/g++.exe"   -std=gnu++14 -fvisibility-inlines-hidden -m64 -O3 -finline-functions -Wno-inline -Wall -fvisibility=hidden -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_USE_NUMA -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1   -I"."  -c -o "C:\Users\uilia\.conan2\p\b\boosta27812415810e\b\build-release\boost\bin.v2\libs\stacktrace\build\gcc-13\rls\x86_6\cxstd-14-gnu\lnk-sttc\nm-on\thrdp-wn32\thrd-mlt\vsblt-hdn\from_exception.o" "libs/stacktrace/build/../src/from_exception.cpp"

libs/stacktrace/build/../src/from_exception.cpp:160:10: fatal error: dlfcn.h: No such file or directory
  160 | #include <dlfcn.h>
      |          ^~~~~~~~~
compilation terminated.

I see in the file location_from_symbol.hpp there is a conditional to avoid the very same error:

https://github.com/boostorg/stacktrace/blob/boost-1.87.0.beta1/include/boost/stacktrace/detail/location_from_symbol.hpp#L15

The same is not present for from_exception.cpp, only an initial ifdef for _MSC_VER, a define that's for MSVC.

Environment

OS: Windows 10 Pro 22H2
Arch: amd64 (x86_64)
Build type: Release
Compiler: GCC 13

The MinGW version used by me can be found on Github: https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-mcf-seh-ucrt-rt_v11-rev1.7z

Attachments:

For further details, please refer to my full build log: boost-1.86.0-mingw.log

Thank you for your attention to this matter. I look forward to any guidance or solutions you might provide.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions