Skip to content
Permalink
Browse files

build: enable linux large pages LLVM lld linkage support

The custom linker script is compatible with GNU ld only.
As such, providin a new expliciting option to redirect to
a different one. lld seems unable to migrate this
large section w/o segfaulting so providing only the
base address anchor for now.

PR-URL: #28938
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information...
devnexen authored and targos committed Aug 2, 2019
1 parent 1e3e6da commit f42eb01d1d5158decaaa179a83dd97f021912cf2
Showing with 22 additions and 1 deletion.
  1. +6 −0 configure.py
  2. +13 −1 node.gypi
  3. +3 −0 src/large_pages/ld.implicit.script.lld
@@ -401,6 +401,11 @@
help='build with Large Pages support. This feature is supported only on Linux kernel' +
'>= 2.6.38 with Transparent Huge pages enabled and FreeBSD')

parser.add_option('--use-largepages-script-lld',
action='store_true',
dest='node_use_large_pages_script_lld',
help='link against the LLVM ld linker script. Implies -fuse-ld=lld in the linker flags')

intl_optgroup.add_option('--with-intl',
action='store',
dest='with_intl',
@@ -1048,6 +1053,7 @@ def configure_node(o):
raise Exception(
'Large pages need Linux kernel version >= 2.6.38')
o['variables']['node_use_large_pages'] = b(options.node_use_large_pages)
o['variables']['node_use_large_pages_script_lld'] = b(options.node_use_large_pages_script_lld)

if options.no_ifaddrs:
o['defines'] += ['SUNOS_NO_IFADDRS']
@@ -295,12 +295,24 @@
'ldflags': [ '-Wl,-z,relro',
'-Wl,-z,now' ]
}],
[ 'OS=="linux" and target_arch=="x64" and node_use_large_pages=="true"', {
[ 'OS=="linux" and '
'target_arch=="x64" and '
'node_use_large_pages=="true" and '
'node_use_large_pages_script_lld=="false"', {
'ldflags': [
'-Wl,-T',
'<!(realpath src/large_pages/ld.implicit.script)',
]
}],
[ 'OS=="linux" and '
'target_arch=="x64" and '
'node_use_large_pages=="true" and '
'node_use_large_pages_script_lld=="true"', {
'ldflags': [
'-Wl,-T',
'<!(realpath src/large_pages/ld.implicit.script.lld)',
]
}],
[ 'node_use_openssl=="true"', {
'defines': [ 'HAVE_OPENSSL=1' ],
'conditions': [
@@ -0,0 +1,3 @@
PROVIDE (__nodetext = .);
PROVIDE (_nodetext = .);
PROVIDE (nodetext = .);

0 comments on commit f42eb01

Please sign in to comment.
You can’t perform that action at this time.