Skip to content

Commit

Permalink
Merge pull request #100827 from OS-of-S/fixed-mold-search
Browse files Browse the repository at this point in the history
Fix Mold-search in older systems
  • Loading branch information
Repiteo committed Dec 30, 2024
2 parents 0efced3 + b9f0e0c commit 3994e56
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions platform/linuxbsd/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,16 @@ def configure(env: "SConsEnvironment"):
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."
)
sys.exit(255)
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, /usr/local or in PATH environment variable."
)
sys.exit(255)
else:
env.Append(LINKFLAGS=["-fuse-ld=mold"])
else:
Expand Down

0 comments on commit 3994e56

Please sign in to comment.