diff options
author | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2020-01-05 19:48:46 -0800 |
---|---|---|
committer | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2020-09-30 15:34:14 -0700 |
commit | 869ded3b0e9b1f53b7161827bc2275a584881fc7 (patch) | |
tree | bddc9f9e57795bdfd8d0dc8b1bdef47a2bc1a3d6 /common.gypi | |
parent | ff4cf817a3159ddf7c4bf898819f88445c5fee53 (diff) | |
download | ios-node-v8-869ded3b0e9b1f53b7161827bc2275a584881fc7.tar.gz ios-node-v8-869ded3b0e9b1f53b7161827bc2275a584881fc7.tar.bz2 ios-node-v8-869ded3b0e9b1f53b7161827bc2275a584881fc7.zip |
build: add support for section ordering
Adds support for using a section ordering file with the gold linker.
This makes it possible to reorder functions in a build to optimize for
a specific workload.
`hfsort` is a tool that can be used to generate such a file from perf-
recorded last branch record (LBR) data by running Node.js as
`node --perf-basic-prof`.
Refs: https://github.com/facebook/hhvm/tree/9966d482c19c6120c621c6f3896525fb19fb3842/hphp/tools/hfsort
Refs: https://software.intel.com/content/www/us/en/develop/articles/runtime-optimization-blueprint-IA-optimization-with-last-branch-record.html
Refs: https://github.com/nodejs/node/pull/16891/
Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: https://github.com/nodejs/node/pull/35272
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'common.gypi')
-rw-r--r-- | common.gypi | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common.gypi b/common.gypi index 46b4633f5d..33b1325eb5 100644 --- a/common.gypi +++ b/common.gypi @@ -111,6 +111,9 @@ ['target_arch in "ppc64 s390x"', { 'v8_enable_backtrace': 1, }], + ['OS=="linux"', { + 'node_section_ordering_info%': '' + }] ], }, @@ -172,6 +175,20 @@ }, 'cflags': [ '-O3' ], 'conditions': [ + ['OS=="linux"', { + 'conditions': [ + ['node_section_ordering_info!=""', { + 'cflags': [ + '-fuse-ld=gold', + '-ffunction-sections', + ], + 'ldflags': [ + '-fuse-ld=gold', + '-Wl,--section-ordering-file=<(node_section_ordering_info)', + ], + }], + ], + }], ['OS=="solaris"', { # pull in V8's postmortem metadata 'ldflags': [ '-Wl,-z,allextract' ] |