New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: unexpected files left in tmpdir: [dsymutil-f087bc] #59026
Comments
It is reproducible.
It reproduces with the system C compiler if the compiler version is clang-14.0.3.
But if the system C compiler version is clang-14.0.0, it does not reproduce. |
I looked over the LLVM source code for dsymutil. Looks to me as though it only creates temp files when it is generating a "universal" binary (which I don't think would apply here). It also uses a template of the form "dsym.tmp%%%%%.dwarf", which doesn't look like what you are we're encountering here. Is there any chance we could narrow down the test a bit? Perhaps figure out which testpoint within the cmd/go tests is causing the bad behavior? |
Can you bisect the |
Do you know if the leftover temporary file is from a compiling action or a linking action? If it is for linking, the Go linker probably could invoke |
I found the temp files under these cases' temp directory:
|
It is from a linking action. Clang (or dsymutil) creates the temp file under $TMPDIR env variable, instead of the go linker's temporary directory. |
It's hard for me. The system C compiler of my mac is clang-14.0.0. And my friend's system C compiler is clang-14.0.3. I don't know how to install clang between these two versions. |
Would it be possible to reproduce with building a C program with clang 14.0.3? If so, we could conclude it is a bug in clang.
I'm curious what makes you conclude that it is from the linking? The Go linker could potentially change the environment variable when invoking clang. Not sure if this is preferable. |
I use the '-x' flag to get all build commands and execute one by one to see which command generate the temp file:
Now execute the command in |
$ cat test.c
#include <stdio.h>
int main() {
printf("hello\n");
}
$ mkdir tmp
$ TMPDIR=$PWD/tmp "/opt/homebrew/opt/llvm/bin/clang" test.c -o test.o -ggdb -c
$ ls tmp
$ TMPDIR=$PWD/tmp "/opt/homebrew/opt/llvm/bin/clang" test.o -o test -ggdb
$ ls tmp
$ TMPDIR=$PWD/tmp /opt/homebrew/opt/llvm/bin/dsymutil -f test -o test.k
$ ls tmp
dsymutil-5f58bc |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Install clang with
brew install llvm
.Then build go with
CC=/opt/homebrew/opt/llvm/bin/clang CXX=/opt/homebrew/opt/llvm/bin/clang++ ./all.bash
under src.What did you expect to see?
build pass
What did you see instead?
The text was updated successfully, but these errors were encountered: