Skip to content
Snippets Groups Projects
Commit 3976af8e authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1718171 - Add the clang runtime directory to LIB during configure....

Bug 1718171 - Add the clang runtime directory to LIB during configure. r=firefox-build-system-reviewers,andi

We currently do so from mozconfigs, but that means this doesn't happen
for local builds.

Differential Revision: https://phabricator.services.mozilla.com/D174064
parent 4f80c0eb
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,6 @@ export MOZ_PACKAGE_JSSHELL=1
if [ -d "$MOZ_FETCHES_DIR/clang" ]; then
CLANG_LIB_DIR="$(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && cd lib/windows && pwd)"
export LIB=$LIB:$CLANG_LIB_DIR
export LDFLAGS="clang_rt.profile-x86_64.lib"
fi
......
......@@ -339,9 +339,10 @@ def lib_path_for(host_or_target):
vc_path,
valid_windows_sdk_dir,
valid_ucrt_sdk_dir,
c_compiler,
)
@imports("os")
def lib_path(target, is_host, vc_path, windows_sdk_dir, ucrt_sdk_dir):
def lib_path(target, is_host, vc_path, windows_sdk_dir, ucrt_sdk_dir, compiler):
if not vc_path:
return
sdk_target = {
......@@ -371,6 +372,15 @@ def lib_path_for(host_or_target):
os.path.join(ucrt_sdk_dir.lib, "ucrt", sdk_target),
)
)
if compiler.type == "clang-cl":
runtime_dir = check_cmd_output(
compiler.compiler,
"/clang:--print-runtime-dir",
*compiler.flags,
onerror=lambda: None
).strip()
if runtime_dir and os.path.exists(runtime_dir):
libs.append(runtime_dir)
return libs
return lib_path
......
if test -d "$MOZ_FETCHES_DIR/clang/bin"; then
CLANG_DIR=`cd "$MOZ_FETCHES_DIR/clang/bin" ; pwd`
export PATH="${CLANG_DIR}:${PATH}"
if $(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && test -d lib/windows); then
export LIB="$(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && cd lib/windows && pwd)"
fi
fi
export CC=clang-cl
......
......@@ -3,7 +3,6 @@
if [ -d "$MOZ_FETCHES_DIR/clang" ]; then
CLANG_LIB_DIR="$(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && cd lib/windows && pwd)"
export LIB=$CLANG_LIB_DIR
export LDFLAGS="clang_rt.asan_dynamic-x86_64.lib clang_rt.asan_dynamic_runtime_thunk-x86_64.lib"
export MOZ_COPY_PDBS=1
......
......@@ -100,7 +100,6 @@ Run ``mach bootstrap`` to get an updated clang-cl in your
export LDFLAGS="clang_rt.asan_dynamic-x86_64.lib clang_rt.asan_dynamic_runtime_thunk-x86_64.lib"
CLANG_LIB_DIR="$(cd ~/.mozbuild/clang/lib/clang/*/lib/windows && pwd)"
export MOZ_CLANG_RT_ASAN_LIB_PATH="${CLANG_LIB_DIR}/clang_rt.asan_dynamic-x86_64.dll"
export LIB=$LIB:$CLANG_LIB_DIR
If you launch an ASan build under WinDbg, you may see spurious
first-chance Access Violation exceptions. These come from ASan creating
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment