summaryrefslogtreecommitdiff
path: root/common.gypi
diff options
context:
space:
mode:
authorOctavian Soldea <octavian.soldea@intel.com>2018-07-05 11:19:22 -0700
committerAnna Henningsen <anna@addaleax.net>2018-07-13 19:03:00 +0200
commit32cad739b12c3f1b24dff9a24e8321927e9b2eb2 (patch)
treef44f1e2ad97a4ae1e2f769ffcf4002b46ddb3756 /common.gypi
parent4d42083d1a2a5632589e79aa3b780a7d7c93a2e1 (diff)
downloadandroid-node-v8-32cad739b12c3f1b24dff9a24e8321927e9b2eb2.tar.gz
android-node-v8-32cad739b12c3f1b24dff9a24e8321927e9b2eb2.tar.bz2
android-node-v8-32cad739b12c3f1b24dff9a24e8321927e9b2eb2.zip
build: enabling lto at configure
This modification allows for compiling with link time optimization (lto) using the flag --enable-lto. Refs: https://github.com/nodejs/node/issues/7400 PR-URL: https://github.com/nodejs/node/pull/21677 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'common.gypi')
-rw-r--r--common.gypi11
1 files changed, 11 insertions, 0 deletions
diff --git a/common.gypi b/common.gypi
index 65eb7caf57..9d74b46a8d 100644
--- a/common.gypi
+++ b/common.gypi
@@ -176,6 +176,17 @@
['OS!="mac" and OS!="win"', {
'cflags': [ '-fno-omit-frame-pointer' ],
}],
+ ['OS=="linux"', {
+ 'variables': {
+ 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ',
+ },
+ 'conditions': [
+ ['enable_lto=="true"', {
+ 'cflags': ['<(lto)'],
+ 'ldflags': ['<(lto)'],
+ },],
+ ],
+ },],
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]