[compiler-rt] Fixed __llvm_profile_write_buffer in presence of ValueProfileData. (PR #97350)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 17:24:34 PDT 2024


================
@@ -66,13 +66,7 @@ int main(int argc, const char *argv[]) {
 // CHECK-SYMBOLS-NOT: {{ }}_fdopen
 // CHECK-SYMBOLS-NOT: {{ }}_fopen
 // CHECK-SYMBOLS-NOT: {{ }}_fwrite
-// CHECK-SYMBOLS-NOT: {{ }}_getenv
----------------
minglotus-6 wrote:

My understanding of @david-xl 's [comment](https://github.com/llvm/llvm-project/pull/97350#pullrequestreview-2152662131) is that these lines check the absence of a certain set of functions to make sure `__llvm_profile_write_buffer` doesn't introduce dependencies to libc by default.

Put it another way,  the fact we need to remove these lines means the current patch would introduce dependency to libc (`getenv` is from libc according to https://man7.org/linux/man-pages/man3/getenv.3.html). I wonder if gating code paths with C macros and keeping them not defined by default is the way to go.

https://github.com/llvm/llvm-project/pull/97350


More information about the llvm-commits mailing list