[llvm-bugs] [Bug 24811] New: Include search paths not honored for asm(".include foo.s");

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 14 06:48:47 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24811

            Bug ID: 24811
           Summary: Include search paths not honored for asm(".include
                    foo.s");
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: jyknight at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

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?)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150914/da5f5af6/attachment.html>


More information about the llvm-bugs mailing list