Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable usage of asan-enabled versions of prebuilt libraries #93152

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions platform/windows/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,14 @@ def spawn_capture(sh, escape, cmd, args, env):
if env["arch"] == "x86_64":
env.AppendUnique(CPPDEFINES=["_WIN64"])

# Sanitizers
prebuilt_lib_extra_suffix = ""
if env["use_asan"]:
env.extra_suffix += ".san"
prebuilt_lib_extra_suffix = ".san"
env.Append(CCFLAGS=["/fsanitize=address"])
env.Append(LINKFLAGS=["/INFERASANLIBS"])

## Libs

LIBS = [
Expand Down Expand Up @@ -566,17 +574,17 @@ def spawn_capture(sh, escape, cmd, args, env):
LIBS += ["WinPixEventRuntime"]

env.Append(LIBPATH=[env["mesa_libs"] + "/bin"])
LIBS += ["libNIR.windows." + env["arch"]]
LIBS += ["libNIR.windows." + env["arch"] + prebuilt_lib_extra_suffix]

if env["opengl3"]:
env.AppendUnique(CPPDEFINES=["GLES3_ENABLED"])
if env["angle_libs"] != "":
env.AppendUnique(CPPDEFINES=["EGL_STATIC"])
env.Append(LIBPATH=[env["angle_libs"]])
LIBS += [
"libANGLE.windows." + env["arch"],
"libEGL.windows." + env["arch"],
"libGLES.windows." + env["arch"],
"libANGLE.windows." + env["arch"] + prebuilt_lib_extra_suffix,
"libEGL.windows." + env["arch"] + prebuilt_lib_extra_suffix,
"libGLES.windows." + env["arch"] + prebuilt_lib_extra_suffix,
]
LIBS += ["dxgi", "d3d9", "d3d11"]
env.Prepend(CPPPATH=["#thirdparty/angle/include"])
Expand Down Expand Up @@ -612,12 +620,6 @@ def spawn_capture(sh, escape, cmd, args, env):
env.Prepend(CPPPATH=[p for p in str(os.getenv("INCLUDE")).split(";")])
env.Append(LIBPATH=[p for p in str(os.getenv("LIB")).split(";")])

# Sanitizers
if env["use_asan"]:
env.extra_suffix += ".san"
env.Append(LINKFLAGS=["/INFERASANLIBS"])
env.Append(CCFLAGS=["/fsanitize=address"])

# Incremental linking fix
env["BUILDERS"]["ProgramOriginal"] = env["BUILDERS"]["Program"]
env["BUILDERS"]["Program"] = methods.precious_program
Expand Down
Loading