<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Include search paths not honored for asm(".include foo.s");"
   href="https://llvm.org/bugs/show_bug.cgi?id=24811">24811</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Include search paths not honored for asm(".include foo.s");
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If you write a C file "foo.c" that says:
  asm(".include \"test-asm.s\"");

And have an asm file named "/whatever/test-asm.s".

And if you run:
 clang -I /whatever -c foo.c

Then, what should happen:
a) With integrated assembler, the search paths should be used by the integrated
assembler to find the file.

b) Without an integrated assembler, the -I path arguments should be passed to
the /usr/bin/as program, so it can handle the .include with the right paths.
(note: gcc does indeed do this)

What happens now:

It fails to find the test-asm.s file, because search paths aren't passed into
either assembler. It can the file (and does include it properly, even!), if the
path is specified as relative to your current working directory.

Of course, writing C code like this is INCREDIBLY EVIL and nobody should ever
do it. So I'm not planning to fix this. But, having discovered it, I thought
I'd at least record a bug.

(Of course if you use this feature, -M can't work, because that stops after
preprocessing, and this .include is not processed in the preprocessor. -MD
could be made to work, IF you're using the integrated assembler, but that might
be a bit of a confusing distinction?)</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>