<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57306>57306</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm-ar: Extracting object-files from static library does not re-create directory structure
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Bagira80
      </td>
    </tr>
</table>

<pre>
    Especially on Windows it seems to be quite common to encounter static libraries that not only contain a flat list of object-files, but also subdirectories within which object-files are located.  
The `-P` option allows to address these object-files when packaging/extracting.

However, when extracting object-files from a static library even with option `-P`, the object-files will be created as a flattened hierarchy in the same directory. This can be problematic if the static library contains similar-named object-files that only differ in their (relative) paths.

**This behavior differs from GNU `ar` which extracts all object-files into the original directory structure (as long as these directories exist before extracting) when using the `-P` option.**
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9U0uPmzAQ_jVwGQURCHkcOOx2d9tT1UOrnv0YwrTGTm2TbP59x5Boy7aqRIiMZz5_j7F0-to-hxMqEsZcwVn4Tla7SwCKEBCHANGBRPg1UkRQbhi4hj-hVW60ET2EKCIpMCS98ITc0IsI1kVGY0jlbBRkQUBn-LuhwBsdOPkDVVx1ZDBk1QeQYwRhgoMwSk2e99wEdqHYc_elJ9UvmkB4BOOUiKgLgKx8ysqHrz1Cti1XX_gF7hSJybKwpIc5C609hkQQAy7BLj1aOAn1UxzJHrPqBV-jFyryopih5_cnd8Ez-sR4ankrW-J13g0seeHNFbjVToru3O5cEx6zeseJjEnWK49JJIhwMzGi5WVPyKCqvwL7k5qDGBDu3l0L-NpTACVswjh5Jw0OExvq5vIlt1tOAQINZIRfWYbTS0ZTslOqmrqOs59PJg9ZtffI1OiMWXVgJ2MfFsZlVXomShJ7cSbnbyA3sz5-_pbsED5FN8d9MzekCJdEyHKck2GeODBh3nSzLj-qOPJ0MCn2zDgOR9xT_3O28DUNo8TOcfFbkknAFO4YUq7x75kqZjU5tuvtdl3xr97luq31oT6IPFI02BpzHlaspn6A5_8NybsYtOONdHk8rubg_yUtH71p-xhPgfF5Wvk58liNsuAbyot0-O1vxdGnM3lJIYzptr00u7rc5n3blOtKyk23WZf7SjUb3Oi6rPfVVh8OB6zWuRESTWiz5jFrnnJqq7KquLRebzb7ZlfoskFZ7_ZN2QiltzLblDxjZIp0cOH8MfezD3I8Bt5Mlz-8bYoQ6GgR7_hijL3z7SPfQS_2ZT7xbSeyvwGA7Zwq">