<div dir="auto"><span style="font-size:12.8px">Hello,</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">I found a strange libgcrypt behavior on ARM with clang built.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">There is a big gap in performance of libgcrypt, built by clang, in comparison with gcc on my ARM target machine.</span><br style="font-size:12.8px"><span style="font-size:12.8px">The simple profile test shows 100-500% advantage of gcc gcrypt.</span><br style="font-size:12.8px"><span style="font-size:12.8px">I found an awkward workaround to beat this issue, but need your help to find the best way to fix it.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">The root cause is next:</span><br style="font-size:12.8px"><span style="font-size:12.8px">Due to clang strict assembler syntax rules the unified assembler ARM check doesn't pass.</span><br style="font-size:12.8px"><span style="font-size:12.8px">Assembler check fails while ./configure for flags:</span><br style="font-size:12.8px"><span style="font-size:12.8px">HAVE_COMPATIBLE_GCC_ARM_</span><span style="font-size:12.8px">PLATFORM_AS</span><br style="font-size:12.8px"><span style="font-size:12.8px">HAVE_GCC_INLINE_ASM_NEON</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">As a workaround I remove '%' from registers names in</span><br style="font-size:12.8px"><a href="http://configure.ac/" style="text-decoration-line:none;color:rgb(66,133,244);font-size:12.8px">configure.ac</a><span style="font-size:12.8px">,</span><br style="font-size:12.8px"><span style="font-size:12.8px">arm mips lib *.S files,</span><br style="font-size:12.8px"><span style="font-size:12.8px">cipher/*arm.S,*armv7-neon.S files.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Could you please help with a more correct - polite way to compile libgcrypt with assembler code?</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Tested on:</span><br style="font-size:12.8px"><span style="font-size:12.8px">libgcrypt-1.8.6</span><br style="font-size:12.8px"><span style="font-size:12.8px">libgcrypt-1.9.3</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Equipment:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">build machine:</span><br style="font-size:12.8px"><span style="font-size:12.8px">intel based cpu x86_64</span><br style="font-size:12.8px"><span style="font-size:12.8px">Ubnuntu-20.04</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Software</span><br style="font-size:12.8px"><span style="font-size:12.8px">compiler        : clang 11.1.0</span><br style="font-size:12.8px"><span style="font-size:12.8px">linker lld      : lld 11.1.0</span><br style="font-size:12.8px"><span style="font-size:12.8px">assembler       : llvm-as 11.1.0</span><br style="font-size:12.8px"><span style="font-size:12.8px">cflags          : "-m32 -march=armv7-a -mthumb -mfpu=vfpv3-d16 --target=arm-linux-gnueabihf"</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">arm-linux-gnueabihf sysroot based on glibc 2.31</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">libgcrypt configuring:</span><br style="font-size:12.8px"><span style="font-size:12.8px">CC="arm-linux-gnueabihf-clang" \</span><br style="font-size:12.8px"><span style="font-size:12.8px">./configure \</span><br style="font-size:12.8px"><span style="font-size:12.8px">  --with-libgpg-error-prefix=<</span><span style="font-size:12.8px">libgpg.so path> \</span><br style="font-size:12.8px"><span style="font-size:12.8px">  --prefix=<output path> \</span><br style="font-size:12.8px"><span style="font-size:12.8px">  --host=arm-linux-gnueabihf \</span><br style="font-size:12.8px"><span style="font-size:12.8px">  --enable-static \</span><br style="font-size:12.8px"><span style="font-size:12.8px">  --disable-doc</span><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">target machine:</span><br style="font-size:12.8px"><span style="font-size:12.8px">hardware:</span><br style="font-size:12.8px"><span style="font-size:12.8px">model name : ARMv7 Processor rev 4 (v7l)</span><br style="font-size:12.8px"><span style="font-size:12.8px">BogoMIPS : 2304.00</span><br style="font-size:12.8px"><span style="font-size:12.8px">Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae aes pmull sha1 sha2 crc32</span><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Best Regards,</span><br style="font-size:12.8px"><span style="font-size:12.8px">Dmytro Kovalov</span><br style="font-size:12.8px"><a href="mailto:Dmytro.a.kovalov@globallogic.com" style="text-decoration-line:none;color:rgb(66,133,244);font-size:12.8px">Dmytro.a.kovalov@globallogic.com</a></div>