Closed MoonlightSentinel closed 2 years ago
I would suspect its an issue with Espressif's LLVM fork.
Have you tried doing a minimisation of the .ll
file to see exactly what crashes? e.g. I suspect the metadata (!llvm.ident
, etc ,!0
, etc) can be removed and still reproduce the crash.
Reduced LL file:
; ModuleID = './object.d'
source_filename = "./object.d"
target datalayout = "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-f64:64-a:0:32-n32"
target triple = "xtensa-esp32--elf"
%object.ModuleInfo = type {}
define void @func(%object.ModuleInfo* byval align 4 %_param_0) {
ret void
}
llvm-xtensa/bin/llc -mcpu=esp32 object-full.ll
Formal argument #0 has unhandled type i32
UNREACHABLE executed at ldc-esp32/source/llvm-xtensa/lib/CodeGen/CallingConvLower.cpp:99!
[...]
That looks like a perfectly reasonable thing to compile. Best file it upstream.
Yep, looks like an issue of that fork to me too - does it work without the align 4
? Also looks like you're not using the latest version: https://github.com/espressif/llvm-project/blob/xtensa_release_13.0.0/llvm/lib/CodeGen/CallingConvLower.cpp#L98
You're right, apparently built LDC against an outdated version. The current HEAD works AFAICT. Thanks!
Preface: Currently trying to use LDC built against Espressif's LLVM fork to target an ESP32 (because their patches are yet to be accepted into the upstream repository...). AFAICT
xtensa
isn't officially supported, so feel free to close this issue.The following reduced example fails to compile without
-betterC
:With
-betterC
Without
-betterC
Diff:
Not sure if this is an issue with LDC or Espressif's fork...