From bd9e16f732a6eb01a033c19f0ccf5fda4d0671f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 9 Feb 2022 12:21:13 +0200 Subject: [PATCH] build-libcxx: Build with -ffunction-sections -fdata-sections This allows shrinking binaries somewhat, if linking the runtimes statically and using the -Wl,--gc-sections option. --- build-libcxx.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-libcxx.sh b/build-libcxx.sh index 27bd323..bd4170b 100755 --- a/build-libcxx.sh +++ b/build-libcxx.sh @@ -97,6 +97,8 @@ build_all() { -DCMAKE_C_COMPILER=$arch-w64-mingw32-clang \ -DCMAKE_CXX_COMPILER=$arch-w64-mingw32-clang++ \ -DCMAKE_CXX_COMPILER_TARGET=$arch-w64-windows-gnu \ + -DCMAKE_C_FLAGS="-ffunction-sections -fdata-sections" \ + -DCMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" \ -DCMAKE_CROSSCOMPILING=TRUE \ -DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_C_COMPILER_WORKS=TRUE \