[Botan-devel] Botan 64-bit on Solaris

Jack Lloyd lloyd at randombit.net
Mon Dec 15 10:19:49 EST 2008

On Mon, Dec 15, 2008 at 04:03:46PM +0100, Rickard Bondesson wrote:
> What is the easiest way of changing to binutils? Can't find a good way of telling g++ to use gas instead of as.

Hrm. It's been a while... I think you may actually have to rebuild GCC
with different configure arguments. Too much work just to work around
a bug.

You could try instead manually preprocessing and generating that
single file using gas, with the g++ generated assembly continuing to
be used with the Solaris as. I have no idea if this will actually
work, though I don't see any reason why not.

$ cpp -Ibuild/include src/hash/sha1_amd64/sha1_amd64_imp.S | gas -o build/lib/sha1_amd64_imp.o

This patch might fix it, but it's a shot in the dark:

# old_revision [6f9fdf456bf822fda3e644c6d6f3bf62f650e11a]
# patch "src/utils/asm_amd64/asm_macr.h"
#  from [5491938d24526999dcc54effb2170ff771b10a10]
#    to [7cc9a90ff9430d6938c5b1d34355c3165bb980ce]
--- src/utils/asm_amd64/asm_macr.h      5491938d24526999dcc54effb2170ff771b10a10
+++ src/utils/asm_amd64/asm_macr.h      7cc9a90ff9430d6938c5b1d34355c3165bb980ce
@@ -120,6 +120,6 @@ func_name:
 #define ROTL_IMM(REG, NUM) rol IMM(NUM), REG
 #define ROTR_IMM(REG, NUM) ror IMM(NUM), REG
-#define ADD3_IMM(TO, FROM, NUM) lea NUM(TO,FROM,1), TO
+#define ADD3_IMM(TO, FROM, NUM) leal NUM(TO,FROM,1), TO

OK with that I am really off - don't expect further responses from me
before Thursday morning (GMT-5).


More information about the botan-devel mailing list