[REACTOS] Add support for compiling with GCC 13#6824
[REACTOS] Add support for compiling with GCC 13#6824tkreuzer merged 3 commits intoreactos:masterfrom
Conversation
561b950 to
1e0829c
Compare
| set_target_properties(libgcc PROPERTIES IMPORTED_LOCATION ${LIBGCC_LOCATION}) | ||
| # libgcc needs kernel32 imports, a CRT and msvcrtex | ||
| target_link_libraries(libgcc INTERFACE libkernel32 libmsvcrt msvcrtex) | ||
| target_link_libraries(libgcc INTERFACE libwinpthread libkernel32 libmsvcrt msvcrtex) |
There was a problem hiding this comment.
geez GCC... why the hell do they need winpthread?
There was a problem hiding this comment.
For threading support in their runtime library I guess. The better alternative on Windows would be MCF Gthread, but that requires Windows 7.
There was a problem hiding this comment.
I do hope all this gcc nastiness is static, and our binaries do not actually depend on some shit like winpthread.dll or so?
There was a problem hiding this comment.
That's what I was wondering too.
There was a problem hiding this comment.
Luckily, libwinpthread and libgcc_dw2 / libgcc_seh2 can be statically linked to the produced executable (it's actually a compiler option of the configure step of gcc buildscript that ends up generating libwinpthread.dll.a or libwinpthread.a).
HBelusca
left a comment
There was a problem hiding this comment.
OK but Timo please fix that Copyright 202024 date in the three new files.
sdk/cmake/gcc.cmake
Outdated
| add_compile_options(-fno-builtin-sin) | ||
| add_compile_options(-fno-builtin-cos) | ||
| add_compile_options(-fno-builtin-sincos) | ||
| add_compile_options(-fno-builtin-pow) | ||
| add_compile_options(-fno-builtin-sqrt) | ||
| add_compile_options(-fno-builtin-sqrtf) | ||
| add_compile_options(-fno-builtin-floor) | ||
| add_compile_options(-fno-builtin-floorf) | ||
| add_compile_options(-fno-builtin-ceilf) | ||
| add_compile_options(-fno-builtin-ceil) |
There was a problem hiding this comment.
Sort them. Want to merge them into "1" line?
cbialorucki
left a comment
There was a problem hiding this comment.
Just fix the copyright dates
|
If I understand correctly, this new library is required for any code compiled with GCC to run. winpthread dependency aside, does this not mean that everything now depends on kernel32.dll and msvcrt.dll, including kernel components and DLLs lower than kernel32 and msvcrt? Won’t this cause problems? |
| set_target_properties(libsupc++ PROPERTIES IMPORTED_LOCATION ${LIBSUPCXX_LOCATION}) | ||
| # libsupc++ requires libgcc | ||
| target_link_libraries(libsupc++ INTERFACE libgcc) | ||
| target_link_libraries(libsupc++ INTERFACE libgcc stdc++compat) |
There was a problem hiding this comment.
Update comment too?
| # libgcc needs kernel32 imports, a CRT and msvcrtex | ||
| target_link_libraries(libgcc INTERFACE libkernel32 libmsvcrt msvcrtex) | ||
| target_link_libraries(libgcc INTERFACE libwinpthread libkernel32 libmsvcrt msvcrtex) |
There was a problem hiding this comment.
Update comment too?
|
I wonder whether it is possible to add a temporary github action that makes use of GCC13, to see how things go. |
oleg-dubinskiy
left a comment
There was a problem hiding this comment.
Some nit-picks, LGTM otherwise.
sdk/cmake/gcc.cmake
Outdated
| execute_process(COMMAND ${GXX_EXECUTABLE} -print-file-name=libsupc++.a OUTPUT_VARIABLE LIBSUPCXX_LOCATION) | ||
| string(STRIP ${LIBSUPCXX_LOCATION} LIBSUPCXX_LOCATION) | ||
| set_target_properties(libsupc++ PROPERTIES IMPORTED_LOCATION ${LIBSUPCXX_LOCATION}) | ||
| # libsupc++ requires libgcc |
There was a problem hiding this comment.
And update this comment as follows:
# libsupc++ requires libgcc and stdc++compat
sdk/cmake/gcc.cmake
Outdated
| execute_process(COMMAND ${GXX_EXECUTABLE} -print-file-name=libgcc.a OUTPUT_VARIABLE LIBGCC_LOCATION) | ||
| string(STRIP ${LIBGCC_LOCATION} LIBGCC_LOCATION) | ||
| set_target_properties(libgcc PROPERTIES IMPORTED_LOCATION ${LIBGCC_LOCATION}) | ||
| # libgcc needs kernel32 imports, a CRT and msvcrtex |
There was a problem hiding this comment.
... and this one as follows:
# libgcc needs winpthread, kernel32, a CRT and msvcrtex imports
__throw_out_of_range_fmt is implemented in libstdc++, but it is needed by libsupc++ and that would mean we would have to link all C++ code to libstdc++.
1e0829c to
91cf63c
Compare
| add_compile_options(-fno-builtin-sqrt) | ||
| add_compile_options(-fno-builtin-sqrtf) | ||
| endif() | ||
| if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13) |
There was a problem hiding this comment.
Shouldn't the other changes (winpthread, gcc-compat, ...) too depend on GCC version? As in unneeded for RosBE's GCC 8.4.0.
Purpose
This PR makes it possible to compile ros with GCC 13. It will still create warnings, so for x86 it requires to remove
-WerrorProposed changes