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
[IA] clang hangs with -no-integrated-as -Wa,-
#38758
Comments
We run: $ clang hello.c -pipe -Wa,- & [<0>] wait_woken+0x43/0x80 so I assume the assembler is waiting maybe for an EOF to be written. Let me see if I can find that in the source of GAS. |
Looks like EOF is meant for checking read values, but it itself is not writeable. It seems that closing a pipe is the better way to signal this? I'm getting the feeling we should pick up and then somehow in llvm/lib/Support/Program.cpp#sys::ExecuteAndWait not do the wait. Or find a way to close the fd once we've finished all output? |
It seems that clang will always write the assembly to a tempfile, then invoke the assembler on that temp file. So it seems that the only way for Clang to pipe the assembly into the assembler via stdout/stdin is if clang supported While Clang documents support for So maybe the right thing to do is to filter out |
Looks like Probably should still filter out |
Extended Description
From https://lkml.org/lkml/2018/10/23/136.
The linux kernel as of 4.20 for x86_64 uses the flag
-Wa,-
with-pipe
. This causes the use ofno-integrated-as
to hang the build. I think-pipe
is a red herring.ie.
$ clang hello_world.c -no-integrated-as -Wa,-
can reproduce the issue. strace'ing with and without -Wa,-, I see:
with -Wa,-:
...
access("/usr/bin/as", F_OK) = 0
...
wait4(167173,
w/o: -Wa,-:
access("/usr/bin/as", F_OK) = 0
...
wait4(167996, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 167996
...
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=167996, si_uid=366559, si_status=0, si_utime=0, si_stime=1} ---
so however clang is invoking the non-integrated-as, it's not receiving SIGCHLD in order to exit the
wait4
.Looking at
$ strace gcc hello_world.c -Wa,-
The text was updated successfully, but these errors were encountered: