Last active
August 10, 2023 12:15
-
-
Save TerrorJack/3fde44af9bca389d530ef8558d5bbecd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
export CC="ccache clang" | |
export CXX="ccache clang++" | |
export AR=llvm-ar | |
./configure --enable-lto --experimental-enable-pointer-compression --fully-static --ninja | |
ninja -C out/Release -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/common.gypi b/common.gypi | |
index 3e1902fb..59ba0568 100644 | |
--- a/common.gypi | |
+++ b/common.gypi | |
@@ -174,9 +174,9 @@ | |
'MSVC_runtimeType': 2 # MultiThreadedDLL (/MD) | |
}], | |
['llvm_version=="0.0"', { | |
- 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC | |
+ 'lto': ' -flto=auto -fuse-linker-plugin -fno-fat-lto-objects ', # GCC | |
}, { | |
- 'lto': ' -flto ', # Clang | |
+ 'lto': ' -flto=thin ', # Clang | |
}], | |
], | |
}, | |
@@ -184,7 +184,7 @@ | |
'conditions': [ | |
['enable_lto=="true"', { | |
'cflags': ['<(lto)'], | |
- 'ldflags': ['<(lto)'], | |
+ 'ldflags': ['<(lto)', '-fuse-ld=lld', '-Wl,--strip-all'], | |
'xcode_settings': { | |
'LLVM_LTO': 'YES', | |
}, | |
diff --git a/deps/cares/configure b/deps/cares/configure | |
index 2f182e0c..d9e89651 100755 | |
--- a/deps/cares/configure | |
+++ b/deps/cares/configure | |
@@ -18815,11 +18815,6 @@ _LT_EOF | |
_lt_libdeps_save_CFLAGS=$CFLAGS | |
-case "$CC $CFLAGS " in #( | |
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; | |
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; | |
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; | |
-esac | |
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | |
(eval $ac_compile) 2>&5 | |
@@ -37464,6 +37459,3 @@ done | |
## -------------------------------- ## | |
## End of distclean amending code ## | |
## -------------------------------- ## | |
- | |
- | |
- | |
diff --git a/deps/cares/m4/libtool.m4 b/deps/cares/m4/libtool.m4 | |
index e7b68334..13ec17a6 100644 | |
--- a/deps/cares/m4/libtool.m4 | |
+++ b/deps/cares/m4/libtool.m4 | |
@@ -7562,11 +7562,6 @@ _LT_EOF | |
]) | |
_lt_libdeps_save_CFLAGS=$CFLAGS | |
-case "$CC $CFLAGS " in #( | |
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; | |
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; | |
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; | |
-esac | |
dnl Parse the compiler output and extract the necessary | |
dnl objects, libraries and library flags. | |
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp | |
index f822c056..a6421a5e 100644 | |
--- a/tools/v8_gypfiles/v8.gyp | |
+++ b/tools/v8_gypfiles/v8.gyp | |
@@ -1722,9 +1722,6 @@ | |
'<(V8_ROOT)/src/heap/base/worklist.cc', | |
], | |
'conditions': [ | |
- ['enable_lto=="true"', { | |
- 'cflags_cc': [ '-fno-lto' ], | |
- }], | |
['clang or OS!="win"', { | |
'conditions': [ | |
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment