https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0d187f7d561ba23054ffa…
commit 0d187f7d561ba23054ffaeef9b032695c2a9baec
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Thu Apr 9 04:02:06 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Thu Apr 9 04:02:06 2020 +0300
[CMAKE] Add --gc-sections flag to GCC linker.
This returns C++ binaries size to normal (on GCC 8.4).
I don't see any noticable effect of this on GCC 4.7.2
CORE-16670
---
sdk/cmake/gcc.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index d37d1c06553..c6bfb95d41a 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -252,7 +252,7 @@ set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
set(CMAKE_RC_CREATE_SHARED_MODULE ${CMAKE_RC_CREATE_SHARED_LIBRARY})
-set(CMAKE_EXE_LINKER_FLAGS "-nostdlib
-Wl,--enable-auto-image-base,--disable-auto-import,--disable-stdcall-fixup")
+set(CMAKE_EXE_LINKER_FLAGS "-nostdlib
-Wl,--enable-auto-image-base,--disable-auto-import,--disable-stdcall-fixup,--gc-sections")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT}
-Wl,--disable-stdcall-fixup")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT}
-Wl,--disable-stdcall-fixup")