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

    <tr>
        <th>Summary</th>
        <td>
            LLVM 21 seemingly assumes that `strlen` is present even if libc is not linked
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            regression,
            llvm
      </td>
    </tr>

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

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

<pre>
    I haven't created an isolated repro for this yet, but here are the symptoms:

```
test-standalone
└─ standalone_test_cases
   └─ standalone_test_cases.windows_resources
      └─ compile exe zig_resource_test Debug x86_64-windows-gnu 1 errors
error: ld.lld: undefined symbol: strlen
    note: referenced by resinator
    note:               /home/alexrp/.cache/zig/o/5a55db84c093a6181e460adf5c02418a/resinator_zcu.o:(zig.LibCInstallation.findNative)
    note: referenced by resinator
    note:               /home/alexrp/.cache/zig/o/5a55db84c093a6181e460adf5c02418a/resinator_zcu.o:(zig.LibCInstallation.findNative)
error: the following command failed with 1 compilation errors:
/home/alexrp/Source/ziglang/zig-llvm21/zig-out/bin/zig build-exe -rcflags /c65001 /I .zig-cache/o/aef5fcc6a94a711acf1fd5aefc9a8b35 -- /home/alexrp/Source/ziglang/zig-llvm21/test/standalone/windows_resources/res/zig.rc -ODebug -target x86_64-windows-gnu -mcpu baseline -Mroot=/home/alexrp/Source/ziglang/zig-llvm21/test/standalone/windows_resources/main.zig --cache-dir .zig-cache --global-cache-dir /home/alexrp/.cache/zig --name zig_resource_test -L /opt/llvm-21/lib -I /opt/llvm-21/include --zig-lib-dir lib/ --listen=-
test-standalone
└─ standalone_test_cases
   └─ standalone_test_cases.zerolength_check
      └─ run test
         └─ compile test ReleaseSmall wasm32-wasi 1 errors
error: wasm-ld: .zig-cache/o/f63cce3ea1b5c099048787fe888c88f2/test_zcu.o: undefined symbol: strlen
error: the following command failed with 1 compilation errors:
/home/alexrp/Source/ziglang/zig-llvm21/zig-out/bin/zig test -OReleaseSmall -target wasm32-wasi -mcpu baseline+bulk_memory -Mroot=/home/alexrp/Source/ziglang/zig-llvm21/test/standalone/zerolength_check/src/main.zig --cache-dir .zig-cache --global-cache-dir /home/alexrp/.cache/zig --name test -L /opt/llvm-21/lib -I /opt/llvm-21/include --zig-lib-dir lib/ --listen=-
```

It seems like LLVM is now assuming that `strlen` is present just based on the target triple? Note that we are *not* linking libc in these test cases.

cc @arsenm this seems like it could potentially be related to your recent libcall work?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcVk9v27gS_zT0ZUCDov5YOvjgNk9AgLQFXoF3NShyJLGhSIOk4jqf_oGSk6abIN3DdrFYQwdK5AyHvz9jihD0YBH3pPxAypuNmOPo_F4Y_O5Pm86py_4WRvGAlvBdBOlRRFQgLOjgzDL2ePIOeuchjjrABSPhH6GbI4zoEYRHiCNCuEyn6KZA8gNhy1Ox68MOEUOkIQqrhHEW0-x_OGmK9KyDmsGP-WNaf5QiYCDsAAB_dvX2rK1y53D0GNzs5VP82ymkm07aIOB3hEc9PActCeEGu3mA73V1rAp6zUsHO0MG6L3zKfUyIPkBjNoao9Jotgp7bVElRDpn0rcQvUF7LcW6iOmjxx49WokKugt4DNqK6PwfVv38I7wd3YSEtyuDhLdbKeSYvjzqgfDWEd6WoixVVxeSNbmosjrDomJC9aVkvMhqQXj7vN3xUc5bl0jj9aMetne6-3hrQxTGiKid3fbaqs8i6gckvPl3HOGZtaTb3hnjztoOSQ6TsAp6oQ0qOOs4QnYVyZLoifdV4a_P8XVRz3oOI-ywjqgxDxPPri9ujoS3nbbrO3SzNoomBVIveyOGkBCSVclYlka3sE1hTwglbAT2ZS9lJZpC7LJMyD7rVSmwl42ou7wESt9C-VfVJdET3r5wKW9f22nBfQ3degn0y2oTGoUfML5lFzrJ0wydCGi0RaCfvHOR5De_scRJaJtgA7oCR5X2L3AESgfjOmFezP5ClkCpFdNbbYLepVh3SoWlQul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