Skip to content

Commit f8b60e4

Browse files
sam-githubMylesBorins
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 8b69504 commit f8b60e4

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
@@ -968,8 +968,11 @@ def configure_openssl(o):
968968
o['variables']['openssl_fips'] = options.openssl_fips
969969
fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips')
970970
fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld'))
971+
# LINK is for Makefiles, LD/LDXX is for ninja
971972
o['make_fips_settings'] = [
972973
['LINK', fips_ld + ' <(openssl_fips)/bin/fipsld'],
974+
['LD', fips_ld + ' <(openssl_fips)/bin/fipsld'],
975+
['LDXX', fips_ld + ' <(openssl_fips)/bin/fipsld'],
973976
]
974977
else:
975978
o['variables']['openssl_fips'] = ''

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

+5
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,10 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
18651865
ld = os.path.join(build_to_root, value)
18661866
if key == 'LD.host':
18671867
ld_host = os.path.join(build_to_root, value)
1868+
if key == 'LDXX':
1869+
ldxx = os.path.join(build_to_root, value)
1870+
if key == 'LDXX.host':
1871+
ldxx_host = os.path.join(build_to_root, value)
18681872
if key == 'NM':
18691873
nm = os.path.join(build_to_root, value)
18701874
if key == 'NM.host':
@@ -1954,6 +1958,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
19541958
CommandWithWrapper('CXX.host', wrappers, cxx_host))
19551959
if flavor == 'win':
19561960
master_ninja.variable('ld_host', ld_host)
1961+
master_ninja.variable('ldxx_host', ldxx_host)
19571962
else:
19581963
master_ninja.variable('ld_host', CommandWithWrapper(
19591964
'LINK', wrappers, ld_host))

0 commit comments

Comments
 (0)