Merge pull request #100827 from OS-of-S/fixed-mold-search

Fix Mold-search in older systems
This commit is contained in:
Thaddeus Crews
2024-12-30 08:58:49 -06:00

View File

@ -122,9 +122,15 @@ def configure(env: "SConsEnvironment"):
env.Append(LINKFLAGS=["-B" + path + "/mold"])
found_wrapper = True
break
if not found_wrapper:
for path in os.environ["PATH"].split(os.pathsep):
if os.path.isfile(path + "/ld.mold"):
env.Append(LINKFLAGS=["-B" + path])
found_wrapper = True
break
if not found_wrapper:
print_error(
"Couldn't locate mold installation path. Make sure it's installed in /usr or /usr/local."
"Couldn't locate mold installation path. Make sure it's installed in /usr, /usr/local or in PATH environment variable."
)
sys.exit(255)
else: