its-pointless / julia

The Julia Language: A fresh approach to technical computing. Termux/Android
https://julialang.org/
Other
16 stars 2 forks source link

Segmentation fault when building from source #4

Open martinbiel opened 5 years ago

martinbiel commented 5 years ago

When building Julia from source in termux (on aarch64) I get a segfault when bulding the system image:

"make[2]: *** [Makefile:220: /data/data/com.termux/files/home/julia/usr/lib/julia/corecompiler.ji] Segmentation fault"

Do you have any experiences of this? Sidenote: If I install using "apt install julia" I get a working binary, but it fires a lot of ReadOnlyMemoryExceptions.

its-pointless commented 5 years ago

Regarding building julia from source I got those errors when using an unpatched llvm. There are patches applied to llvm. Install julia-llvm and set export PATH=$PREFIX/opt/julia-llvm/bin:$PATH . The patches are from deps/ in the source for julia.

ReadOnlyMemoryExceptions .. ? Depends on the code. If you can show me an example i will have a look.

martinbiel commented 5 years ago

Hm, it segfaulted at the same place. Any other pointers?

"echo $PATH
[22:56:44]/data/data/com.termux/files/usr/opt/texlive/2017/bin/custom/ /data/data/com.termux/files/usr/bin /data/data/com.termux/files/usr/bin/applets /data/data/com.termux/files/usr/opt/julia-llvm/bin/"

its-pointless commented 5 years ago

/data/data/com.termux/files/usr/opt/julia-llvm/bin Should be first not last?

its-pointless commented 5 years ago

also use ./buildjulia-termux.sh

martinbiel commented 5 years ago

Yes right: "echo $PATH
/data/data/com.termux/files/usr/opt/julia-llvm/bin/ /data/data/com.termux/files/usr/opt/texlive/2017/bin/custom/ /data/data/com.termux/files/usr/bin /data/data/com.termux/files/usr/bin/applets"

I have been using buildjulia-termux.sh throughout. Still segfaults att corecompiler.jl.

its-pointless commented 5 years ago

what is output of ldd libjulia.so ?

martinbiel commented 5 years ago

"ldd libjulia.so libm.so libcompiler_rt-termux.so libandroid-support.so libopenblas.so lbbthread.so libgfortran.so.5 libLLVM-6.0julia.so libdl.so libc.so libc++_shared.so "

martinbiel commented 5 years ago

Update: I tried building the patched llvm directly from deps/ folder (i.e. without USE_SYSTEM_LLVM:=1) and it still segfaults when building corecompiler.

its-pointless commented 5 years ago

could try using system compiler_rt. ln -sf /system/lib64/libcompiler_rt.so /data/data/com.termux/files/usr/lib/libcompiler_rt-termux.so

martinbiel commented 5 years ago

Same result I am afraid. " ldd libjulia.so.1.0 [07:17:38] libm.so libcompiler_rt.so libandroid-support.so libopenblas.so libbthread.so libgfortran.so.5 libLLVM-6.0julia.so libdl.so libc.so libc++_shared.so " "make[1]: *** [Makefile:218: /data/data/com.termux/files/home/julia/usr/lib/julia/corecompiler.ji] Segmentation fault"

robsmith11 commented 5 years ago

Anyone try a recent master? I believe Julia is now working with LLVM 8