-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running rustc -V binary on SailfishOS 2.0.1.11 (Taalojärvi) (armv7hl) raised Exception #33483
Comments
If it doesn't happen with the If it still does, run the command in gdb and post the backtrace. |
[root@Jolla ~]# cat /proc/cpuinfo processor : 1 Features : swp half thumb fastmult vfp edsp neon vfpv3 tls Hardware : QCT MSM8930 CDP I've installed Nightly Build:
When I try to run lustc -V or what ever I get this: [88921.186346] Pid: 32077, comm: rustc |
[root@Jolla ~]# rustc --help |
(gdb) run Program received signal SIGSEGV, Segmentation fault. |
Two questions:
|
I've tried also yesterday compiling from rustc-nightly source on my Jolla phone. . |
I also tried to build from git and I got the same output: |
This answers my first question, and from the trace you provided it seems the crash happens very early, probably still in the dynamic loader. That's why I asked you about your Did you try running |
root@Jolla rust]# root@Jolla rust]# root@Jolla rust]# |
Now you're talking! It's a recent distro with glibc 2.19 - you should be able to try out my stage0 snapshot or some unofficial builds, e.g. Rust 1.8 stable from https://github.com/warricksothr/RustBuild I recommend the stage0 binary first, it has very few dependencies. |
Great, let us know if you manage to bootstrap a full rust compiler. (or run one of the unofficial builds) If you do, the issue should be solvable, @japaric will probably have a word or two with the buildbot :) |
Today I tried again installing rust with the latest nightly build.
But if I try to run rustc, cargo or any other binary I got Segmentation fault. [10140.420203] Pid: 13401, comm: rustc [10140.443154] Pid: 13402, comm: rustc |
You could try some unofficial builds. This one doesn't link in libstdc++ statically: https://www.dropbox.com/s/esfhr8erg8kyhoe/rust-nightly-armv7.tar.xz?dl=0 or one from Rustbuild, built with clang: |
Installing with [root@Jolla tmp]# Welcome to Rust! This will download and install the official compiler for the Rust programming It will add the cargo, rustc, rustup and other commands to Cargo's bin /root/.cargo/bin This path will then be added to your PATH environment variable by modifying the /root/.profile You can uninstall at any time with rustup self uninstall and these changes will WARNING: This is beta software. Current installation options:
modify PATH variable: yes
I'm going to ask you the value of each these installation options. Default toolchain? (stable/beta/nightly) Modify PATH variable? (y/n) Current installation options:
modify PATH variable: yes
info: syncing channel updates for 'nightly-armv7-unknown-linux-gnueabihf' nightly installed - (error reading rustc version) Rust is installed now. Great! To get started you need Cargo's bin directory in your PATH environment variable. To configure your current shell run source $HOME/.cargo/env. I've cleared dmesg [11972.610650] Pid: 19355, comm: rustc [root@Jolla tmp]# |
So, your hardware is a Qualcomm Snapdragon MSM8930 SoC - do you know of any quirks/bugs related to vfpv3 or neon it might be affected with? A rebuild of your linux kernel could be necessary. |
Yes, It's Jolla Phone (https://en.wikipedia.org/wiki/Jolla_(smartphone), with Qualcomm Snapdragon 400 1.4 GHz dual-core processor. |
That kernel is old and probably heavily patched so let's make sure you can't run any rust binaries, ok? Please try a different build from the above links. If nothing works, you'd already confirmed my last stage0 snapshot worked (good for bootstrapping |
Found this: |
Yes, I would like to build it, I already tried a few time, but unsuccessfully. |
Do you remember why it failed? Provided you were trying to use the snapshot I'd uploaded, did you do something like this? wget https://static.rust-lang.org/dist/rustc-beta-src.tar.gz
tar xvf rustc-beta-src.tar.gz
cd rustc-beta
./configure --enable-optimize --disable-jemalloc --llvm-root=/usr --disable-docs --enable-local-rust --local-rust-root=/tmp --prefix=~/rust-beta-1.10 --build=armv7-unknown-linux-gnueabihf
make -j2
make install If you don't have LLVM installed, remove |
It always failed as I mentioned in earlier posts like this
|
@petevine rust-nightly-armv7.tar.xz is working, on my Jolla Phone 👍 |
@petevine
Now, everything is working! [root@Jolla lib]# |
Yes, I encountered this error in the past too (it means your llvm was compiled with clang, there's an issue about it in this very repo) but it was never addressed. At that time, and I needed to do it just once, I removed that flag from the g++ command line - you can see the full command by running:
Let me repeat; to successfully build the |
@corvinux I can see you've got |
@petevinem, Still errors, [root@Jolla rustc-beta]# |
@petevine Here is all output http://paste2.org/pxBVOyVU. |
It seems the correct snapshot is being used and it even managed to compile a few crates but you're still using |
@petevine Whole output here http://paste2.org/gn8p6zJE |
Maybe $ If that doesn't help, I'll post a workaround. |
@petevine
All ouput http://paste2.org/VUE8Ip0y |
The error is not related to the gcc version but a switch specific to clang that's injected from Rename your /usr/local/bin/llvm-config.orig "$@" | sed s/-Wcovered-switch-default// Now it should start working with |
@petevine |
@petevine |
@corvinux We'll need the last part from |
@petevine It was my mistake,sorry. I was manually copying LLVM structure to /usr/local/include and I have mistakenly copy include into /usr/local/include/include. Now i get this error: Again output here: http://paste2.org/sL3W97XG |
OK, as promised, the llvm wrapper compiles fine now. @corvinux Please, just type EDIT: |
@petevine |
Strange, maybe it was necessary to If you're really motivated to see the bootstrap process finish, try copy/pasting the 4 commands minus g++ -O2 -Wall -g -fPIC -D__arm__ -march=armv7-a -fno-rtti -c -o armv7-unknown-linux-gnueabihf/rustllvm/ExecutionEngineWrapper.o -I//usr//local//include -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_COMPONENT_AARCH64 -DLLVM_COMPONENT_AARCH64ASMPARSER -DLLVM_COMPONENT_AARCH64ASMPRINTER -DLLVM_COMPONENT_AARCH64CODEGEN -DLLVM_COMPONENT_AARCH64DESC -DLLVM_COMPONENT_AARCH64DISASSEMBLER -DLLVM_COMPONENT_AARCH64INFO -DLLVM_COMPONENT_AARCH64UTILS -DLLVM_COMPONENT_ALL -DLLVM_COMPONENT_ALL_TARGETS -DLLVM_COMPONENT_AMDGPU -DLLVM_COMPONENT_AMDGPUASMPARSER -DLLVM_COMPONENT_AMDGPUASMPRINTER -DLLVM_COMPONENT_AMDGPUCODEGEN -DLLVM_COMPONENT_AMDGPUDESC -DLLVM_COMPONENT_AMDGPUINFO -DLLVM_COMPONENT_AMDGPUUTILS -DLLVM_COMPONENT_ANALYSIS -DLLVM_COMPONENT_ARM -DLLVM_COMPONENT_ARMASMPARSER -DLLVM_COMPONENT_ARMASMPRINTER -DLLVM_COMPONENT_ARMCODEGEN -DLLVM_COMPONENT_ARMDESC -DLLVM_COMPONENT_ARMDISASSEMBLER -DLLVM_COMPONENT_ARMINFO -DLLVM_COMPONENT_ASMPARSER -DLLVM_COMPONENT_ASMPRINTER -DLLVM_COMPONENT_BITREADER -DLLVM_COMPONENT_BITWRITER -DLLVM_COMPONENT_BPF -DLLVM_COMPONENT_BPFASMPRINTER -DLLVM_COMPONENT_BPFCODEGEN -DLLVM_COMPONENT_BPFDESC -DLLVM_COMPONENT_BPFINFO -DLLVM_COMPONENT_CODEGEN -DLLVM_COMPONENT_CORE -DLLVM_COMPONENT_CPPBACKEND -DLLVM_COMPONENT_CPPBACKENDCODEGEN -DLLVM_COMPONENT_CPPBACKENDINFO -DLLVM_COMPONENT_DEBUGINFOCODEVIEW -DLLVM_COMPONENT_DEBUGINFODWARF -DLLVM_COMPONENT_DEBUGINFOPDB -DLLVM_COMPONENT_ENGINE -DLLVM_COMPONENT_EXECUTIONENGINE -DLLVM_COMPONENT_HEXAGON -DLLVM_COMPONENT_HEXAGONASMPARSER -DLLVM_COMPONENT_HEXAGONCODEGEN -DLLVM_COMPONENT_HEXAGONDESC -DLLVM_COMPONENT_HEXAGONDISASSEMBLER -DLLVM_COMPONENT_HEXAGONINFO -DLLVM_COMPONENT_INSTCOMBINE -DLLVM_COMPONENT_INSTRUMENTATION -DLLVM_COMPONENT_INTERPRETER -DLLVM_COMPONENT_IPO -DLLVM_COMPONENT_IRREADER -DLLVM_COMPONENT_LIBDRIVER -DLLVM_COMPONENT_LINEEDITOR -DLLVM_COMPONENT_LINKER -DLLVM_COMPONENT_LTO -DLLVM_COMPONENT_MC -DLLVM_COMPONENT_MCDISASSEMBLER -DLLVM_COMPONENT_MCJIT -DLLVM_COMPONENT_MCPARSER -DLLVM_COMPONENT_MIPS -DLLVM_COMPONENT_MIPSASMPARSER -DLLVM_COMPONENT_MIPSASMPRINTER -DLLVM_COMPONENT_MIPSCODEGEN -DLLVM_COMPONENT_MIPSDESC -DLLVM_COMPONENT_MIPSDISASSEMBLER -DLLVM_COMPONENT_MIPSINFO -DLLVM_COMPONENT_MIRPARSER -DLLVM_COMPONENT_MSP430 -DLLVM_COMPONENT_MSP430ASMPRINTER -DLLVM_COMPONENT_MSP430CODEGEN -DLLVM_COMPONENT_MSP430DESC -DLLVM_COMPONENT_MSP430INFO -DLLVM_COMPONENT_NATIVE -DLLVM_COMPONENT_NATIVECODEGEN -DLLVM_COMPONENT_NVPTX -DLLVM_COMPONENT_NVPTXASMPRINTER -DLLVM_COMPONENT_NVPTXCODEGEN -DLLVM_COMPONENT_NVPTXDESC -DLLVM_COMPONENT_NVPTXINFO -DLLVM_COMPONENT_OBJCARCOPTS -DLLVM_COMPONENT_OBJECT -DLLVM_COMPONENT_OPTION -DLLVM_COMPONENT_ORCJIT -DLLVM_COMPONENT_PASSES -DLLVM_COMPONENT_POWERPC -DLLVM_COMPONENT_POWERPCASMPARSER -DLLVM_COMPONENT_POWERPCASMPRINTER -DLLVM_COMPONENT_POWERPCCODEGEN -DLLVM_COMPONENT_POWERPCDESC -DLLVM_COMPONENT_POWERPCDISASSEMBLER -DLLVM_COMPONENT_POWERPCINFO -DLLVM_COMPONENT_PROFILEDATA -DLLVM_COMPONENT_RUNTIMEDYLD -DLLVM_COMPONENT_SCALAROPTS -DLLVM_COMPONENT_SELECTIONDAG -DLLVM_COMPONENT_SPARC -DLLVM_COMPONENT_SPARCASMPARSER -DLLVM_COMPONENT_SPARCASMPRINTER -DLLVM_COMPONENT_SPARCCODEGEN -DLLVM_COMPONENT_SPARCDESC -DLLVM_COMPONENT_SPARCDISASSEMBLER -DLLVM_COMPONENT_SPARCINFO -DLLVM_COMPONENT_SUPPORT -DLLVM_COMPONENT_SYMBOLIZE -DLLVM_COMPONENT_SYSTEMZ -DLLVM_COMPONENT_SYSTEMZASMPARSER -DLLVM_COMPONENT_SYSTEMZASMPRINTER -DLLVM_COMPONENT_SYSTEMZCODEGEN -DLLVM_COMPONENT_SYSTEMZDESC -DLLVM_COMPONENT_SYSTEMZDISASSEMBLER -DLLVM_COMPONENT_SYSTEMZINFO -DLLVM_COMPONENT_TABLEGEN -DLLVM_COMPONENT_TARGET -DLLVM_COMPONENT_TRANSFORMUTILS -DLLVM_COMPONENT_VECTORIZE -DLLVM_COMPONENT_X86 -DLLVM_COMPONENT_X86ASMPARSER -DLLVM_COMPONENT_X86ASMPRINTER -DLLVM_COMPONENT_X86CODEGEN -DLLVM_COMPONENT_X86DESC -DLLVM_COMPONENT_X86DISASSEMBLER -DLLVM_COMPONENT_X86INFO -DLLVM_COMPONENT_X86UTILS -DLLVM_COMPONENT_XCORE -DLLVM_COMPONENT_XCOREASMPRINTER -DLLVM_COMPONENT_XCORECODEGEN -DLLVM_COMPONENT_XCOREDESC -DLLVM_COMPONENT_XCOREDISASSEMBLER -DLLVM_COMPONENT_XCOREINFO -I /usr/local/include -I /root/tmp/rustc-beta/src/rustllvm/include /root/tmp/rustc-beta/src/rustllvm/ExecutionEngineWrapper.cpp followed by a rerun of |
@corvinux To fix the #!/bin/bash
/usr/local/bin/llvm-config.orig "$@" | sed s/-Wcovered-switch-default// |
@petevine, shebang was OK.
I find this Golevka/emacs-clang-complete-async#37, |
You should be able to use |
@petevine |
@corvinux Thanks, great job! That was the purpose of this whole exercise, i.e. to prove rustc bootstrapped on your own machine could actually run. And it seems you managed to produce a On my own machine the command looks like this (I've inserted CFG_LLVM_LINKAGE_FILE=/tmp/rust-master/arm-unknown-linux-gnueabihf/rt/llvmdeps.rs LD_LIBRARY_PATH=/tmp/rust-master/arm-unknown-linux-gnueabihf/stage1/lib:/tmp/rust-master/arm-unknown-linux-gnueabihf/llvm/Release/lib:$LD_LIBRARY_PATH gdb --args arm-unknown-linux-gnueabihf/stage1/bin/rustc --cfg stage1 -C codegen-units=1 -Z orbit -C target-feature=+neon,+vfp4,-slowfpvmlx -C link-args="-s" -O --cfg rtopt -C rpath -C prefer-dynamic --target=arm-unknown-linux-gnueabihf -C target-feature=+v7,+vfp3 -L "arm-unknown-linux-gnueabihf/rt" -L native="/tmp/rust-master/arm-unknown-linux-gnueabihf/llvm/Release/lib" --out-dir arm-unknown-linux-gnueabihf/stage1/lib/rustlib/arm-unknown-linux-gnueabihf/lib -C extra-filename=-fe3cdf61 -C metadata=fe3cdf61 src/libcore/lib.rs Please explain how you solved the |
@petevine, regarding solving the |
@corvinux If your own bootstrapped Does the official distribution still segfault? |
@corvinux In case you still need it, there's a work-around for this bug. See the linked thread above. |
@petevine, That's great, Now you are talking :), thank you very much fot this. |
Well, this issue is closed, here are no crashes anymore. But no one still has been able to run rustc or cargo inside a target: https://users.rust-lang.org/t/running-rustc-cargo-within-scratchbox2-application-freeze/7879 This prevents anyone from using rust on the phone. |
LOG of whole installation process, running script curl https://sh.rustup.rs -sSf | sh as suggested on https://www.rustup.rs/ is here http://paste2.org/y23WWxCA,
This is output from journalctrl -f regarding running rustc -V in bash cli
May 07 18:55:24 Jolla kernel: rustc (13431): undefined instruction: pc=402c8d68
May 07 18:55:24 Jolla kernel: Code: e320f000 e320f000 f2200150 e12fff1e (ec510f1e)
May 07 18:55:24 Jolla kernel: rustc(13431) send signal 4 to rustc(13431)
May 07 18:55:24 Jolla kernel: rustc: unhandled page fault (11) at 0xbe8ce5fc, code 0x805
May 07 18:55:24 Jolla kernel: pgd = e4fc0000
May 07 18:55:24 Jolla kernel: [be8ce5fc] *pgd=00000000
May 07 18:55:24 Jolla kernel: May 07 18:55:24 Jolla kernel: Pid: 13432, comm: rustc
May 07 18:55:24 Jolla kernel: CPU: 0 Tainted: P W O (3.4.108.20150901.1 #1)
May 07 18:55:24 Jolla kernel: PC is at 0x400aedf0
May 07 18:55:24 Jolla kernel: LR is at 0x400a0e61
May 07 18:55:24 Jolla kernel: pc : [<400aedf0>] lr : [<400a0e61>] psr: 60070030
sp : be8ce600 ip : beacecec fp : beacef1c
May 07 18:55:24 Jolla kernel: r10: 0020061a r9 : 400b1494 r8 : beacee7c
May 07 18:55:24 Jolla kernel: r7 : beacec38 r6 : beacee44 r5 : be8ce610 r4 : beacef1c
May 07 18:55:24 Jolla kernel: r3 : 00000004 r2 : 00000000 r1 : 00163780 r0 : 00000003
May 07 18:55:24 Jolla kernel: Flags: nZCv IRQs on FIQs on Mode USER_32 ISA Thumb Segment user
May 07 18:55:24 Jolla kernel: Control: 10c5787d Table: a51c006a DAC: 00000015
May 07 18:55:24 Jolla kernel: from
May 07 18:55:24 Jolla kernel: from
May 07 18:55:24 Jolla kernel: from
May 07 18:55:24 Jolla kernel: from
May 07 18:55:24 Jolla kernel: Exception stack(0xc4543fb0 to 0xc4543ff8)
May 07 18:55:24 Jolla kernel: 3fa0: 00000003 00163780 00000000 00000004
May 07 18:55:24 Jolla kernel: 3fc0: beacef1c be8ce610 beacee44 beacec38 beacee7c 400b1494 0020061a beacef1c
May 07 18:55:24 Jolla kernel: 3fe0: beacecec be8ce600 400a0e61 400aedf0 60070030 ffffffff
May 07 18:55:24 Jolla kernel: rustc(13432) send signal 11 to rustc(13432)
The text was updated successfully, but these errors were encountered: