Page MenuHome GnuPG

rijndael implementation contains ambiguos instructions
Closed, ResolvedPublic

Description

When compiling libgcrypt with clang it fails with the following (--disable-asm and
--disable-optimization have been passed to configure).

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDK
s/MacOSX10.7.sdk -mmacosx-version-min=10.7 -ggdb3 -m32 -arch i386 -fheinous-gnu-
extensions -Wall -MT rfc2268.lo -MD -MP -MF .deps/rfc2268.Tpo -c rfc2268.c -fno-
common -DPIC -o .libs/rfc2268.o
rijndael.c:846:46: error: ambiguous instructions require an explicit suffix (could
be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')

"movdqa 0xa0(%%esi), %%xmm1\n\t"
                             ^

<inline asm>:24:2: note: instantiated into assembly here

cmp $10, -36(%ebp)
^

rijndael.c:852:46: error: ambiguous instructions require an explicit suffix (could
be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')

"movdqa 0xc0(%%esi), %%xmm1\n\t"
                             ^

<inline asm>:30:2: note: instantiated into assembly here

cmp $12, -36(%ebp)
^

rijndael.c:863:39: error: ambiguous instructions require an explicit suffix (could
be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')

"pxor %%xmm1, %%xmm0\n\t"        /* xmm0 = input ^ IV  */
                      ^

<inline asm>:40:2: note: instantiated into assembly here

cmp $1, -16(%ebp)
^

clang: warning: argument unused during compilation: '-ggdb3'
clang: warning: argument unused during compilation: '-ggdb3'
rijndael.c:1052:46: error: ambiguous instructions require an explicit suffix
(could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')

"movdqa 0xa0(%%esi), %%xmm1\n\t"
                             ^

<inline asm>:70:2: note: instantiated into assembly here

cmp $10, -36(%ebp)
^

rijndael.c:1064:46: error: ambiguous instructions require an explicit suffix
(could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')

"movdqa 0xc0(%%esi), %%xmm1\n\t"
                             ^

<inline asm>:82:2: note: instantiated into assembly here

cmp $12, -36(%ebp)
^

rijndael.c:925:46: error: ambiguous instructions require an explicit suffix (could
be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')

"movdqa 0xa0(%%esi), %%xmm1\n\t"
                             ^

<inline asm>:31:2: note: instantiated into assembly here

cmp $10, -36(%ebp)
^

rijndael.c:931:46: error: ambiguous instructions require an explicit suffix (could
be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')

"movdqa 0xc0(%%esi), %%xmm1\n\t"
                             ^

<inline asm>:37:2: note: instantiated into assembly here

cmp $12, -36(%ebp)
^

Details

Version
1.5.0

Event Timeline

werner added a subscriber: werner.

That code is only used if compiled by GCC (GNUC >= 4). Now if clang
pretends to be gcc, it needs to make sure to be 100% compatible with gcc.

werner claimed this task.
werner added a project: clang.