[Clang] libc calls still get generated when libc is not linked
When I use clang in freestanding environments where I purposefully don't want libc to be linked (-ffreestanding -nodefaultlibs -nostartfiles), clang will still generate libc calls to functions like "memset" and "memcpy" when there aren't any actual calls nor references to them in the user's code.
From my experience, this behavior is unconditional and can lead to link errors that aren't directly the user's fault.
This can get pretty annoying at times as well. It makes you try to work around the compiler just to get rid of it.
There's seemingly no flag to remove this behavior either.
@llvm/issue-subscribers-libc
Author: DaisyTheDev
https://github.com/llvm/llvm-project/issues/37803
https://clang.llvm.org/docs/UsersManual.html#freestanding-builds