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

    <tr>
        <th>Summary</th>
        <td>
            LLVM build failed for WebAssembly target
        </td>
    </tr>

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

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

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

<pre>
    I used the following command to build the LLVM for `WebAssembly` target on my mac:
`cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm -DLLVM_TARGETS_TO_BUILD="WebAssembly"`
The `make` command after running the above `cmake` failed by having the following error:
```
[ 76%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/Targets/Sparc.cpp.o
/Users/bhavyabhatt/Desktop/bhavya/projects/wasm-llvm/llvm-project/clang/lib/CodeGen/Targets/Sparc.cpp:269:7: error: no matching function for call to 'max'
 std::max(CB.DL.getTypeSizeInBits(StrTy).getKnownMinValue(), 1UL), 64));
 ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/max.h:40:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('llvm::details::FixedOrScalableQuantity<llvm::TypeSize, unsigned long long>::ScalarTy' (aka 'unsigned long long') vs. 'unsigned long')
max(const _Tp& __a, const _Tp& __b)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/max.h:51:1: note: candidate template ignored: could not match 'initializer_list<_Tp>' against 'llvm::details::FixedOrScalableQuantity<llvm::TypeSize, unsigned long long>::ScalarTy' (aka 'unsigned long long')
max(initializer_list<_Tp> __t, _Compare __comp)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/max.h:61:1: note: candidate function template not viable: requires single argument '__t', but 2 arguments were provided
max(initializer_list<_Tp> __t)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__algorithm/max.h:31:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
1 error generated.
make[2]: *** [tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/Targets/Sparc.cpp.o] Error 1
make[1]: *** [tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/all] Error 2
make: *** [all] Error 2
```

The output of command `clang --version` is 
```
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMl89u2zgTwJ-GvhAWJOpffPDBtqwiX50v3drpdk8CJY1kNhSpJSkn7mGffUHKdrJtWrTAFptAiCXODGfmNxQ1pFqzVgDMUbxEcTahg9lLNdc9EzJIJ6Wsj_NrPGiosdkDbiTn8oGJFley66iosZG4HBgfxZvNhxvcSIVR4v8O5UJr6Ep-RImPDVUtGCwF7o64oxUKF8jPkL9AiV919B7wNLPmxfr_i-VmXbx7f_u_9Wq3RWFWcSpaPM1WN4u362J5d73Jit0f79YozN4DB6oBT99gRMidYI_4ht5DwzhoRAj2PERyzg_defbd4v2b9W5b7G7HiVCYIUKex0oISvwxtN0ebCY2OpvCOWXaGFBYDUJYEDZvWsqDU63Oug1lHGpcHvGeHs5qT_RAKameIzhd42O8xGmCSIziDC8tXGuy-vgRy_ITVAYbKblGJHdgbIKsRCRfyRregLB3lkE-Mshl-clziie5VzOFSL5z9bAK256qyqv63pMn_yS_06CsrNzTw5GWe2oMInkG-t7I_jKOSN4raUOyug9Ud1PL-oR8epJ9J9AXgkDhgiQzFC5SFC4unLCQuKOm2lsSzSAqw6RwK62inNtFiEja0UdE0jEHrE1t-YYLN3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