<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 - Clang will write absolute paths into DW_AT_GNU_dwo_name even with -fdebug-prefix-map / -fdebug-compilation-dir ."
   href="https://bugs.llvm.org/show_bug.cgi?id=43502">43502</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang will write absolute paths into DW_AT_GNU_dwo_name even with -fdebug-prefix-map / -fdebug-compilation-dir .
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>new bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22602" name="attach_22602" title="testcase script">attachment 22602</a> <a href="attachment.cgi?id=22602&action=edit" title="testcase script">[details]</a></span>
testcase script

Tested using Chrome's clang, which is trunk.

$clang   -fdiagnostics-color=never -gsplit-dwarf
-fdebug-prefix-map=$dir=\$ORIGIN -c  -o $dir/outputs/foo.o $dir/inputs/foo.c

$clang  $dir/outputs/foo.o  -fdiagnostics-color=never -gsplit-dwarf
-fdebug-prefix-map=$dir=\$ORIGIN  -lm   -o $dir/outputs/foo

$ readelf --debug-dump /tmp/outputs/foo
[...]
    <10>   DW_AT_comp_dir    : (indirect string, offset: 0x0): $ORIGIN
    <14>   DW_AT_GNU_pubnames: 1
    <14>   DW_AT_GNU_dwo_name: (indirect string, offset: 0x8):
/tmp/outputs/foo.dwo
[...]

See attached script that creates this testcase. Using clang from chrome trunk
as of Sep 24 (same result as clang-8)

The expected result is that DW_AT_GNU_dwo_name is $ORIGIN/outputs/foo.dwo.

Same result if I use '-fdebug-compilation-dir .</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>