From 8282af2868c14369964f6baa220bcf7fe0d6a230 Mon Sep 17 00:00:00 2001 From: heather7283 Date: Tue, 19 Nov 2024 20:06:32 +0400 Subject: [PATCH] pgo: explicitly set LLVM_PROFILE_FILE envvar When building foot with pgo under gentoo's portage, LLVM tried to generate profile data files directly under system root, triggering sandbox violation and causing build to fail. Setting this envvar fixes the issue by explicitly specifying profiling data location. Reference: https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation --- pgo/pgo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pgo/pgo.sh b/pgo/pgo.sh index b59f5c21..24891438 100755 --- a/pgo/pgo.sh +++ b/pgo/pgo.sh @@ -103,6 +103,7 @@ if [ ${do_pgo} = yes ]; then ninja -C "${blddir}" test # Run mode-dependent script to generate profiling data + export LLVM_PROFILE_FILE="${blddir}/default_%m.profraw" "${srcdir}"/pgo/${mode}.sh "${srcdir}" "${blddir}" if [ ${compiler} = clang ]; then