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

    <tr>
        <th>Summary</th>
        <td>
            clang 15.0.x not finding Scrt1.o, crti,o, crtn.o on i686: Regression from 14.x
        </td>
    </tr>

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

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

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

<pre>
    Trying to build openmp 15.0.2 with clang 15.0.1, but this happens whenever clang built on i686 is used. This isn't an issue on x86_64 or armv7l.

```
-- The C compiler identification is Clang 15.0.1
-- The CXX compiler identification is Clang 15.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/local/bin/clang
-- Check for working C compiler: /usr/local/bin/clang - broken
CMake Error at /usr/local/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/local/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /usr/local/tmp/crew/openmp.20221006144343.dir/openmp-15.0.2.src/builddir/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/local/bin/ninja cmTC_2f1f7 && [1/2] Building C object CMakeFiles/cmTC_2f1f7.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_2f1f7
    FAILED: cmTC_2f1f7
    : && /usr/local/bin/clang --target=i686-cros-linux-gnu -march=i686  CMakeFiles/cmTC_2f1f7.dir/testCCompiler.c.o -o cmTC_2f1f7   && :
    /usr/local/bin/ld: error: cannot open Scrt1.o: No such file or directory
    /usr/local/bin/ld: error: cannot open crti.o: No such file or directory
    /usr/local/bin/ld: error: cannot open crtn.o: No such file or directory
    /usr/local/bin/ld: error: cannot open /usr/lib/libc_nonshared.a: No such file or directory
    clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:14 (project)


-- Configuring incomplete, errors occurred!
See also "/usr/local/tmp/crew/openmp.20221006144343.dir/openmp-15.0.2.src/builddir/CMakeFiles/CMakeOutput.log".
```

It gets much further with clang 14.0.6, but I think we need clang 15.x to build the llvm 15 version of openmp...
```
-- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test OPENMP_HAVE_ONEAPI_COMPILER
-- Performing Test OPENMP_HAVE_ONEAPI_COMPILER - Failed
-- Performing Test OPENMP_HAVE_WALL_FLAG
-- Performing Test OPENMP_HAVE_WALL_FLAG - Success
-- Performing Test OPENMP_HAVE_WERROR_FLAG
-- Performing Test OPENMP_HAVE_WERROR_FLAG - Success
-- Performing Test OPENMP_HAVE_WCAST_QUAL_FLAG
-- Performing Test OPENMP_HAVE_WCAST_QUAL_FLAG - Success
-- Performing Test OPENMP_HAVE_WFORMAT_PEDANTIC_FLAG
-- Performing Test OPENMP_HAVE_WFORMAT_PEDANTIC_FLAG - Success
-- Performing Test OPENMP_HAVE_WIMPLICIT_FALLTHROUGH_FLAG
-- Performing Test OPENMP_HAVE_WIMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test OPENMP_HAVE_WSIGN_COMPARE_FLAG
-- Performing Test OPENMP_HAVE_WSIGN_COMPARE_FLAG - Success
-- Performing Test OPENMP_HAVE_WNO_EXTRA_FLAG
-- Performing Test OPENMP_HAVE_WNO_EXTRA_FLAG - Success
-- Performing Test OPENMP_HAVE_WNO_PEDANTIC_FLAG
-- Performing Test OPENMP_HAVE_WNO_PEDANTIC_FLAG - Success
-- Performing Test OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG
-- Performing Test OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG - Failed
-- Performing Test OPENMP_HAVE_STD_CPP14_FLAG
-- Performing Test OPENMP_HAVE_STD_CPP14_FLAG - Success
...
-- LIBOMPTARGET: Building the llvm-omp-device-info tool
CMake Error at libomptarget/tools/CMakeLists.txt:20 (llvm_add_tool):
  Unknown CMake command "llvm_add_tool".
Call Stack (most recent call first):
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1WN1zqjgU_2v0JQODaK198IGi9jJj1bV2t7svTICguULiJKG1__2eBPzA6-2W7r0OA0rO9zk55xcjnrwPV-KdsjVSHEUFzRLEd4TlO9S5sR3bRW9UbVCcYaAwbzot1wdChdSGSrTBO6CW6G1DGHkloqLUghTiDNH-oI-ArpAksdFKs1DJWu6tQhhWpSyIJtsP-mG_h7hAWOSvt5ndckYtx6vufae6zE_LAjkE-Sjm-Y5moJMmhCma0hgrqnVK5J_bW-N6eWnMNyKKxEqH6Eyndx8gylL-OSpkoRTDm-RI7m9IvEUpePzGxbbO1up6qOVOCingnvEYZ_CMKIRtYsL7S4SASZHgW8JKaf4j3hI0FkLnQP3IKTdYEM2bA53Vtd0e_HjkSZERCd8M-4pI5fuVfttQghX9O5A2yImUeA0S7uBVqRJd5PE85wg-Ldf9MAqwXOOA_DEOdRVlRBdzJRZhJGm-0-_APLQTfC1wbtdZA2XyI8tqV2BWyrOMv-mQ8kLtCnW0-mSfvwErCBrR67FW-U6bKsgbPMo9ZbuO63Ycp9_p9bq9rp1QcVyzyv1mSxFrP_VOLJdNaCf0PM4g-cKWZcHQvdm9EP8cswRCLqtgX48ho-w7RnG-8kM37aS34EAfLtS6uYctPnFbN6NSYllWPPoO5Y1qxpyYK09UvQBsfpbMm3v3IHZKWVWsZE_iQpmMnYSdmCZeMB2PdHSvrZZRL43-sNAthcWaQApHuh1ZseDSyigr9taaFcjKsYg31S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