Skip to content

Commit 4587f21

Browse files
sam-githubaddaleax
authored andcommitted
gyp: implement LD/LDXX for ninja and FIPS
The ability to set the link rule is used for FIPS, and needs to set both the `ld =` and `ldxx =` variables in the ninja build file to link c++ (node) and c (openssl-cli, etc.) executables. URL: #14227 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 63aee3b commit 4587f21

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

configure

+3
Original file line numberDiff line numberDiff line change
@@ -985,8 +985,11 @@ def configure_openssl(o):
985985
o['variables']['openssl_fips'] = options.openssl_fips
986986
fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips')
987987
fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld'))
988+
# LINK is for Makefiles, LD/LDXX is for ninja
988989
o['make_fips_settings'] = [
989990
['LINK', fips_ld + ' <(openssl_fips)/bin/fipsld'],
991+
['LD', fips_ld + ' <(openssl_fips)/bin/fipsld'],
992+
['LDXX', fips_ld + ' <(openssl_fips)/bin/fipsld'],
990993
]
991994
else:
992995
o['variables']['openssl_fips'] = ''

tools/gyp/pylib/gyp/generator/ninja.py

+5
Original file line numberDiff line numberDiff line change
@@ -1931,6 +1931,10 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
19311931
ld = os.path.join(build_to_root, value)
19321932
if key == 'LD.host':
19331933
ld_host = os.path.join(build_to_root, value)
1934+
if key == 'LDXX':
1935+
ldxx = os.path.join(build_to_root, value)
1936+
if key == 'LDXX.host':
1937+
ldxx_host = os.path.join(build_to_root, value)
19341938
if key == 'NM':
19351939
nm = os.path.join(build_to_root, value)
19361940
if key == 'NM.host':
@@ -2024,6 +2028,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
20242028
CommandWithWrapper('CXX.host', wrappers, cxx_host))
20252029
if flavor == 'win':
20262030
master_ninja.variable('ld_host', ld_host)
2031+
master_ninja.variable('ldxx_host', ldxx_host)
20272032
else:
20282033
master_ninja.variable('ld_host', CommandWithWrapper(
20292034
'LINK', wrappers, ld_host))

0 commit comments

Comments
 (0)