<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [IA] clang hangs with `-no-integrated-as -Wa,-`"
   href="https://bugs.llvm.org/show_bug.cgi?id=39410">39410</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[IA] clang hangs with `-no-integrated-as -Wa,-`
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>libclang
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ndesaulniers@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>echristo@gmail.com, klimek@google.com, llozano@chromium.org, llvm-bugs@lists.llvm.org, natechancellor@gmail.com, srhines@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>From <a href="https://lkml.org/lkml/2018/10/23/136">https://lkml.org/lkml/2018/10/23/136</a>.

The linux kernel as of 4.20 for x86_64 uses the flag `-Wa,-` with `-pipe`. 
This causes the use of `no-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,-</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>