#LLVM Error when using -debug option

1 messages · Page 1 of 1 (latest)

violet socket
#

The compiler works fine without the -debug option, where it produces a binary i can run. But when i run it with -debug, eg "oding run . -debug" the compilation fails.

blezzing@think:~/git/odin-debug-sample$ ls
main.odin
blezzing@think:~/git/odin-debug-sample$ cat main.odin 
package main

import "core:fmt"

main :: proc() {
    fmt.println("Hello world")
}
blezzing@think:~/git/odin-debug-sample$ odin run .
Hello world
blezzing@think:~/git/odin-debug-sample$ odin run . -debug
LLVM Error:
class/union requires a filename
!103 = !DICompositeType(tag: DW_TAG_union_type, name: "union {Type_Info_Named, Type_Info_Integer, Type_Info_Rune, Type_Info_Float, Type_Info_Complex, Type_Info_Quaternion, Type_Info_String, Type_Info_Boolean, Type_Info_Any, Type_Info_Type_Id, Type_Info_Pointer, Type_Info_Multi_Pointer, Type_Info_Procedure, Type_Info_Array, Type_Info_Enumerated_Array, Type_Info_Dynamic_Array, Type_Info_Slice, Type_Info_Parameters, Type_Info_Struct, Type_Info_Union, Type_Info_Enum, Type_Info_Map, Type_Info_Bit_Set, Type_Info_Simd_Vector, Type_Info_Relative_Pointer, Type_Info_Relative_Multi_Pointer, Type_Info_Matrix, Type_Info_Soa_Pointer, Type_Info_Bit_Field}", size: 1024, align: 64, elements: !104)
class/union requires a filename
!3672 = !DICompositeType(tag: DW_TAG_union_type, name: "bit_set[Logger_Option]", size: 16, align: 16, elements: !3673)
class/union requires a filename
!6401 = !DICompositeType(tag: DW_TAG_union_type, name: "bit_set[Int_Flag]", size: 8, align: 8, elements: !6402)
class/union requires a filename
!6624 = !DICompositeType(tag: DW_TAG_union_type, name: "struct #raw_union {i: u32, f: f32}", size: 32, align: 32, elements: !6625)

I am not sure what to do about that issue. Is it something anyone here can recognize?

sturdy meteor
#

Hi, what platform and compiler version are you using?

violet socket
#

Version information (Could not post initially due to character limit):

blezzing@think:~/git/odin-debug-sample$ odin version
odin version dev-2024-05:59c33dd9f
blezzing@think:~/git/odin-debug-sample$ apt info llvm
Package: llvm
Version: 1:11.0-51~exp1
Priority: optional
Section: universe/devel
Source: llvm-defaults (0.51~exp1)
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: LLVM Packaging Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 109 kB
Depends: llvm-runtime (= 1:11.0-51~exp1), llvm-11 (>= 11~)
Download-Size: 3,892 B
APT-Manual-Installed: yes
APT-Sources: http://old-releases.ubuntu.com/ubuntu groovy/universe amd64 Packages
Description: Low-Level Virtual Machine (LLVM)
 The Low-Level Virtual Machine (LLVM) is a collection of libraries and
 tools that make it easy to build compilers, optimizers, Just-In-Time
 code generators, and many other compiler-related programs.
 .
 This is a dependency package providing the default llvm package.
blezzing@think:~/git/odin-debug-sample$ uname -a
Linux think 5.8.0-63-generic #71-Ubuntu SMP Tue Jul 13 15:59:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
#
blezzing@think:~/git/odin-debug-sample$ apt info clang
Package: clang
Version: 1:11.0-51~exp1
Priority: optional
Section: universe/devel
Source: llvm-defaults (0.51~exp1)
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: LLVM Packaging Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 23.6 kB
Depends: clang-11 (>= 11~)
Breaks: clang-3.2, clang-3.3, clang-3.4 (<< 1:3.4.2-7~exp1), clang-3.5 (<< 1:3.5~+rc1-3~exp1)
Replaces: clang (<< 3.2-1~exp2), clang-3.2, clang-3.3, clang-3.4 (<< 1:3.4.2-7~exp1), clang-3.5 (<< 1:3.5~+rc1-3~exp1)
Download-Size: 3,588 B
APT-Manual-Installed: yes
APT-Sources: http://old-releases.ubuntu.com/ubuntu groovy/universe amd64 Packages
Description: C, C++ and Objective-C compiler (LLVM based), clang binary
 Clang project is a C, C++, Objective C and Objective C++ front-end
 for the LLVM compiler. Its goal is to offer a replacement to the GNU Compiler
 Collection (GCC).
 .
 Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
 provides most of the support of C++17.
 .
 This is a dependency package providing the default clang compiler.
lament wharf
#

have you built Odin yourself or its the release version?

violet socket
#

It is built locally from a git checkout of yesterday. I can try with a released version.

lament wharf
#

im afraid we have a regression on llvm11

#

have you tried building Odin with newer versions of llvm/clang?

violet socket
#

I have not. I am sitting on an older laptop with an old Ubuntu 20.10 image of which llvm 11 is the latest in apt.
I am willing to upgrade to get around it, if you believe it is caused by the relatively old llvm distribution.

lament wharf
#

afaik you don't have to upgrade ubuntu to install newer llvm

violet socket
#

Oh, i was not aware of that. I will try it out!