PGO and LTO in clang-cl

This commit is contained in:
wuggy 2026-09-12 04:29:47 -07:00
commit 70b4a79405
12 changed files with 290 additions and 15 deletions

1
js/src/aclocal.m4 vendored
View file

@ -16,6 +16,7 @@ builtin(include, ../../build/autoconf/altoptions.m4)dnl
builtin(include, ../../build/autoconf/mozprog.m4)dnl
builtin(include, ../../build/autoconf/mozheader.m4)dnl
builtin(include, ../../build/autoconf/lto.m4)dnl
builtin(include, ../../build/autoconf/clang-cl-pgo.m4)dnl
builtin(include, ../../build/autoconf/frameptr.m4)dnl
builtin(include, ../../build/autoconf/compiler-opts.m4)dnl
builtin(include, ../../build/autoconf/expandlibs.m4)dnl

View file

@ -711,7 +711,17 @@ case "$target" in
if test "$AS_BIN"; then
AS="$(basename "$AS_BIN")"
fi
AR='lib'
if test -n "$CLANG_CL"; then
dnl Microsoft lib.exe cannot archive LLVM bitcode from ThinLTO.
AC_PATH_PROG(LLVM_LIB, llvm-lib.exe)
if test -z "$LLVM_LIB"; then
AC_MSG_ERROR([clang-cl requires llvm-lib.exe on PATH])
fi
dnl expandlibs invokes AR from native Windows Python.
AR="$(cd "$(dirname "$LLVM_LIB")" && pwd -W)/$(basename "$LLVM_LIB")"
else
AR='lib'
fi
AR_FLAGS='-NOLOGO -OUT:$@'
AR_EXTRACT=
RANLIB='echo not_ranlib'
@ -2005,6 +2015,9 @@ if test "$ac_cv_struct_tm_zone_tm_gmtoff" = "yes" ; then
fi
fi # ! SKIP_COMPILER_CHECKS
dnl Windows skips the GCC probes above, but still needs LLVM PGO setup.
MOZ_CLANG_CL_PGO
AC_DEFINE(CPP_THROW_NEW, [throw()])
AC_LANG_C