Closed githubuser0xFFFF closed 1 month ago
And does it compile on mingw? I'm only using msys2.
Doesn't compile I'm getting compile errors, this is the first time I tried to compile with mingw-w64.
Yes, It compiles with MinGW and if I remove the line -fuse-ld=lld it also links properly. If I build the debug version I need to completely disable this part:
target_link_options(${target} INTERFACE
$<$<CONFIG:Debug,RelWithDebInfo>:
LINKER:--dynamicbase,--high-entropy-va,--nxcompat
LINKER:--default-image-base-high>
# Use faster linker ( GNU ld linker doesn't work with the Clang;
# for both GCC and Clang )
# TODO use LINKER_TYPE target property when min. version will be CMake v3.29 silverqx
# -fuse-ld=lld
)
to link the library.
I use the MinGW distribution that is installed with the Qt installer for Qt 5.15.2. So the only problem for me is the link step.
I tried now mingw 11.2 with Qt 6.7.1 and I have 2 more problems, it doesn't recognize --default-image-base-high
linker option and also doesn't recognize this pragma #pragma GCC diagnostic ignored "-Wdangling-reference"
.
Now I also tried MinGW 13.1 and it works with this pragma but still doesn't recognize --default-image-base-high
.
Yes, this happens if you build with debug info - to workaround this, I simply disable / remove the following part:
target_link_options(${target} INTERFACE
$<$<CONFIG:Debug,RelWithDebInfo>:
LINKER:--dynamicbase,--high-entropy-va,--nxcompat
LINKER:--default-image-base-high>
# Use faster linker ( GNU ld linker doesn't work with the Clang;
# for both GCC and Clang )
# TODO use LINKER_TYPE target property when min. version will be CMake v3.29 silverqx
# -fuse-ld=lld
)
mingw64 13.1 has outdated ld.exe v2.40, the --default-image-base-high
is already fixed in ld 2.42.
I have found ~7 problems:
--default-image-base-high
#pragma GCC diagnostic ignored "-Wdangling-reference"
-fuse-ld=lld
tom.exe
), but now I have also tried with MinGW 11.2 and the same problem with unit tests like: The procedure entry point basic_string::char_traits::replace 😮 could not be located in dyn. link library TinyOrm0d.dll, so there will be more problems with this, it can be caused by these security flags or ASLR.FindMySQL.cmake
package module can't find MySQL client library on MinGWI really recommend installing MSYS2 ucrt64, mingw-w64 is only outdated msys2 that is missing many fixes.
I look at this when I will have a more time but msys2 ucrt64 g++, clang++ builds are tested using CI pipelines with all possible cmake option combinations, static/shared/tinydrivers/g++/clang++ builds, ... here and here. I don't plan to do this for mingw-w64 at sure.
But it compiles with 0 warnings and errors, which is impressive for an unsupported or untested platform 😁 Problem is that it takes 30min to compile, msvc or clang got it in 3mins (I'm talking about unit tests, compiling core dll and tom.exe is pretty fast).
Ok, thank you for the quick response. I just had quick look into the documentation and the supported compilers. I missed the part that MinGW is an unsupported platform - sorry.
Nothing to sorry, still lot of bugs in my code 😂, I leave it open so it can be fixed, sometimes, I should at least fix eg. -fuse-ld=lld
because it's not a good idea to override these defaults, but problem is that all msys2 CI pipelines depends on this -fuse-ld=lld
, so I will have to somehow figure it out, cmake's LINKER_TYPE
or CMAKE_LINKER_TYPE
is perfect for these but I can't use it right now because min. cmake version must be v3.29.
I have removed that hard-coded -fuse-ld=lld
for if(MINGW)
in c5b02a5, linker type can be changed using the CMAKE_LINKER_TYPE
compiler definition on the cmake command line. It will be in the next release v0.38.1.
When I build TinyORM with MinGW 11.2 i get the following linker error:
I can fix this error by removing or commenting line 160 in
TinyCommon.cmake
: -fuse-ld=lld. The lld linker is not included in a normal MinGW distribution.