Hello,
I found a strange libgcrypt behavior on ARM with clang built.
There is a big gap in performance of libgcrypt, built by clang, in comparison with gcc on my ARM target machine.
The simple profile test shows 100-500% advantage of gcc gcrypt.
I found an awkward workaround to beat this issue, but need your help to find the best way to fix it.
The root cause is next:
GNU binutils historically support AT&T asm style with %register name.
Due to clang strict assembler syntax rules the unified assembler ARM check doesnât pass.
Assembler check fails while ./configure for flags:
HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
HAVE_GCC_INLINE_ASM_NEON
As a workaround I remove â%â from registers names in
configure.ac,
arm mips lib *.S files,
cipher/*arm.S,*armv7-neon.S files.
Could you please help with a more correct - polite way to compile libgcrypt with assembler code?
Tested on:
libgcrypt-1.8.6
libgcrypt-1.9.3
Equipment:
build machine:
intel based cpu x86_64
Ubnuntu-20.04
Software
compiler : clang 11.1.0
linker lld : lld 11.1.0
assembler : llvm-as 11.1.0
cflags : â-m32 -march=armv7-a -mthumb -mfpu=vfpv3-d16 --target=arm-linux-gnueabihfâ
arm-linux-gnueabihf sysroot based on glibc 2.31
libgcrypt configuring:
CC=âarm-linux-gnueabihf-clangâ
./configure
âwith-libgpg-error-prefix=<libgpg.so path>
âprefix=
âhost=arm-linux-gnueabihf
âenable-static
âdisable-doc
target machine:
hardware:
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 2304.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae aes pmull sha1 sha2 crc32