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

-mbig-obj is incompatible with -flto on mingw compiler and cause problems linking the library in a project #2726

Closed
VasiliPupkin256 opened this issue Jan 20, 2022 · 1 comment · Fixed by #2728

Comments

@VasiliPupkin256
Copy link
Contributor

I think this is a bug in mingw compiler, but this library adds the switch to its interface

fmt/CMakeLists.txt

Lines 251 to 256 in c5aafd8

if (MINGW)
check_cxx_compiler_flag("-Wa,-mbig-obj" FMT_HAS_MBIG_OBJ)
if (${FMT_HAS_MBIG_OBJ})
target_compile_options(fmt PUBLIC "-Wa,-mbig-obj")
endif()
endif ()
and this trigger errors "plugin needed to handle lto object"

My system is Ubuntu 20.04 and I am compiling with 86_64-w64-mingw32

May be the requirement can be relaxed for 64 bit projects? What was the reason to include the flag into the config?

@vitaut
Copy link
Contributor

vitaut commented Jan 20, 2022

IIRC it was added in response to reports similar to #1684. I think it should be OK to remove it as it is easy to add compiler flags via CMake or at least make it an opt in. A PR would be welcome.

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

Successfully merging a pull request may close this issue.

2 participants