Bug 2338982 - Missing cstdint include breaks builds
Summary: Missing cstdint include breaks builds
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm18
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Timm Bäder
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-01-20 10:08 UTC by Vitaly
Modified: 2025-01-21 09:47 UTC (History)
1 user (show)

Fixed In Version: llvm18-18.1.8-6
Clone Of:
Environment:
Last Closed: 2025-01-21 07:14:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Vitaly 2025-01-20 10:08:41 UTC
Missing `#include <cstdint>` in LLVM 18 public headers causes build failures on Fedora 42 (Rawhide).

Reproducible: Always

Steps to Reproduce:
1. Try to to build the pocl package for Rawhide.
2.
3.
Actual Results:  
Build failure:

```
[1/2] /usr/bin/clang++-18   -O2 -flto=thin -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --config=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64 -march=z13 -mtune=z14 -fasynchronous-unwind-tables -fstack-clash-protection  -fPIE   -O2 -flto=thin -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --config=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64 -march=z13 -mtune=z14 -fasynchronous-unwind-tables -fstack-clash-protection -I/usr/lib64/llvm18/include -std=c++17   -fno-exceptions -funwind-tables -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_MAJOR=18 -MD -MT CMakeFiles/cmTC_dc868.dir/LinkTestClang.cc.o -MF CMakeFiles/cmTC_dc868.dir/LinkTestClang.cc.o.d -o CMakeFiles/cmTC_dc868.dir/LinkTestClang.cc.o -c /builddir/build/BUILD/pocl-6.0-build/pocl-6.0/cmake/LinkTestClang.cc
FAILED: CMakeFiles/cmTC_dc868.dir/LinkTestClang.cc.o 
/usr/bin/clang++-18   -O2 -flto=thin -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --config=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64 -march=z13 -mtune=z14 -fasynchronous-unwind-tables -fstack-clash-protection  -fPIE   -O2 -flto=thin -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --config=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64 -march=z13 -mtune=z14 -fasynchronous-unwind-tables -fstack-clash-protection -I/usr/lib64/llvm18/include -std=c++17   -fno-exceptions -funwind-tables -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_MAJOR=18 -MD -MT CMakeFiles/cmTC_dc868.dir/LinkTestClang.cc.o -MF CMakeFiles/cmTC_dc868.dir/LinkTestClang.cc.o.d -o CMakeFiles/cmTC_dc868.dir/LinkTestClang.cc.o -c /builddir/build/BUILD/pocl-6.0-build/pocl-6.0/cmake/LinkTestClang.cc
In file included from /builddir/build/BUILD/pocl-6.0-build/pocl-6.0/cmake/LinkTestClang.cc:24:
In file included from /usr/lib64/llvm18/include/clang/Basic/Diagnostic.h:17:
In file included from /usr/lib64/llvm18/include/clang/Basic/DiagnosticIDs.h:17:
In file included from /usr/lib64/llvm18/include/clang/Basic/LLVM.h:24:
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:119:62: error: use of undeclared identifier 'uint64_t'
  119 |     std::conditional_t<sizeof(T) < 4 && sizeof(void *) >= 8, uint64_t,
      |                                                              ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:124:27: error: use of undeclared identifier 'SmallVectorSizeType'
  124 |   alignas(SmallVectorBase<SmallVectorSizeType<T>>) char Base[sizeof(
      |                           ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:125:23: error: use of undeclared identifier 'SmallVectorSizeType'
  125 |       SmallVectorBase<SmallVectorSizeType<T>>)];
      |                       ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:134:30: error: use of undeclared identifier 'SmallVectorSizeType'
  134 |     : public SmallVectorBase<SmallVectorSizeType<T>> {
      |                              ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:135:32: error: use of undeclared identifier 'SmallVectorSizeType'
  135 |   using Base = SmallVectorBase<SmallVectorSizeType<T>>;
      |                                ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:275:9: error: use of undeclared identifier 'Base'
  275 |   using Base::capacity;
      |         ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:276:9: error: use of undeclared identifier 'Base'
  276 |   using Base::empty;
      |         ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:277:9: error: use of undeclared identifier 'Base'
  277 |   using Base::size;
      |         ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:148:44: error: member initializer 'Base' does not name a non-static data member or base class
  148 |   SmallVectorTemplateCommon(size_t Size) : Base(getFirstEl(), Size) {}
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:151:5: error: use of undeclared identifier 'Base'
  151 |     Base::grow_pod(getFirstEl(), MinSize, TSize);
      |     ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:282:37: error: use of undeclared identifier 'size'
  282 |   iterator end() { return begin() + size(); }
      |                                     ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:283:49: error: use of undeclared identifier 'size'
  283 |   const_iterator end() const { return begin() + size(); }
      |                                                 ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:291:44: error: use of undeclared identifier 'size'
  291 |   size_type size_in_bytes() const { return size() * sizeof(T); }
      |                                            ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:296:45: error: use of undeclared identifier 'capacity'
  296 |   size_t capacity_in_bytes() const { return capacity() * sizeof(T); }
      |                                             ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:304:18: error: use of undeclared identifier 'size'
  304 |     assert(idx < size());
      |                  ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:308:18: error: use of undeclared identifier 'size'
  308 |     assert(idx < size());
      |                  ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:313:13: error: use of undeclared identifier 'empty'
  313 |     assert(!empty());
      |             ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:317:13: error: use of undeclared identifier 'empty'
  317 |     assert(!empty());
      |             ^
/usr/lib64/llvm18/include/llvm/ADT/SmallVector.h:322:13: error: use of undeclared identifier 'empty'
  322 |     assert(!empty());
      |             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
```


Expected Results:  
Successful build.

Comment 1 Timm Bäder 2025-01-20 10:15:00 UTC
The 19.1.7 update showed similar problems, but in MLIR sources.

Comment 2 Timm Bäder 2025-01-21 07:14:59 UTC
Fixed via https://src.fedoraproject.org/rpms/llvm18/pull-request/3

Comment 3 Vitaly 2025-01-21 09:32:39 UTC
Thanks. Can you build it for Rawhide?

Comment 4 Timm Bäder 2025-01-21 09:47:12 UTC
Sure, done: https://koji.fedoraproject.org/koji/taskinfo?taskID=128242040


Note You need to log in before you can comment on or make changes to this bug.