Bitcoin Forum
October 09, 2024, 12:26:15 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [PATCH] bitcoin build fix, for new GNU assembler  (Read 1661 times)
jgarzik (OP)
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1099


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, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
jgarzik (OP)
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1099


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, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
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!