Skip to content

Commit

Permalink
Workaround lack of dead code elimination
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Nov 26, 2024
1 parent 276a115 commit 2ec55d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build_common.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Config
$clang = $argv[1] ?? "clang";
$clang .= " -std=c++17 -fno-rtti -O3";
$clang .= " -std=c++17 -fno-rtti -O3 -ffunction-sections -fdata-sections";
if (defined("PHP_WINDOWS_VERSION_MAJOR"))
{
$clang .= " -D_CRT_SECURE_NO_WARNINGS";
Expand Down
1 change: 1 addition & 0 deletions soup/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ NAMESPACE_SOUP
#if SOUP_WINDOWS
"-D_CRT_SECURE_NO_WARNINGS",
#endif
"-ffunction-sections", "-fdata-sections", // needed for dead code elimination
"-std="
};
args.back().append(lang);
Expand Down

0 comments on commit 2ec55d9

Please sign in to comment.