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

[ENH] Support for llvm 19 #4439

Open
0dminnimda opened this issue Oct 31, 2024 · 1 comment · May be fixed by #4440
Open

[ENH] Support for llvm 19 #4439

0dminnimda opened this issue Oct 31, 2024 · 1 comment · May be fixed by #4440

Comments

@0dminnimda
Copy link
Contributor

0dminnimda commented Oct 31, 2024

Some package mamagers do not provide a way to downgrade. When trying to compile odin I get this error

$ ./build_odin.sh release-native
ERROR: Invalid LLVM version 19.1.2: must be 11, 12, 13, 14, 17 or 18

After I remove version check from the script, I get this:

In file included from src/main.cpp:88:
In file included from src/llvm_backend.cpp:19:
src/llvm_backend_debug.cpp:1099:2: error: use of undeclared identifier 'LLVMDIBuilderInsertDeclareAtEnd'; did you mean 'LLVMDIBuilderInsertDeclareRecordAtEnd'?
 1099 |         LLVMDIBuilderInsertDeclareAtEnd(m->debug_builder, storage, var_info, llvm_expr, llvm_debug_loc, block);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         LLVMDIBuilderInsertDeclareRecordAtEnd
/data/data/com.termux/files/usr/include/llvm-c/DebugInfo.h:1300:18: note: 'LLVMDIBuilderInsertDeclareRecordAtEnd' declared here
 1300 | LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordAtEnd(
      |                  ^
In file included from src/main.cpp:88:
In file included from src/llvm_backend.cpp:19:
src/llvm_backend_debug.cpp:1163:2: error: use of undeclared identifier 'LLVMDIBuilderInsertDeclareAtEnd'; did you mean 'LLVMDIBuilderInsertDeclareRecordAtEnd'?
 1163 |         LLVMDIBuilderInsertDeclareAtEnd(m->debug_builder, storage, var_info, llvm_expr, llvm_debug_loc, block->block);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         LLVMDIBuilderInsertDeclareRecordAtEnd
/data/data/com.termux/files/usr/include/llvm-c/DebugInfo.h:1300:18: note: 'LLVMDIBuilderInsertDeclareRecordAtEnd' declared here
 1300 | LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordAtEnd(
      |                  ^
In file included from src/main.cpp:88:
In file included from src/llvm_backend.cpp:23:
src/llvm_backend_expr.cpp:4597:13: error: use of undeclared identifier 'LLVMConstShl'
 4597 |                                         mask = LLVMConstShl(mask, LLVMConstInt(lit, f.bit_size, false));
      |                                                ^
src/llvm_backend_expr.cpp:4645:14: error: use of undeclared identifier 'LLVMConstShl'
 4645 |                                                 mask = LLVMConstShl(mask, LLVMConstInt(vt, mask_width, false));
      |                                                        ^

It would be nive to get odin working with llvm 19. Possibly I can work on it.

Related to termux/termux-packages#22012

@0dminnimda
Copy link
Contributor Author

  1. Replacing LLVMDIBuilderInsertDeclareAtEnd with LLVMDIBuilderInsertDeclareRecordAtEnd works just fine

  2. As can be seen in release notes:

The following functions for creating constant expressions have been removed, because the underlying constant expressions are no longer supported. Instead, an instruction should be created using the LLVMBuildXYZ APIs, which will constant fold the operands if possible and create an instruction otherwise:

  • LLVMConstICmp
  • LLVMConstFCmp
  • LLVMConstShl

@0dminnimda 0dminnimda linked a pull request Oct 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant