Author

Topic: Building for Raspberry Pi: Illegal instruction. (Read 609 times)

full member
Activity: 159
Merit: 100
September 25, 2017, 10:55:27 AM
#11
Ah!  I must have been half asleep reading the Armory instructions to miss this Smiley

Will try it out.
member
Activity: 270
Merit: 36
Good point.  But since building with an older cross-compiler that I successfully used to build an older version of Armory still results in the "Illegal instruction" stuff, that could indicate that it is assembler code in the crypto library that causes the failure.  That the failure occurs at startup provides some evidence that the problem is not in said library, though.

I hope to get the new RPi today or tomorrow, but I will try a rebuild with the official cross-compiler if I get the time today.


EDIT:
The official cross compiler contains no installation instructions, no normal github releases, and no hints about how to use it.  I could perhaps work it out myself in a day or two, but I think I will just wait for the newer RPi.

Various web pages let me to believe that it could very well be the compiler, apparently the RPi 1 contains an older ARM cpu that the normal cross compiler does not support.

Again, up to you but the rpi readme on the armory repo covers it. Literally just need to clone or grab a zip of the repo to extract it then follow step 2 to set up the path and so on as usual. gcc-linaro-arm-linux-gnueabihf-raspbian-x64 for x64 host and gcc-linaro-arm-linux-gnueabihf-raspbian if not.
No worries if you're not going to use it, but just wanted an answer to at least appear in search.
full member
Activity: 159
Merit: 100
As far as I know, that official cross compiler supports all rpi models - so it might work with your current 1B. Something you could try while waiting for the new model? Up to you, of course.

Good point.  But since building with an older cross-compiler that I successfully used to build an older version of Armory still results in the "Illegal instruction" stuff, that could indicate that it is assembler code in the crypto library that causes the failure.  That the failure occurs at startup provides some evidence that the problem is not in said library, though.

I hope to get the new RPi today or tomorrow, but I will try a rebuild with the official cross-compiler if I get the time today.


EDIT:
The official cross compiler contains no installation instructions, no normal github releases, and no hints about how to use it.  I could perhaps work it out myself in a day or two, but I think I will just wait for the newer RPi.

Various web pages let me to believe that it could very well be the compiler, apparently the RPi 1 contains an older ARM cpu that the normal cross compiler does not support.
member
Activity: 270
Merit: 36
I can now confirm that it is a question of the age of the RPi (mine is a model 1 B).  I borrowed a model 3 B, and moved the SD card over in it; Armory then started perfectly.  I have ordered my own 3B now.

Any reason you're not using the official rpi cross compiler?

Yes: I was not aware of it Smiley

But the gcc cross compiler has been working previously for me.


As far as I know, that official cross compiler supports all rpi models - so it might work with your current 1B. Something you could try while waiting for the new model? Up to you, of course.
full member
Activity: 159
Merit: 100
I can now confirm that it is a question of the age of the RPi (mine is a model 1 B).  I borrowed a model 3 B, and moved the SD card over in it; Armory then started perfectly.  I have ordered my own 3B now.

Any reason you're not using the official rpi cross compiler?

Yes: I was not aware of it Smiley

But the gcc cross compiler has been working previously for me.
member
Activity: 270
Merit: 36
I followed these instructions: https://github.com/goatpig/BitcoinArmory/tree/master/r-pi
with the exception that I broke up the line
Code:
sh autogen.sh ./configure --host=arm-linux-gnueabihf
into two, and added a --prefix.

I installed the cross-compiler using
Code:
sudo apt-get install g++-arm-linux-gnueabihf

Note that I do not think my Pi is a model 2, as I remember I bought it shortly before model 2 was released. Smiley
Maybe there is a difference.  Or maybe it is because I cross-compiled on a brand new virtual lubuntu.  I have just built it on the same old vm I think I used for the previous version, will try it out tonight.
Any reason you're not using the official rpi cross compiler?
full member
Activity: 159
Merit: 100
I followed these instructions: https://github.com/goatpig/BitcoinArmory/tree/master/r-pi
with the exception that I broke up the line
Code:
sh autogen.sh ./configure --host=arm-linux-gnueabihf
into two, and added a --prefix.

I installed the cross-compiler using
Code:
sudo apt-get install g++-arm-linux-gnueabihf

Note that I do not think my Pi is a model 2, as I remember I bought it shortly before model 2 was released. Smiley
Maybe there is a difference.  Or maybe it is because I cross-compiled on a brand new virtual lubuntu.  I have just built it on the same old vm I think I used for the previous version, will try it out tonight.


legendary
Activity: 3766
Merit: 1364
Armory Developer
I'm using cross compiled builds of 0.96.2 with my Pi2 and it works just fine. What instructions did you follow? You shouldn't use march=armv7, the actual arch of a Pi is armhf (hard float).
full member
Activity: 159
Merit: 100
I think goatpig has talked about how Crypto++ has some issues with assembly code. I can imagine so based off of my experience with it. (Newer versions should fix this problem but, for various reasons, upgrading isn't feasible just yet.) There could be something subtle happening with the build process.

Question: Can you get 0.95.1 to run? There should be a tag for it on Github. I believe that was the last version with the original(-ish) Crypto++ build process, before goatpig added Automake and such. If that works, try 0.96. If that doesn't work, there's your answer.

Thanks, I'll try.  Unfortunately, 0.95.1 is not useful to me since it cannot sign BCH.  But if that is the case, I'll get a newer R-Pi (unless the problem is i686 assembler code!)

sr. member
Activity: 525
Merit: 282
I think goatpig has talked about how Crypto++ has some issues with assembly code. I can imagine so based off of my experience with it. (Newer versions should fix this problem but, for various reasons, upgrading isn't feasible just yet.) There could be something subtle happening with the build process.

Question: Can you get 0.95.1 to run? There should be a tag for it on Github. I believe that was the last version with the original(-ish) Crypto++ build process, before goatpig added Automake and such. If that works, try 0.96. If that doesn't work, there's your answer.
full member
Activity: 159
Merit: 100
Hi,

I have previously built Armory for the Raspberry Pi using the instructions on the git.  I think it was version 0.93.3.  Now I need 0.96.2 so I can get my BCH out of the wallet, and I would prefer not to export private keys as I plan on keeping by BTC there (making a new Armory wallet is easy - getting the 3-of-5 backup distributed requires some logistics. Smiley )

Anyway, I compiled on an up-to-date lubuntu with the RPi cross compiler (comes as a package).  Moved it to a newly installed RPi.  If I use a Raspbian based on Debian Jessie then there is a GLIBC version mismatch, using the just released Raspbian based on Stretch does not have this problem.  But as Armory starts up, it crashes (before the splash screen) with an "Illegal instruction".

My RPi is really old, it was the first (or maybe second) model, and has a version 7 ARM cpu.  I tried recompiling with -march=armv7, but that did not help.  Does Armory contain some assembler code or the like that depends on a newer ARM CPU, or does a modern GCC just generate too new code?

I guess I could buy a new RPi.  Or does anyone else have a suggestion.
Jump to: