Bitcoin Forum
May 08, 2024, 01:21:58 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Building for Raspberry Pi: Illegal instruction.  (Read 598 times)
gangtraet (OP)
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
September 19, 2017, 06:49:58 AM
 #1

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.
Even in the event that an attacker gains more than 50% of the network's computational power, only transactions sent by the attacker could be reversed or double-spent. The network would not be destroyed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
droark
Sr. Member
****
Offline Offline

Activity: 525
Merit: 282


View Profile WWW
September 19, 2017, 07:40:44 AM
 #2

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.
gangtraet (OP)
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
September 19, 2017, 10:53:35 AM
 #3

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!)

goatpig
Moderator
Legendary
*
Offline Offline

Activity: 3668
Merit: 1347

Armory Developer


View Profile
September 19, 2017, 11:25:20 AM
 #4

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).

gangtraet (OP)
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
September 20, 2017, 07:13:56 AM
 #5

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.


PhoenixFire
Member
**
Offline Offline

Activity: 270
Merit: 36


View Profile
September 20, 2017, 02:48:32 PM
 #6

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?
gangtraet (OP)
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
September 22, 2017, 07:37:27 AM
 #7

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.
PhoenixFire
Member
**
Offline Offline

Activity: 270
Merit: 36


View Profile
September 22, 2017, 01:46:29 PM
 #8

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.
gangtraet (OP)
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
September 25, 2017, 09:16:07 AM
Last edit: September 25, 2017, 10:12:25 AM by gangtraet
 #9

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.
PhoenixFire
Member
**
Offline Offline

Activity: 270
Merit: 36


View Profile
September 25, 2017, 02:03:49 PM
 #10

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.
gangtraet (OP)
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
September 25, 2017, 03:55:27 PM
 #11

Ah!  I must have been half asleep reading the Armory instructions to miss this Smiley

Will try it out.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!