Open oikumene opened 6 months ago
Building with llvm18, I got following stack trace:
[57107] signal 6 (65543): Abort trap
in expression starting at none:0
thr_kill at /lib/libc.so.7 (unknown line)
_raise at /lib/libc.so.7 (unknown line)
abort at /lib/libc.so.7 (unknown line)
_ZN4llvm18report_fatal_errorERKNS_5TwineEb.cold at /wrkdirs/usr/ports/lang/juli
a/work/julia-1.11.0-beta1/usr/bin/../lib/libjulia-internal.so.1.11 (unknown line)
_ZN4llvm18report_fatal_errorEPKcb at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/usr/bin/../lib/libjulia-internal.so.1.11 (unknown line)
_ZN12_GLOBAL__N_117CommandLineParser9addOptionEPN4llvm2cl6OptionEPNS2_10SubCommandE at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/usr/bin/../lib/libjulia-internal.so.1.11 (unknown line)
_ZN4llvm2cl6Option11addArgumentEv at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/usr/bin/../lib/libjulia-internal.so.1.11 (unknown line)
_ZN4llvm12DebugCounter8instanceEv.part.0 at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/usr/bin/../lib/libjulia-internal.so.1.11 (unknown line)
_ZN4llvm2cl20getRegisteredOptionsERNS0_10SubCommandE at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/usr/bin/../lib/libjulia-internal.so.1.11 (unknown line)
jl_init_llvm at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/src/codegen.cpp:9965
jl_init_codegen_impl at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/src/codegen.cpp:10059
_finish_julia_init at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/src/init.c:857
jl_repl_entrypoint at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/src/jlapi.c:1053
main at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/usr/bin/julia (unknown line)
__libc_start1 at /lib/libc.so.7 (unknown line)
_start at /wrkdirs/usr/ports/lang/julia/work/julia-1.11.0-beta1/usr/bin/julia (unknown line)
Allocations: 0 (Pool: 0; Big: 0); GC: 0
LLVM 18? Julia master
doesn't even support LLVM 17 yet, v1.11 only supports LLVM 16. But I take you're trying to build Julia with an external and unsupported llvm version, which based on googling the error message
LLVM ERROR: inconsistency in registered CommandLine options
is very likely the cause of your problem.
By "llvm18", I wanted to say that I built julia with clang18. I always used llvm shipped with julia. But I looked into the wrong log file, and the above error message was built by gcc13. (building julia with clang on FreeBSD has the same problem as #52067 until recent FreeBSD-current. I will try it later)
I found this conversation. It is rather old but describes the problem I encountered.
So, there is three instance of initCommonOptions(), one in libLLVM-16jl.so, one in libjulia-codegen.so and one in libjulia-internal.so, which make initCommonOptions() called many times. The solution I took is to remove linking of static LLVM libraries from libjulia-internal.so and libjulia-codegen.so, and link libLLVM-16jl.so to libjulia-internal.so too. As libLLVM-16jl.so links all the static LLVM libraries, the code in the three libraries may call LLVM functions while initCommonOptions() is called only once in libLLVM-16jl.so.
While trying to build julia on FreeBSD stable/14, I encountered the following error and cannot resolve it.
The make argument is as below: