Gcrypt compilation chokes under Android/Termux

Dmitry Baryshkov dbaryshkov at gmail.com
Fri Mar 20 09:31:18 CET 2020


Hello,

I have tried building libgcrypt on Android 8.1 (ARMv8) under Termux.
Unfortunately build failed with the following error.


$ gcc --version
clang version 9.0.1
         Target: aarch64-unknown-linux-android
                 Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin

...
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
-I../../libgcrypt/cipher -I..  -I../src -I../../libgcrypt/src -I../mpi
-I../../libgcrypt/mpi  -Wa,--noexecstack -g -O2 -MT chacha20-aarch64.lo -MD
-MP -MF .deps/chacha20-aarch64.Tpo -c -o chacha20-aarch64.lo
../../libgcrypt/cipher/chacha20-aarch64.S
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../libgcrypt/cipher -I..
-I../src -I../../libgcrypt/src -I../mpi -I../../libgcrypt/mpi
-Wa,--noexecstack -g -O2 -MT chacha20-aarch64.lo -MD -MP -MF
.deps/chacha20-aarch64.Tpo -c ../../libgcrypt/cipher/chacha20-aarch64.S
-fPIC -DPIC -o .libs/chacha20-aarch64.o
../../libgcrypt/cipher/chacha20-aarch64.S:419:701: error: invalid operand
for instruction
                    add v18.4s, v18.4s, v22.4s;; add v19.4s, v19.4s,
v23.4s;; umulh x25, x11, x15;; eor v1.16b, v18.16b, v30.16b;; eor v2.16b,
v19.16b, v31.16b;; adds x17, x17, x24;; rev32 v30.8h, v1.8h; rev32 v31.8h,
v2.8h;; mul x11, x12, x15;; add v26.4s, v26.4s, v30.4s;; add v27.4s,
v27.4s, v31.4s;; adc x16, x16, x25;; eor v1.16b, v26.16b, v22.16b;; eor
v2.16b, v27.16b, v23.16b;; mul x12, x12, x13;; shl v22.4s, v1.4s, #(12);
shl v23.4s, v2.4s, #(12); adds x11, x11, x20;; sri v22.4s, v1.4s, #(32 -
(12)); sri v23.4s, v2.4s, #(32 - (12));; adc x10, x12, x19;; add v18.4s,
v18.4s, v22.4s;; add v19.4s, v19.4s, v23.4s;; and x12, x10, #3;; eor
v1.16b, v18.16b, v30.16b;; eor v2.16b, v19.16b, v31.16b;; mov x10, x10, lsr
#2;; tbl v30.16b, {v1.16b}, v7.16b; add x10, x10, x10, lsl #2;; tbl
v31.16b, {v2.16b}, v7.16b;; adds x10, x10, x17;; add v26.4s, v26.4s,
v30.4s;; add v27.4s, v27.4s, v31.4s;; adcs x11, x11, x16;; eor v1.16b,
v26.16b, v22.16b;; eor v2.16b, v27.16b, v23.16b;; adc w12, w12, wzr;; shl
v22.4s, v1.4s, #(7); shl v23.4s, v2.4s, #(7); ldr x22, [x9, #((1 * 16) + 0
* 8)];; sri v22.4s, v1.4s, #(32 - (7)); sri v23.4s, v2.4s, #(32 - (7));;









                ^
../../libgcrypt/cipher/chacha20-aarch64.S:451:701: error: invalid operand
for instruction
                    add v18.4s, v18.4s, v23.4s;; add v19.4s, v19.4s,
v20.4s;; umulh x25, x11, x15;; eor v1.16b, v18.16b, v29.16b;; eor v2.16b,
v19.16b, v30.16b;; adds x17, x17, x24;; rev32 v29.8h, v1.8h; rev32 v30.8h,
v2.8h;; mul x11, x12, x15;; add v24.4s, v24.4s, v29.4s;; add v25.4s,
v25.4s, v30.4s;; adc x16, x16, x25;; eor v1.16b, v24.16b, v23.16b;; eor
v2.16b, v25.16b, v20.16b;; mul x12, x12, x13;; shl v23.4s, v1.4s, #(12);
shl v20.4s, v2.4s, #(12); adds x11, x11, x20;; sri v23.4s, v1.4s, #(32 -
(12)); sri v20.4s, v2.4s, #(32 - (12));; adc x10, x12, x19;; add v18.4s,
v18.4s, v23.4s;; add v19.4s, v19.4s, v20.4s;; and x12, x10, #3;; eor
v1.16b, v18.16b, v29.16b;; eor v2.16b, v19.16b, v30.16b;; mov x10, x10, lsr
#2;; tbl v29.16b, {v1.16b}, v7.16b; add x10, x10, x10, lsl #2;; tbl
v30.16b, {v2.16b}, v7.16b;; adds x10, x10, x17;; add v24.4s, v24.4s,
v29.4s;; add v25.4s, v25.4s, v30.4s;; adcs x11, x11, x16;; eor v1.16b,
v24.16b, v23.16b;; eor v2.16b, v25.16b, v20.16b;; adc w12, w12, wzr;; shl
v23.4s, v1.4s, #(7); shl v20.4s, v2.4s, #(7); subs x26, x26, #2; sri
v23.4s, v1.4s, #(32 - (7)); sri v20.4s, v2.4s, #(32 - (7));;;









                ^
../../libgcrypt/cipher/chacha20-aarch64.S:496:342: error: invalid operand
for instruction
                    add v18.4s, v18.4s, v23.4s;; add v19.4s, v19.4s,
v20.4s;; adc x10, x12, x19;; eor v1.16b, v18.16b, v29.16b;; eor v2.16b,
v19.16b, v30.16b;; ; rev32 v29.8h, v1.8h; rev32 v30.8h, v2.8h;; and x12,
x10, #3;; add v24.4s, v24.4s, v29.4s;; add v25.4s, v25.4s, v30.4s;; ; eor
v1.16b, v24.16b, v23.16b;; eor v2.16b, v25.16b, v20.16b;; mov x10, x10, lsr
#2;; shl v23.4s, v1.4s, #(12); shl v20.4s, v2.4s, #(12); ; sri v23.4s,
v1.4s, #(32 - (12)); sri v20.4s, v2.4s, #(32 - (12));; add x10, x10, x10,
lsl #2;; add v18.4s, v18.4s, v23.4s;; add v19.4s, v19.4s, v20.4s;; ; eor
v1.16b, v18.16b, v29.16b;; eor v2.16b, v19.16b, v30.16b;; adds x10, x10,
x17;; tbl v29.16b, {v1.16b}, v7.16b; ; tbl v30.16b, {v2.16b}, v7.16b;; adcs
x11, x11, x16;; add v24.4s, v24.4s, v29.4s;; add v25.4s, v25.4s, v30.4s;; ;
eor v1.16b, v24.16b, v23.16b;; eor v2.16b, v25.16b, v20.16b;; adc w12, w12,
wzr;; shl v23.4s, v1.4s, #(7); shl v20.4s, v2.4s, #(7); subs x26, x26, #2;
sri v23.4s, v1.4s, #(32 - (7)); sri v20.4s, v2.4s, #(32 - (7));;




                                     ^
make[2]: *** [Makefile:807: chacha20-aarch64.lo] Error 1

-- 
With best wishes
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20200320/64b3a9ef/attachment-0001.html>


More information about the Gcrypt-devel mailing list