-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Win32/64: error: inlining failed in call with (and without) -march=native #466
Comments
Same machines without |
I don't have a test rig set-up for this configuration. I suspect MinGW is mis-detecting around CMakeLists.txt : 100, and then failing to enter this block around CMakeLists.txt : 370. What does |
Building against this revision produces the same results. |
Thanks @anonimal, So I tried to simplify things a bit at Commit 48ec6946d729. If that fails, would you be able to add a few
|
Cleared at PR 469. (We can re-open if required). |
Apparently, it's not entering the 2nd block (see logs below). Unresolved inline errors: |
According to the logs, its not entering the first block either. Or at least the Win64 machine is not. Can you work this out and submit a PR? I bet If you don't have the time to investigate, then try this:
I found a Stack Overflow question similar to this problems at CMAKE_COMPILER_IS_GNUCXX and CMAKE_CXX_COMPILER_ID are empty, but it felt like it did not apply. |
Damnit, sorry, I uploaded the wrong log. That log is pre-patch. Will re-up.
Will do. |
The log I wanted to upload in #466 (comment) + patch in #466 (comment): |
No, #466 (comment) was simply an addendum to #466 (comment). Both issues remain for i686 and x86_64. |
@noloader I'll see if I can get you access to our win machines (if at least temporarily). It will be quicker than me looking at this issue closer. Worst case scenario being I'll set time aside to dive into a fix. |
Yeah, that would be fine. Here's my Something else that may work... Build out a Virtual Box image with MinGW installed and configured to your taste. I'm currently running Virtual Box version 5.1.26 r117224 (Qt5.6.2). Its the latest. |
JFTR: |
Well, that does not make much sense. Does MinGW have
If it looks right, then maybe |
Yes, and running the above produces expected results (I've gotten used to being disappointed by CMake by now 😒).
I've removed |
I opened a question on Stack Overflow at Variable is empty after executing command on MinGW and MinGW-64?. Would you happen to know what versions of CMake are being used on MinGW and MinGW-64? Can you ask your customer for it? |
A fellow named VRE on Stack Overflow offered an answer at Variable is empty after executing command on MinGW and MinGW-64? I committed VRE's answer on my testing branch at Commit 750553570eaa. Can you give it a try? |
I committed the fix to Wei's repo at Commit 77e9d8c2dbd9. It tested OK under Cygwin, Linux, OS X, Solaris and Windows. At worse, it won't do any harm. I'm going to close this out. Ping me if its still a problem. We can reopen the report again :) |
We don't know if this is going to fix the issue because we don't have a MinGW platofrm for testing. However, from VRE's answer on Stack Overflow (and the chronic CMake problems with execute_process), we believe this may be the fix. The fix tested OK on WIndows, Linux, OS X and Cygwin. At worse, it won't do any harm
Rollup CMake fixes for OpenBSD (Issues 467-468) Rollup CMake fixes for MinGW (Issues 466) Add CRYPTOPP_ENABLE_ARCH (Issue 380)
The problem persists 😡 |
To resolve any syntactical doubt: diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5c10bf..28d1527 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,11 +113,19 @@ execute_process(COMMAND ${SHELL_CMD} ${SHELL_ARGS} "${CMAKE_CXX_COMPILER} -dumpm
OUTPUT_VARIABLE CRYPTOPP_AMD64
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS CRYPTOPP_AMD64)^M
+ message(STATUS ${CRYPTOPP_AMD64})^M
+ message(STATUS "${CRYPTOPP_AMD64}")^M
+^M
execute_process(COMMAND ${SHELL_CMD} ${SHELL_ARGS} "${CMAKE_CXX_COMPILER} -dumpmachine 2>&1"
COMMAND ${GREP_CMD} ${GREP_ARGS} "x86_64"
OUTPUT_VARIABLE CRYPTOPP_X86_64
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS CRYPTOPP_X86_64)^M
+ message(STATUS ${CRYPTOPP_X86_64})^M
+ message(STATUS "${CRYPTOPP_X86_64}")^M
+^M
execute_process(COMMAND ${SHELL_CMD} ${SHELL_ARGS} "${CMAKE_CXX_COMPILER} -dumpmachine 2>&1"
COMMAND ${GREP_CMD} ${GREP_ARGS} "i.86"
OUTPUT_VARIABLE CRYPTOPP_I386
@@ -135,6 +143,10 @@ execute_process(COMMAND ${SHELL_CMD} ${SHELL_ARGS} "${CMAKE_CXX_COMPILER} -dumpm
OUTPUT_VARIABLE CRYPTOPP_MINGW64
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS CRYPTOPP_MINGW64)^M
+ message(STATUS ${CRYPTOPP_MINGW64})^M
+ message(STATUS "${CRYPTOPP_MINGW64}")^M
+^M
execute_process(COMMAND ${SHELL_CMD} ${SHELL_ARGS} "${CMAKE_CXX_COMPILER} -dumpmachine 2>&1"
COMMAND ${GREP_CMD} ${GREP_ARGS} "x32"
OUTPUT_VARIABLE CRYPTOPP_X32
@@ -405,8 +417,12 @@ endif()
# New as of Pull Request 461, http://github.com/weidai11/cryptopp/pull/461.
if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
+ message("first block")^M
+^M
if (("${CRYPTOPP_AMD64}" STREQUAL "1") OR ("${CRYPTOPP_I386}" STREQUAL "1") OR ("${CRYPTOPP_X32}" STREQUAL "1"))
+ message("second block")^M
+^M
CHECK_CXX_COMPILER_FLAG("-mssse3" CRYPTOPP_IA32_SSSE3)
CHECK_CXX_COMPILER_FLAG("-msse4.2" CRYPTOPP_IA32_SSE4)
CHECK_CXX_COMPILER_FLAG("-mssse3 -mpclmul" CRYPTOPP_IA32_CLMUL) On a sane Linux system with CMake 3.9.1:
On MinGW-w64 with CMake 3.9.1:
I think we can resolve this as a CMake issue? |
Could we reopen this issue until the problem is resolved upstream or until we refactor a way around this CMake issue? |
Yes, absolutely. I thought we had it licked with the Stack Overflow answer. Sorry about the [second] premature close.
Yeah, maybe. But we need to fix it since we supply the One thing you might try is, quote every argument. The documentation on execute_process does not state its needed, but Windows' I asked the CMake folks to update their documentation on their mailing list at Please update the documentation for execute_process. I'll put a bounty on the question when Stack Overflow allows it. I want to get this CMake shit off the radar. |
Lol... My blood pressure boils when I think about it. I can feel the veins in my neck throbbing when I think of the problems its causing our users. The program is responsible for 17.5% of our bugs (27 of 154). That's more effort than we expend on things like compatibility back to GCC 3 and Visual Studio 2002. 17.5% is why we removed it from our release tar/zip. It introduces too many unknowns into our equations. |
How about unrolling everything for CMake under MinGW? Maybe something like:
Also, what if the tabs are causing it problems under MinGW? Should we try spaces? What if the shell is wrong? Should we use MinGW's equivalent to Also, check this out under Cygwin (not MinGW):
Maybe we need to quote the whole string argument given to Another open question is, can we drop the |
Thanks for your patience @noloader. |
I know that feeling! Especially with their "resolution" to https://gitlab.kitware.com/cmake/cmake/issues/16547 |
Thanks for fixing the issue on MinGW and the PR. I folded the machine tests and got rid of the if statements:
I also did away with The changes tested OK in my test lab, including Solaris, OS X, ARM and Aarch64. |
Last call for CMake patches before removing it from the library and adding it to the patch page. If you have something to add, then now is the time to do it. Also see Remove CMake from GitHub; add it to Patch Page on wiki? and Commit 1c740b0a097aecaa. |
When building b3cacd8 with
-march=native
on Win32/64:The text was updated successfully, but these errors were encountered: