Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to build with LLVM 18 #19532

Closed
ognevny opened this issue Apr 4, 2024 · 6 comments
Closed

fails to build with LLVM 18 #19532

ognevny opened this issue Apr 4, 2024 · 6 comments
Labels
question No questions on the issue tracker, please.

Comments

@ognevny
Copy link

ognevny commented Apr 4, 2024

Zig Version

git HEAD

Steps to Reproduce and Observed Behavior

get LLVM 18 (e.g. msys2) and run bootstrap
get errors

[3/19] Building CXX object CMakeFiles/zigcpp.dir/src/zig_llvm-ar.cpp.obj
FAILED: CMakeFiles/zigcpp.dir/src/zig_llvm-ar.cpp.obj
C:\msys64\clang64\bin\clang++.exe  -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/build-CLANG64 -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wno-incompatible-pointer-types -O3 -DNDEBUG -std=c++17 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Werror=type-limits -Wno-missing-braces -Wno-comment -Wno-format -fno-stack-protector -MD -MT CMakeFiles/zigcpp.dir/src/zig_llvm-ar.cpp.obj -MF CMakeFiles\zigcpp.dir\src\zig_llvm-ar.cpp.obj.d -o CMakeFiles/zigcpp.dir/src/zig_llvm-ar.cpp.obj -c C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm-ar.cpp
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm-ar.cpp:1065:7: error: no matching function for call to 'writeArchive'
 1065 |       writeArchive(ArchiveName, NewMembersP ? *NewMembersP : NewMembers, Symtab,
      |       ^~~~~~~~~~~~
C:/msys64/clang64/include/llvm/Object/ArchiveWriter.h:51:7: note: candidate function not viable: no known conversion from 'bool' to 'SymtabWritingMode' for 3rd argument
   51 | Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
      |       ^
   52 |                    SymtabWritingMode WriteSymtab, object::Archive::Kind Kind,
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm-ar.cpp:1265:11: warning: 'startswith' is deprecated: Use starts_with instead [-Wdeprecated-declarations]
 1265 |   if (Arg.startswith("--"))
      |           ^~~~~~~~~~
      |           starts_with
C:/msys64/clang64/include/llvm/ADT/StringRef.h:261:19: note: 'startswith' has been explicitly marked deprecated here
  261 |     [[nodiscard]] LLVM_DEPRECATED(
      |                   ^
C:/msys64/clang64/include/llvm/Support/Compiler.h:155:50: note: expanded from macro 'LLVM_DEPRECATED'
  155 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
      |                                                  ^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm-ar.cpp:1275:11: warning: 'startswith' is deprecated: Use starts_with instead [-Wdeprecated-declarations]
 1275 |   if (Arg.startswith(Expected) && Arg.size() > len && Arg[len] == '=')
      |           ^~~~~~~~~~
      |           starts_with
C:/msys64/clang64/include/llvm/ADT/StringRef.h:261:19: note: 'startswith' has been explicitly marked deprecated here
  261 |     [[nodiscard]] LLVM_DEPRECATED(
      |                   ^
C:/msys64/clang64/include/llvm/Support/Compiler.h:155:50: note: expanded from macro 'LLVM_DEPRECATED'
  155 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
      |                                                  ^
2 warnings and 1 error generated.
[6/19] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang.cpp.obj
FAILED: CMakeFiles/zigcpp.dir/src/zig_clang.cpp.obj
C:\msys64\clang64\bin\clang++.exe  -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/build-CLANG64 -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wno-incompatible-pointer-types -O3 -DNDEBUG -std=c++17 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Werror=type-limits -Wno-missing-braces -Wno-comment -Wno-format -fno-stack-protector -MD -MT CMakeFiles/zigcpp.dir/src/zig_clang.cpp.obj -MF CMakeFiles\zigcpp.dir\src\zig_clang.cpp.obj.d -o CMakeFiles/zigcpp.dir/src/zig_clang.cpp.obj -c C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:399:13: warning: enumeration value 'OMPScopeDirectiveClass' not handled in switch [-Wswitch]
  399 |     switch (x) {
      |             ^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:639:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_GCCAsmStmtClass == clang::Stmt::GCCAsmStmtClass':
  639 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_GCCAsmStmtClass == clang::Stmt::GCCAsmStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:639:68: note: expression evaluates to '1 == 234'
  639 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_GCCAsmStmtClass == clang::Stmt::GCCAsmStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:640:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_MSAsmStmtClass == clang::Stmt::MSAsmStmtClass':
  640 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSAsmStmtClass == clang::Stmt::MSAsmStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:640:67: note: expression evaluates to '2 == 233'
  640 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSAsmStmtClass == clang::Stmt::MSAsmStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:641:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_BreakStmtClass == clang::Stmt::BreakStmtClass':
  641 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_BreakStmtClass == clang::Stmt::BreakStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:641:67: note: expression evaluates to '3 == 232'
  641 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_BreakStmtClass == clang::Stmt::BreakStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:642:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_CXXCatchStmtClass == clang::Stmt::CXXCatchStmtClass':
  642 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXCatchStmtClass == clang::Stmt::CXXCatchStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:642:70: note: expression evaluates to '4 == 231'
  642 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXCatchStmtClass == clang::Stmt::CXXCatchStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:643:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_CXXForRangeStmtClass == clang::Stmt::CXXForRangeStmtClass':
  643 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXForRangeStmtClass == clang::Stmt::CXXForRangeStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:643:73: note: expression evaluates to '5 == 230'
  643 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXForRangeStmtClass == clang::Stmt::CXXForRangeStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:644:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_CXXTryStmtClass == clang::Stmt::CXXTryStmtClass':
  644 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXTryStmtClass == clang::Stmt::CXXTryStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:644:68: note: expression evaluates to '6 == 229'
  644 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXTryStmtClass == clang::Stmt::CXXTryStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:645:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_CapturedStmtClass == clang::Stmt::CapturedStmtClass':
  645 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CapturedStmtClass == clang::Stmt::CapturedStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:645:70: note: expression evaluates to '7 == 228'
  645 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CapturedStmtClass == clang::Stmt::CapturedStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:646:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_CompoundStmtClass == clang::Stmt::CompoundStmtClass':
  646 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CompoundStmtClass == clang::Stmt::CompoundStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:646:70: note: expression evaluates to '8 == 227'
  646 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CompoundStmtClass == clang::Stmt::CompoundStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:647:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_ContinueStmtClass == clang::Stmt::ContinueStmtClass':
  647 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ContinueStmtClass == clang::Stmt::ContinueStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:647:70: note: expression evaluates to '9 == 226'
  647 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ContinueStmtClass == clang::Stmt::ContinueStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:648:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_CoreturnStmtClass == clang::Stmt::CoreturnStmtClass':
  648 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoreturnStmtClass == clang::Stmt::CoreturnStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:648:70: note: expression evaluates to '10 == 225'
  648 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoreturnStmtClass == clang::Stmt::CoreturnStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:649:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_CoroutineBodyStmtClass == clang::Stmt::CoroutineBodyStmtClass':
  649 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoroutineBodyStmtClass == clang::Stmt::CoroutineBodyStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:649:75: note: expression evaluates to '11 == 224'
  649 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoroutineBodyStmtClass == clang::Stmt::CoroutineBodyStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:650:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_DeclStmtClass == clang::Stmt::DeclStmtClass':
  650 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DeclStmtClass == clang::Stmt::DeclStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:650:66: note: expression evaluates to '12 == 223'
  650 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DeclStmtClass == clang::Stmt::DeclStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:651:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_DoStmtClass == clang::Stmt::DoStmtClass':
  651 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DoStmtClass == clang::Stmt::DoStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:651:64: note: expression evaluates to '13 == 222'
  651 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_DoStmtClass == clang::Stmt::DoStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:652:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_ForStmtClass == clang::Stmt::ForStmtClass':
  652 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ForStmtClass == clang::Stmt::ForStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:652:65: note: expression evaluates to '14 == 221'
  652 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_ForStmtClass == clang::Stmt::ForStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:653:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_GotoStmtClass == clang::Stmt::GotoStmtClass':
  653 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_GotoStmtClass == clang::Stmt::GotoStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:653:66: note: expression evaluates to '15 == 220'
  653 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_GotoStmtClass == clang::Stmt::GotoStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:654:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_IfStmtClass == clang::Stmt::IfStmtClass':
  654 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_IfStmtClass == clang::Stmt::IfStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:654:64: note: expression evaluates to '16 == 219'
  654 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_IfStmtClass == clang::Stmt::IfStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:655:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_IndirectGotoStmtClass == clang::Stmt::IndirectGotoStmtClass':
  655 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_IndirectGotoStmtClass == clang::Stmt::IndirectGotoStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:655:74: note: expression evaluates to '17 == 218'
  655 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_IndirectGotoStmtClass == clang::Stmt::IndirectGotoStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:656:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_MSDependentExistsStmtClass == clang::Stmt::MSDependentExistsStmtClass':
  656 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSDependentExistsStmtClass == clang::Stmt::MSDependentExistsStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:656:79: note: expression evaluates to '18 == 217'
  656 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSDependentExistsStmtClass == clang::Stmt::MSDependentExistsStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:657:15: error: static assertion failed due to requirement '(clang::Stmt::StmtClass)ZigClangStmt_NullStmtClass == clang::Stmt::NullStmtClass':
  657 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_NullStmtClass == clang::Stmt::NullStmtClass, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang.cpp:657:66: note: expression evaluates to '19 == 216'
  657 | static_assert((clang::Stmt::StmtClass)ZigClangStmt_NullStmtClass == clang::Stmt::NullStmtClass, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
[7/19] Building CXX object CMakeFiles/zigcpp.dir/src/zig_llvm.cpp.obj
FAILED: CMakeFiles/zigcpp.dir/src/zig_llvm.cpp.obj
C:\msys64\clang64\bin\clang++.exe  -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/build-CLANG64 -IC:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wno-incompatible-pointer-types -O3 -DNDEBUG -std=c++17 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Werror=type-limits -Wno-missing-braces -Wno-comment -Wno-format -fno-stack-protector -MD -MT CMakeFiles/zigcpp.dir/src/zig_llvm.cpp.obj -MF CMakeFiles\zigcpp.dir\src\zig_llvm.cpp.obj.d -o CMakeFiles/zigcpp.dir/src/zig_llvm.cpp.obj -c C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:113:17: error: no type named 'Level' in namespace 'llvm::CodeGenOpt'
  113 |     CodeGenOpt::Level OL;
      |     ~~~~~~~~~~~~^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:116:18: error: no member named 'None' in namespace 'llvm::CodeGenOpt'; did you mean 'Done'?
  116 |             OL = CodeGenOpt::None;
      |                  ^~~~~~~~~~~~~~~~
      |                  Done
C:/msys64/clang64/include/llvm/Support/Threading.h:61:50: note: 'Done' declared here
   61 |   enum InitStatus { Uninitialized = 0, Wait = 1, Done = 2 };
      |                                                  ^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:119:18: error: no member named 'Less' in namespace 'llvm::CodeGenOpt'; did you mean 'gets'?
  119 |             OL = CodeGenOpt::Less;
      |                  ^~~~~~~~~~~~~~~~
      |                  gets
C:/msys64/clang64/include/stdio.h:806:8: note: 'gets' declared here
  806 | char * gets(char * __dst)
      |        ^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:122:30: error: no member named 'Aggressive' in namespace 'llvm::CodeGenOpt'
  122 |             OL = CodeGenOpt::Aggressive;
      |                  ~~~~~~~~~~~~^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:125:30: error: no member named 'Default' in namespace 'llvm::CodeGenOpt'
  125 |             OL = CodeGenOpt::Default;
      |                  ~~~~~~~~~~~~^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:339:80: error: use of undeclared identifier 'CGFT_ObjectFile'
  339 |         if (target_machine.addPassesToEmitFile(codegen_pm, *dest_bin, nullptr, CGFT_ObjectFile)) {
      |                                                                                ^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:345:80: error: use of undeclared identifier 'CGFT_AssemblyFile'
  345 |         if (target_machine.addPassesToEmitFile(codegen_pm, *dest_asm, nullptr, CGFT_AssemblyFile)) {
      |                                                                                ^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:537:17: error: no matching function for call to 'writeArchive'
  537 |     Error err = writeArchive(archive_name, new_members, true, kind, true, false, nullptr);
      |                 ^~~~~~~~~~~~
C:/msys64/clang64/include/llvm/Object/ArchiveWriter.h:51:7: note: candidate function not viable: no known conversion from 'bool' to 'SymtabWritingMode' for 3rd argument
   51 | Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
      |       ^
   52 |                    SymtabWritingMode WriteSymtab, object::Archive::Kind Kind,
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:623:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_spirv32 == Triple::spirv32': 
  623 | static_assert((Triple::ArchType)ZigLLVM_spirv32 == Triple::spirv32, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:623:49: note: expression evaluates to '51 == 52'
  623 | static_assert((Triple::ArchType)ZigLLVM_spirv32 == Triple::spirv32, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:624:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_spirv64 == Triple::spirv64': 
  624 | static_assert((Triple::ArchType)ZigLLVM_spirv64 == Triple::spirv64, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:624:49: note: expression evaluates to '52 == 53'
  624 | static_assert((Triple::ArchType)ZigLLVM_spirv64 == Triple::spirv64, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:625:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_kalimba == Triple::kalimba': 
  625 | static_assert((Triple::ArchType)ZigLLVM_kalimba == Triple::kalimba, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:625:49: note: expression evaluates to '53 == 54'
  625 | static_assert((Triple::ArchType)ZigLLVM_kalimba == Triple::kalimba, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:626:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_shave == Triple::shave':     
  626 | static_assert((Triple::ArchType)ZigLLVM_shave == Triple::shave, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:626:47: note: expression evaluates to '54 == 55'
  626 | static_assert((Triple::ArchType)ZigLLVM_shave == Triple::shave, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:627:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_lanai == Triple::lanai':     
  627 | static_assert((Triple::ArchType)ZigLLVM_lanai == Triple::lanai, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:627:47: note: expression evaluates to '55 == 56'
  627 | static_assert((Triple::ArchType)ZigLLVM_lanai == Triple::lanai, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:628:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_wasm32 == Triple::wasm32':   
  628 | static_assert((Triple::ArchType)ZigLLVM_wasm32 == Triple::wasm32, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:628:48: note: expression evaluates to '56 == 57'
  628 | static_assert((Triple::ArchType)ZigLLVM_wasm32 == Triple::wasm32, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:629:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_wasm64 == Triple::wasm64':   
  629 | static_assert((Triple::ArchType)ZigLLVM_wasm64 == Triple::wasm64, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:629:48: note: expression evaluates to '57 == 58'
  629 | static_assert((Triple::ArchType)ZigLLVM_wasm64 == Triple::wasm64, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:630:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_renderscript32 == Triple::renderscript32':
  630 | static_assert((Triple::ArchType)ZigLLVM_renderscript32 == Triple::renderscript32, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:630:56: note: expression evaluates to '58 == 59'
  630 | static_assert((Triple::ArchType)ZigLLVM_renderscript32 == Triple::renderscript32, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:631:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_renderscript64 == Triple::renderscript64':
  631 | static_assert((Triple::ArchType)ZigLLVM_renderscript64 == Triple::renderscript64, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:631:56: note: expression evaluates to '59 == 60'
  631 | static_assert((Triple::ArchType)ZigLLVM_renderscript64 == Triple::renderscript64, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:632:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_ve == Triple::ve':
  632 | static_assert((Triple::ArchType)ZigLLVM_ve == Triple::ve, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:632:44: note: expression evaluates to '60 == 61'
  632 | static_assert((Triple::ArchType)ZigLLVM_ve == Triple::ve, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:633:15: error: static assertion failed due to requirement '(llvm::Triple::ArchType)ZigLLVM_LastArchType == Triple::LastArchType':
  633 | static_assert((Triple::ArchType)ZigLLVM_LastArchType == Triple::LastArchType, "");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_llvm.cpp:633:54: note: expression evaluates to '60 == 61'
  633 | static_assert((Triple::ArchType)ZigLLVM_LastArchType == Triple::LastArchType, "");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[8/19] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_driver.cpp.obj
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang_driver.cpp:125:55: warning: 'endswith' is deprecated: Use ends_with instead [-Wdeprecated-declarations]
  125 |   } else if (Edit[0] == 's' && Edit[1] == '/' && Edit.endswith("/") &&
      |                                                       ^~~~~~~~
      |                                                       ends_with
C:/msys64/clang64/include/llvm/ADT/StringRef.h:276:19: note: 'endswith' has been explicitly marked deprecated here
  276 |     [[nodiscard]] LLVM_DEPRECATED(
      |                   ^
C:/msys64/clang64/include/llvm/Support/Compiler.h:155:50: note: expanded from macro 'LLVM_DEPRECATED'
  155 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
      |                                                  ^
C:/msys64/home/maksa/forks/MINGW-packages/mingw-w64-zig/src/zig/src/zig_clang_driver.cpp:408:46: warning: 'startswith' is deprecated: Use starts_with instead [-Wdeprecated-declarations]
  408 |   if (Args.size() >= 2 && StringRef(Args[1]).startswith("-cc1"))
      |                                              ^~~~~~~~~~
      |                                              starts_with
C:/msys64/clang64/include/llvm/ADT/StringRef.h:261:19: note: 'startswith' has been explicitly marked deprecated here
  261 |     [[nodiscard]] LLVM_DEPRECATED(
      |                   ^
C:/msys64/clang64/include/llvm/Support/Compiler.h:155:50: note: expanded from macro 'LLVM_DEPRECATED'
  155 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
      |                                                  ^
2 warnings generated.

Expected Behavior

expected succesful build for stage1

@ognevny ognevny added the bug Observed behavior contradicts documented or intended behavior label Apr 4, 2024
@RossComputerGuy
Copy link
Contributor

Currently, Zig uses LLVM 17 so please use LLVM 17 and not 18.

@ognevny
Copy link
Author

ognevny commented Apr 4, 2024

Currently, Zig uses LLVM 17 so please use LLVM 17 and not 18.

msys2 has only llvm 18 (14 and 15 versions for some packages)

@RossComputerGuy
Copy link
Contributor

You can always compile LLVM yourself.

@ognevny
Copy link
Author

ognevny commented Apr 4, 2024

You can always compile LLVM yourself.

this is not a solution as I want to return zig back to msys2 (it was disable a couple of years ago)

@RossComputerGuy
Copy link
Contributor

I don't see any alternative solution as stage 1 requires LLVM 17, you can always try to do the LLVM upgrade process as described in the wiki but I don't recommend it if you run into issues.

@jacobly0 jacobly0 added question No questions on the issue tracker, please. and removed bug Observed behavior contradicts documented or intended behavior labels Apr 5, 2024
@jacobly0
Copy link
Member

jacobly0 commented Apr 5, 2024

Zig links against the LLVM API, so will never link with an incompatible version.

@jacobly0 jacobly0 closed this as completed Apr 5, 2024
@jacobly0 jacobly0 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question No questions on the issue tracker, please.
Projects
None yet
Development

No branches or pull requests

3 participants