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

    <tr>
        <th>Summary</th>
        <td>
            Failure in building `offload-tblgen/APIGen.cpp` with parallel build
        </td>
    </tr>

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

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

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

<pre>
    During a 3 stage build using CMake + Make , following a parallel build (`make -j 8 VERBOSE=1`)
I encountered the following error during the build of the `offload-tblgen` offload tool


```
cd /home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm.obj.3/runtimes/runtimes-bins/offload/tools/offload-tblgen && /tmp/eb-k5n5152l/tmprub7h5td/rpath_wrappers/clangxx_wrapper/clang++ --target=x86_64-unknown-linux-gnu -DLLVM_BUILD_STATIC -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm-project-20.1.0.src/llvm/include -I/home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm.obj.3/include -isystem /home/crivella/.local/easybuild/software/zlib/1.3.1/include --gcc-install-dir=/home/crivella/.local/easybuild/software/GCCcore/13.3.0/lib/gcc/x86_64-pc-linux-gnu/13.3.0 -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -MD -MT offload/tools/offload-tblgen/CMakeFiles/offload-tblgen.dir/APIGen.cpp.o -MF CMakeFiles/offload-tblgen.dir/APIGen.cpp.o.d -o CMakeFiles/offload-tblgen.dir/APIGen.cpp.o -c /home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm-project-20.1.0.src/offload/tools/offload-tblgen/APIGen.cpp

In file included from /home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm-project-20.1.0.src/offload/tools/offload-tblgen/APIGen.cpp:14:
In file included from /home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm-project-20.1.0.src/llvm/include/llvm/ADT/StringExtras.h:17:
In file included from /home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm-project-20.1.0.src/llvm/include/llvm/ADT/APSInt.h:18:
In file included from /home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm-project-20.1.0.src/llvm/include/llvm/ADT/APInt.h:19:
In file included from /home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm-project-20.1.0.src/llvm/include/llvm/Support/MathExtras.h:16:
/home/crivella/.local/easybuild/build/LLVM/20.1.0/system-system/llvm-project-20.1.0.src/llvm/include/llvm/ADT/bit.h:18:10: fatal error: 'cstdint' file not found
   18 | #include <cstdint>
      | ^~~~~~~~~
```

After attempting to re-execute the build in serial `make -j 1 VERBOSE=1` to try and debug the errors 1 by 1 the build actually succeeded.

Could there be a missing dependency for the offload tools that can cause parallel build to fails if the dep is not resolved before the tool build?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUV19v2zgS_zT0y4CCRNly8uAHx44KA3WzaLKbR4MiRzZbmtTxjx3vw332AyWl8bYL3PWALlrDgMThzPA3o_lH7r3aG8QFmd2R2XrCYzhYt1g5dUKt-aSx8rJYR6fMHjiU4APfIzRRaQnRJ-pqyz8jEHYH48sKWqu1PQ8iHXdca9SjDGE3pMqPiZN-ghv44_7j3cPjPSnXBalywm5JvtwAGmGjCehQQjjglUJ0zjqQA6C0Nai1bb8gVW7bVlsuaWj0Hg2pchgpEKzVJF-O_yof__lSJFj1wR6RsFqMlhN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