Asm portability problems on OS X and Solaris

Jussi Kivilinna jussi.kivilinna at iki.fi
Tue Jul 19 10:43:02 CEST 2016


On 18.07.2016 21:43, Werner Koch wrote:
> Hi,
> 
> I got reports about two portability bug reports for 1.7.2.
> 
> The first is on an OS X 10.7.5:
> 
>   CFLAGS=-m32 ./configure --disable-asm && make all check
>   ...
>   libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src
>   -I/usr/local/include -m32 -Wall -MT rijndael-aesni.lo -MD -MP -MF
>   .deps/rijndael-aesni.Tpo -c rijndael-aesni.c  -fno-common -DPIC -o
>   .libs/rijndael-aesni.o
>   rijndael-aesni.c: In function 'do_aesni_ctr_4':
>   rijndael-aesni.c:817:3: error: 'asm' operand has impossible constraints
>      asm volatile (/* detect if 8-bit carry handling is needed */
>      ^
> 
> So, --disable-asm is not honored in this case.

Currently --disable-asm only disables MPI assembly modules.

Configure options --disable-aesni-support and --disable-pclmul-support can
be used to disable AESNI and PCLMUL assembly parts.

> A similar problem exists
> on OpenIndiana with gcc 4.9:
> 
>   crc-intel-pclmul.c: In function 'crc32_less_than_16':
>   crc-intel-pclmul.c:747:7: error: 'asm' operand has impossible constraints
>          asm volatile ("movd %[crc], %%xmm0\n\t"

GCC is failing to allocate register constraints for inline assembly blocks in
these cases. In these two asm blocks, quite many memory operands are used and
with PIC enabled, these might be requiring extra registers. So, these
blocks need be split to ease register pressure.

> 
> using the Solaris compiler we get this error:
> 
>   "../src/cipher-proto.h", line 27: warning: useless declaration
>   "md.c", line 912: identifier redeclared: _gcry_md_extract
>   	current : function(pointer to struct gcry_md_handle {pointer to
>   struct gcry_md_context {..} ctx, 
>   ... long output ...

This does not seem to be full 'current' declaration, but truncated.

-Jussi

>   	previous: function(pointer to struct gcry_md_handle {pointer to
>   struct gcry_md_context {..} ctx, int bufpos, int bufsize, array[1] of
>   unsigned char buf}, int, pointer to void, unsigned int) returning unsigned
>   int : "../src/gcrypt-int.h", line 132
>   cc: acomp failed for md.c
> 
> 
> 
> Salam-Shalom,
> 
>    Werner
>   
> 




More information about the Gcrypt-devel mailing list