Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Sep 29, 2020
1 parent 0e5a828 commit dff2255
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
23 changes: 15 additions & 8 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
['target_arch in "ppc64 s390x"', {
'v8_enable_backtrace': 1,
}],
['OS=="linux"', {
'node_section_ordering_info%': ''
}]
],
},

Expand Down Expand Up @@ -172,15 +175,19 @@
},
'cflags': [ '-O3' ],
'conditions': [
['node_section_ordering_file!="-"', {
'cflags': [
'-fuse-ld=gold',
'-ffunction-sections',
['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)',
],
}],
],
'ldflags': [
'-fuse-ld=gold',
'-Wl,--section-ordering-file=<(node_section_ordering_file)',
]
}],
['OS=="solaris"', {
# pull in V8's postmortem metadata
Expand Down
12 changes: 6 additions & 6 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@

parser.add_option('--use-section-ordering-file',
action='store',
dest='node_section_ordering_file',
dest='node_section_ordering_info',
default='',
help='Pass a section ordering file to the linker. This requires that ' +
'Node.js be linked using the gold linker. The gold linker must have ' +
Expand Down Expand Up @@ -1779,6 +1779,7 @@ def configure_section_file(o):
proc = subprocess.Popen(['ld.gold'] + ['-v'], stdin = subprocess.PIPE,
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
except OSError:
warn('''No acceptable ld.gold linker found!''')
return 0

match = re.match(r"^GNU gold.*([0-9]+)\.([0-9]+)$",
Expand All @@ -1791,12 +1792,11 @@ def configure_section_file(o):
error('''GNU gold version must be greater than 1.2 in order to use section
reordering''')

if options.node_section_ordering_file != "":
o['variables']['node_section_ordering_file'] = os.path.realpath(
str(options.node_section_ordering_file))
if options.node_section_ordering_info != "":
o['variables']['node_section_ordering_info'] = os.path.realpath(
str(options.node_section_ordering_info))
else:
# An empty string here will cause gyp to fail.
o['variables']['node_section_ordering_file'] = "-"
o['variables']['node_section_ordering_info'] = ""

def make_bin_override():
if sys.platform == 'win32':
Expand Down

0 comments on commit dff2255

Please sign in to comment.