<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:dan.mcgregor@usask.ca" title="Dan McGregor <dan.mcgregor@usask.ca>"> <span class="fn">Dan McGregor</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - -fdebug-prefix-map is a no-op for .S files"
   href="https://bugs.llvm.org/show_bug.cgi?id=38050">bug 38050</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>FIXED
           </td>
           <td>---
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>dan.mcgregor@usask.ca
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - -fdebug-prefix-map is a no-op for .S files"
   href="https://bugs.llvm.org/show_bug.cgi?id=38050#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - -fdebug-prefix-map is a no-op for .S files"
   href="https://bugs.llvm.org/show_bug.cgi?id=38050">bug 38050</a>
              from <span class="vcard"><a class="email" href="mailto:dan.mcgregor@usask.ca" title="Dan McGregor <dan.mcgregor@usask.ca>"> <span class="fn">Dan McGregor</span></a>
</span></b>
        <pre>This *nearly* fixes the issue. It doesn't handle the case where the full path
to the assembly file is specified on the command line. This is after the code
was committed:


$ clang-7 -g -c -o hello.o $PWD/hello.c -fdebug-prefix-map=$PWD=/src_root
$ strings hello.o|grep $PWD

$ clang-7 -g -c -o crti.o $PWD/crti.S -fdebug-prefix-map=$PWD=/src_root
$ strings crti.o|grep $PWD
 /tmp/test/crti.S

The compilation directory is changed correctly and the DW_TAG_label values are
correct, but not DW_TAG_compile_unit:

$ llvm-dwarfdump crti.o
crti.o: file format ELF64-x86-64

.debug_info contents:
0x00000000: Compile Unit: length = 0x00000119 version = 0x0002 abbr_offset =
0x0000 addr_size = 0x08 (next unit at 0x0000011d)

0x0000000b: DW_TAG_compile_unit
              DW_AT_stmt_list   (0x00000000)
              DW_AT_low_pc      (0x0000000000000000)
              DW_AT_high_pc     (0x0000000000000004)
              DW_AT_name        ("/tmp/test/crti.S")
              DW_AT_comp_dir    ("/src_root")
              DW_AT_producer    ("clang version 7.0.0 (based on LLVM 7.0.0)")
              DW_AT_language    (DW_LANG_Mips_Assembler)

0x000000ea:   DW_TAG_label
                DW_AT_name      ("init")
                DW_AT_decl_file ("/src_root/crti.S")
                DW_AT_decl_line (16)
                DW_AT_low_pc    (0x0000000000000000)
                DW_AT_prototyped        (0x00)

0x00000101:     DW_TAG_unspecified_parameters

0x00000102:     NULL

0x00000103:   DW_TAG_label
                DW_AT_name      ("fini")
                DW_AT_decl_file ("/src_root/crti.S")
                DW_AT_decl_line (23)
                DW_AT_low_pc    (0x0000000000000000)
                DW_AT_prototyped        (0x00)

0x0000011a:     DW_TAG_unspecified_parameters

0x0000011b:     NULL

0x0000011c:   NULL</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>