-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: introduce ./configure --with-lto
#7408
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
'python%': 'python', | ||
|
||
'node_tag%': '', | ||
'node_use_lto%': '', | ||
'uv_library%': 'static_library', | ||
|
||
'openssl_fips%': '', | ||
|
@@ -290,6 +291,13 @@ | |
], | ||
'ldflags!': [ '-rdynamic' ], | ||
}], | ||
['node_use_lto=="true"', { | ||
'conditions': [ [ 'clang==1', { | ||
'cflags': [ '-flto' ], | ||
}, { | ||
'cflags': [ '-flto=16' ], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this a bit overkill? My most powerful machine only has 8 cores... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we pass our |
||
} ] ], | ||
}], | ||
], | ||
}], | ||
[ 'OS=="android"', { | ||
|
@@ -343,6 +351,13 @@ | |
'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x | ||
}, | ||
}], | ||
['node_use_lto=="true"', { | ||
'xcode_settings': { | ||
'OTHER_CFLAGS': [ | ||
'-flto', | ||
], | ||
}, | ||
}], | ||
], | ||
}], | ||
['OS=="freebsd" and node_use_dtrace=="true"', { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,6 +297,11 @@ parser.add_option('--with-lttng', | |
dest='with_lttng', | ||
help='build with Lttng (Only available to Linux)') | ||
|
||
parser.add_option('--with-lto', | ||
action='store_true', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tiny nit: It would be better we passed |
||
dest='use_lto', | ||
help='build with -flto flag (Link Time Optimization)') | ||
|
||
parser.add_option('--with-etw', | ||
action='store_true', | ||
dest='with_etw', | ||
|
@@ -777,6 +782,8 @@ def configure_node(o): | |
else: | ||
o['variables']['node_use_lttng'] = 'false' | ||
|
||
o['variables']['node_use_lto'] = b(options.use_lto) | ||
|
||
if options.no_ifaddrs: | ||
o['defines'] += ['SUNOS_NO_IFADDRS'] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put the condition on a separate line?