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

    <tr>
        <th>Summary</th>
        <td>
            Build fails in Ubuntu 18.04 system with zstd development package installed
        </td>
    </tr>

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

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

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

<pre>
    Build fails in Ubuntu 18.04 system with zstd development package installed:

```
/opt/llvm-build/llvm-18.x/rc2/llvm-project/lld/ELF/OutputSections.cpp:362:40: error: use of undeclared identifier 'ZSTD_c_nbWorkers'
  362 | (void)ZSTD_CCtx_setParameter(cctx, ZSTD_c_nbWorkers,
      | ^
/opt/llvm-build/llvm-18.x/rc2/llvm-project/lld/ELF/OutputSections.cpp:365:5: error: unknown type name 'ZSTD_EndDirective'
  365 |     ZSTD_EndDirective directive = ZSTD_e_continue;
      | ^
/opt/llvm-build/llvm-18.x/rc2/llvm-project/lld/ELF/OutputSections.cpp:365:35: error: use of undeclared identifier 'ZSTD_e_continue'
  365 | ZSTD_EndDirective directive = ZSTD_e_continue; 
      | ^
/opt/llvm-build/llvm-18.x/rc2/llvm-project/lld/ELF/OutputSections.cpp:370:21: error: use of undeclared identifier 'ZSTD_e_end'
  370 |         directive = ZSTD_e_end;
      | ^
/opt/llvm-build/llvm-18.x/rc2/llvm-project/lld/ELF/OutputSections.cpp:374:28: error: use of undeclared identifier 'ZSTD_e_end'
  374 | (directive == ZSTD_e_end && bytesRemaining != 0)) {
      | ^
/opt/llvm-build/llvm-18.x/rc2/llvm-project/lld/ELF/OutputSections.cpp:384:27: error: use of undeclared identifier 'ZSTD_e_end'
  384 |     } while (directive != ZSTD_e_end);
      |                           ^
6 errors generated.
```

1. The minimum supported version of zstd should be stated on page https://llvm.org/docs/GettingStarted.html
2. The build system should detect the version of zstd and disable zstd support when the version does not meet the requirements.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzElkGPqzYQxz-NcxkVgYEABw67yaaXSq26r6rUy8rYE3AXbGoPyW4_fWVI0k2zPbxq-9aKEAR7Zn7_v9FYeK9bg1iz_J7l25WYqLOu9ta0yprWd2jaVWPVa30_6V7BXujegzbwSzMZmiApozgD_-oJBzhq6uBPTwoUHrC344CGYBTyWbQI2ngSfY-KpXcs3rL4fF3Hp9_yyHd2JMZ3fX8YvmtC1vNDUkYvjO-c5Od_Rmd_R7nMDtMeftgxvvtxonGiR5SkrfGRHEeW3qVrztK7LGbpHaBz1oWbySPYPUxGoeyFQwVaoSG91-iA8eK3xy_bJ_lkml-te0bnGS-WKgHSNQdWbIDx8mC1YryaJ2829PLkkX4STgxI6BgvpaQXxjdwG21zjhbGHC1_-L9lyFl6l1-rYJ6NPRqg1xHBiAEv6A9GbbULEQ54xZ7P1YZxMw_U5Y6l2-U9PklrSJsJWXr_Scxp_vXWv6n7lv7ryeHboxdhw_Pkv6CjUW-pi_jieRjvsoYln2FwkQXK8iMos_NXfQV4zQiMrxlfQ_NK6H_GQWijTQss6LyFmPGK8QpY8QlKlLMSxQcoUWYXv1mxhWOne_yHLgvv2-XVO_b_-7jIsV6K9dCiQScIVfR-c5ivSQRfOoRBGz1MA_hpHK0jVHBA57U1AXZuQ76zU6-gQfAUgoI1MIZe1BGNPvQhvjuJHFnXMr5TVnrGd98jkTbtI4kQN-po6JfUfEk9G3Zue6csCgklAXV4U4cwCpT2ounxVNhSMhw7NFcrlEUPxhIMiEssh39M2mFopf4kykrVqarSSqywToq4TMqkSqtVV6cNb2QqeLPOqioVlZTFXmGjGlnEMtmnK13zmGcxT4oky8u8ipTYN3HeZAnKUsZlwrI4bOc-Omuy0t5PWJc8SbJVLxrs_XxW4NzgEeaXjPNwdHD1aS-3nmVxrz35v6OQph4_8AyxmlxfX7vYauqmJpJ2OFl6-_nM5QZ_Z5y_AgAA__9f7Msd">