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

    <tr>
        <th>Summary</th>
        <td>
            using import_name in wasm32 target causes undefined symbols if it matches a builtin
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    little example: https://github.com/lesleyrs/builtin-fail

When there are 2 symbols available (builtin and import_name) it unexpectedly causes undefined symbol linking error.

There's no great workaround for this, because the existing builtins change per clang version, so if you decided to do specific `-fno-builtin-xxx` that could fail to compile on newer clang versions.

I think it's best for builtin to just override the import_name the same way that builtins override other funcs, especially since the builtin math funcs only appear when math.h is included. (I'm importing math funcs from JS)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U0HPqzYQ_DXmskpkTPiSHDikrSK9Xlupx8rYC-z7jI28dhL-fWWSvH6q1HcCZGZ2ZtajmWn0iJ1ofxHtb5XOaQqxc8gO18hVH-zaOUrJIeBDz4tD0VxgSmlh0VyEugp1HSlNud-bMAt1fUOFuvaZXCK_GzQ5IS9CXv6a0EOaMCLoiKCA17kPjkHfNDndOwShTi8caG-B5iXE9LfXMwp1BkqQPT4WNAmtW8HozMiQvcWBPNoXITjyn-RHwBhD3D-H_1nmCnVk8AHGiDrBPcRPHUP2FoYQIU3EQv0KPW68RSnggzgVqpcqBjNpPyIsGME47Ue4YWQKviA5AA2whgwWDVm0kALYALygoYEMiA-5G3zYvbN5PB7iQ0KadAITsrNQ0iooE-aFHELw4PH-32H8MvWtiPafQGlz1iOnzco7wxTge-YE4YYxkn16-hLq9s3l5a7Xp4wfRn9gQlkZDNmbLR7c3GjnVmDy5snxHjjrND1_heDdCnpZUEe4l82Xs_0ExEDeuGzR7su-vwl1nF-iStJfKIYYZvj9D6HOle0ae27OusKuPratPJ-P8lxN3XBsD8caTycpsemN-ej7eqiPWKt2sCgPFXVKqlae6qZuD_XhvO-HGk-opJSn_mT7gzhInDW5vXO3eR_iWBFzxq5um0Nzqpzu0fHWEKU83mE7FUqVwsSugHZ9HlkcpCNO_C9NouSwy1xMfc2cPNw1z42CpOOI6f-uMZfLRKkEYiZk0O-Uqxxd97MSutv7sVti-I4mCXXddJdivozdOvVPAAAA__9Ag2JU">