[PATCH] bitcoin build fix, for new GNU assembler
After upgrading to Fedora 14 (GNU assembler 2.20.51.0.7-5.fc14 20100318), the bitcoin build fails as follows:
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 😊 Pick your favorite patch.