Home GnuPG

Fix building with Clang on x86-64 and i386
99e272d938feUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Fix building with Clang on x86-64 and i386

* cipher/rijndael.c [USE_AESNI] (do_aesni_enc_aligned)
(do_aesni_dec_vec4, do_aesni_cfb, do_aesni_ctr, do_aesni_ctr_4): Add
explicit suffix to 'cmp' instructions.

Clang throws errors on missing instruction suffixes, such as:

rijndael.c:1091:39: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')
<inline asm>:39:2: note: instantiated into assembly here

cmp $1, -44(%rbp)

With this patch building on x86-64 works fine. Other issues still exists on i386,
namely with MPI, which can be overcome with 'clang -fheinous-gnu-extensions'.

[v2]:

  • remove do_aesni_enc_vec4 modification as that function didn't make it to upstream.

NB: I still believe it is a bad idea of clang to define GNUC
and not being 100% compatible to gcc. [wk]

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>

Details

Provenance
jukiviliAuthored on Nov 27 2012, 10:44 PM
wernerCommitted on Nov 28 2012, 9:35 AM
Parents
rCfaec12e23f03: Optimize wipememory2 for i386 and x86-64
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rC99e272d938fe: Fix building with Clang on x86-64 and i386 (authored by Jussi Kivilinna <jussi.kivilinna@mbnet.fi>).Nov 28 2012, 9:35 AM