mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Allow users to overwrite ld with environment variable in linker optimization script (#137331)
This should help in the case of cross compilation. xref: https://github.com/conda-forge/pytorch-cpu-feedstock/pull/261 Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/137331 Approved by: https://github.com/isuruf, https://github.com/seemethere
This commit is contained in:
parent
23793cf93d
commit
43afaa4aac
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
|
|
@ -9,8 +10,8 @@ def gen_linker_script(
|
|||
prioritized_text = [
|
||||
line.replace("\n", "") for line in prioritized_text if line != "\n"
|
||||
]
|
||||
|
||||
linker_script_lines = subprocess.check_output(["ld", "-verbose"], text=True).split(
|
||||
ld = os.environ.get("LD", "ld")
|
||||
linker_script_lines = subprocess.check_output([ld, "-verbose"], text=True).split(
|
||||
"\n"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user