Bitcoin Forum
August 21, 2017, 02:37:34 PM *
News: Latest stable version of Bitcoin Core: 0.14.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [PATCH] bitcoin build fix, for new GNU assembler  (Read 1501 times)
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
December 07, 2010, 06:15:50 AM
 #1

After upgrading to Fedora 14 (GNU assembler 2.20.51.0.7-5.fc14 20100318), the bitcoin build fails as follows:
Code:
cryptopp/sha.cpp: Assembler messages:
cryptopp/sha.cpp:436: Error: junk at end of line, first unrecognized character is `1'
cryptopp/sha.cpp:436: Error: backward ref to unknown label "1:"

The assembler code in bitcoin has not changed in recent commits, so the root cause pointed to the Fedora upgrade.  Apparently, current releases of GNU assembler do not like overly long lines created by the assembler macros in cryptopp/cpu.h + cryptopp/sha.cpp.  The fix is simple: add newlines to the assembler macros in cryptopp/cpu.h.  Arguably the semi-colon line terminator is redundant when a real newline is added, but I'm posting what worked for me.  This problem (and fix) impacts upstream Crypto++ also.

Here are three possible fixes, pick the one you like best.

alt1) Update bitcoin's cryptopp/cpu.h to upstream Crypto++ version.  This is 100% upstream changes, with nothing from me.
     http://yyz.us/bitcoin/patch.bitcoin-asmfix1
then apply newline build fix for new GNU assembler.
     http://yyz.us/bitcoin/patch.bitcoin-asmfix2

alt2) Alternately, here is the newline build fix without an update to latest upstream Crypto++, aka the minimal bitcoin build fix.
     http://yyz.us/bitcoin/patch.bitcoin-asmfix-minimal

alt3) Alternately, here is the newline build fix without an update to latest upstream Crypto++, with the semi-colons removed:
     http://yyz.us/bitcoin/patch.bitcoin-asmfix-nl-only

There Smiley  Pick your favorite patch.

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
1503326254
Hero Member
*
Offline Offline

Posts: 1503326254

View Profile Personal Message (Offline)

Ignore
1503326254
Reply with quote  #2

1503326254
Report to moderator
1503326254
Hero Member
*
Offline Offline

Posts: 1503326254

View Profile Personal Message (Offline)

Ignore
1503326254
Reply with quote  #2

1503326254
Report to moderator
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. Advertise here.
1503326254
Hero Member
*
Offline Offline

Posts: 1503326254

View Profile Personal Message (Offline)

Ignore
1503326254
Reply with quote  #2

1503326254
Report to moderator
1503326254
Hero Member
*
Offline Offline

Posts: 1503326254

View Profile Personal Message (Offline)

Ignore
1503326254
Reply with quote  #2

1503326254
Report to moderator
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
December 08, 2010, 01:24:02 AM
 #2

This problem has now been fixed in upstream binutils, and trickled down to Fedora.

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!