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

    <tr>
        <th>Summary</th>
        <td>
            [libc] Minor error on install step after building on LLVM 18
        </td>
    </tr>

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

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

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

<pre>
    I've been seeing a minor error when building libc using Ninja during the install step pertaining `crti.o` and `crtn.o`. Particularly, both files are never compiled and thus cmake returns me an error when installing libc:

```sh
CMake Error at projects/libc/startup/linux/cmake_install.cmake:55 (file):
  file INSTALL cannot find
 "/home/lucas.reis/llvm-18/build/projects/libc/startup/linux/CMakeFiles/libc.startup.linux.crti.dir/./crti.cpp.o":
 No such file or directory.
Call Stack (most recent call first):
 projects/libc/startup/cmake_install.cmake:47 (include)
 projects/libc/cmake_install.cmake:77 (include)
 projects/cmake_install.cmake:47 (include)
  cmake_install.cmake:122 (include)


FAILED: CMakeFiles/install.util 
``` 

If I manually compile the object by calling ninja, the install works accordingly after:

```sh
lucas.reis:~/llvm-18/build$ ninja libc.startup.linux.crti
[1/1] Building CXX object projects/libc/startup/linux/CMakeFiles/libc.startup.linux.crti.dir/crti.cpp.o
lucas.reis:~/llvm-18/build$ ninja libc.startup.linux.crtn
[1/1] Building CXX object projects/libc/startup/linux/CMakeFiles/libc.startup.linux.crtn.dir/crtn.cpp.o
```

It is my understanding that those files are built with `EXCLUDE_FROM_ALL`: https://github.com/llvm/llvm-project/blob/1118c2e05e67a36ed8ca250524525cdb66a55256/libc/cmake/modules/LLVMLibCObjectRules.cmake#L383-L389

and thus not compiled excplicitly unless requested, but they are still required in the install step:
https://github.com/llvm/llvm-project/blob/1118c2e05e67a36ed8ca250524525cdb66a55256/libc/startup/linux/CMakeLists.txt#L116-L137

Being startup object files it makes sense to me that they should be dependencies for libc to build on linux.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vktv2zgQ_jX0ZVBBoizZPvjgxBEQQEkX7e4it4AixxEbivTykcSX_e0LUrLrdJPtFigKGIL5mOHMN988mHPyQSOuSXVBqu2MBd8bu1aBM2dRumLWGXFYXxO6eELoEDU4RKkfgMEgtbGA1hoLzz1q6IJUIp4p2XEILv69lfoLAxFsXPgeQWrnmVLgPO5hj9YzqeMZqXNuvcwMqXNgWkwbOm1k8BuzXvKgmFUHQi-hM76HnVTogFkEjU9ogZthLxWKJO_74IAP7BHBog9WOxgQmD63eDLmaDMpNyTfkvz4rfPx5_px4_ImartK8szD3povyL0jtEnStHGeWR_2aUOHF0KbZMD99E6WVqTcVBUQuozmE7o6vQrJIbi-_fz7pm2BM62Nh53UYjonlBLa9GbA-EKMURaDFBfqafhQLAltUhAIbf6PccmfJoI43cqmO1m6kaWACGkJbbLoS1zy_T4z0ZCT1bcGXOBjNMBYENIi98Yesgm1GO7PnvHH6PRgnAeLHLUHHk920jr_Cob_Mv1tPOeLqFpqroJIkL6n6G3xxXfFf-hZePt2Qelb18-_zea6vdqScgOvQnPUFLxU8A034Vz-egfXMDAdmFKHYzqktDNddAW6QwI9El7HzIypdJ6Vz8Y-OmCcGxszWR2A7Tza7yXGGRfLzd9v8XE-vgfvsGzSW10UhDYFqbZwcSwml3d3R-t_MqfP-PxTvNC_1Av91Qt97sUpOK-I4UE6GA4QtEDrPNNiLMjMg--Nw7NaGn318Cx9H2vw1d1l-8f26r759PHmftO2UXG5gd77fYSJ0IbQ5kH6PnQZN8OE2hG8ydeIoDJdRKUolpxiXmG9YGWNYskZrfKKzitacdHVNasqWtXfpCyhzWBEGPFo2z9vWtldfkx4foq7U5LRsi2X5Ye2XL5KrlM7iPX01CTwhe-V5NKrCItC58DiXwGdR5FaTIjY4CGB4rxUKp1LiwKk_lczO-XIr4PmHd600nmX-Rcf8SiK-kNblItzPC5SB5-kj7QcCSA9RCQdONQOwZvY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