odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.13k stars 551 forks source link

LLVM string assert failure #3869

Closed Falconerd closed 2 days ago

Falconerd commented 3 days ago

Context

Bill says LLVM 14 isn't supported, but the website says it is. Either way I'll post a bug report for you.

Expected Behavior

Compiled program

Current Behavior

Error on build/run

Failure Information (for bugs)

$ odin run main.odin -file
src/llvm_backend_const.cpp(179): Assertion Failure: `elem_type == LLVMTypeOf(values[i])` { [2 x %..string]*, i64 } != { %..string*, i64 }
Illegal instruction

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. sudo apt get install clang llvm
  2. git clone git@github.com:odin-lang/Odin
  3. cd Odin
  4. make OR ./build_odin.sh
  5. Create file with string:
    
    package main

import "core:fmt"

main :: proc() { fmt.println("Testing testing...") }


6. `odin run main.odin -file`
Falconerd commented 3 days ago

I've also tried with LLVM 13 and LLVM 12 and get the same result. I assume this error is from the tests that run when building Odin:

falconerd@DESKTOP-8U0CI5I:~/Odin$ make
./build_odin.sh debug
+ /usr/lib/llvm-12/bin/clang++ src/main.cpp src/libtommath.cpp -Wno-switch -Wno-macro-redefined -Wno-unused-value -DODIN_VERSION_RAW="dev-2024-07" -DGIT_SHA="053f1759d" -std=c++14 -I/usr/lib/llvm-12/include -std=c++14 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -L/usr/lib/llvm-12/lib -g -pthread -lm -lstdc++ -ldl /usr/lib/llvm-12/lib/libLLVM-12.so -Wl,-rpath=$ORIGIN -o odin
+ set +x
src/llvm_backend_const.cpp(179): Assertion Failure: `elem_type == LLVMTypeOf(values[i])` { [3 x %..string]*, i64 } != { %..string*, i64 }
Illegal instruction
make: *** [Makefile:10: debug] Error 132
pure-machinery commented 3 days ago

Can confirm, happens to me as well.

hastiin-manuelito commented 2 days ago

Also experiencing this problem.

Falconerd commented 2 days ago

Hey, some more info: I got word from a user that LLVM 18 is working image