Open SergeyAnuchin opened 6 years ago
It's not compatible with arm at all -- there are some hacks and/or inline assembly
If you are going to port sourcecode for arm, please do not use arm-specific instructions as you would like to have crosscode for mips/mipscel too. Plz...
It seems that ARMv7 does not have CRC32x assembler directives (possible SSE4 extensions). I have tried to compile using following flags:
+CFLAGS = $(ARCH) -O3 -std=gnu11 -Wall -mtune=cortex-a9 -march=armv7-a -mfpu=vfp -mfloat-abi=softfp -fno-strict-aliasing -fno-strict-overflow -fwrapv -DAES=1 -DCOMMIT=\"${COMMIT}\" -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
but without success:
/opt/tmp/ccB39ZkK.s:34: Error: selected processor does not support `crc32b (r3),r2' in ARM mode
/opt/tmp/ccB39ZkK.s:52: Error: bad instruction `crc32l (ip),r2'
/opt/tmp/ccB39ZkK.s:73: Error: selected processor does not support `crc32b (r3),r0' in ARM mode
/opt/tmp/ccB39ZkK.s:83: Error: selected processor does not support `crc32b (r2),r0' in ARM mode
/opt/tmp/ccB39ZkK.s:93: Error: selected processor does not support `crc32b (r3),r0' in ARM mode
make: *** [Makefile:89: objs/common/crc32c.o] Error 1
So, the only way is to implement them (CRC32 instuctions) on C by modification of crc32c.c
.
A little patch (maybe it even works on MIPS, idk) https://github.com/ICQFan4ever/MTProxyARMPatch
Compiled on ARMv7 successfully
@ICQFan4ever thank you! Just checked - and it works on my Raspberry Pi 3+
A little patch (maybe it even works on MIPS, idk) https://github.com/ICQFan4ever/MTProxyARMPatch
Compiled on ARMv7 successfully
Thank you! Compiled successfully on
lscpu Architecture: armv7l Byte Order: Little Endian Model name: ARMv7 Processor rev 2 (v7l)
./mtproto-proxy --help [25630][2019-02-20 17:38:47.421699 local] Invoking engine mtproxy-0.01 compiled at Feb 20 2019 17:34:49 by gcc 5.4.0 20160609 32-bit after commit 2c942119c4ee340c80922ba11d14fb3b10d5e654 usage: ./mtproto-proxy [-v] [-6] [-p
] [-H {, }] [-M ] [-u ] [-b ] [-c ] [-l ] [-W ] mtproxy-0.01 compiled at Feb 20 2019 17:34:49 by gcc 5.4.0 20160609 32-bit after commit 2c942119c4ee340c80922ba11d14fb3b10d5e654
A little patch (maybe it even works on MIPS, idk) https://github.com/ICQFan4ever/MTProxyARMPatch
Not working (any more?) on ARM:
`common/crc32c.c: In function ‘crc32c_partial_sse42_clmul’: common/crc32c.c:406:14: warning: implicit declaration of function ‘builtin_ia32_pclmulqdq128’ [-Wimplicit-function-declaration] v2di F = builtin_ia32_pclmulqdq128 (D, K, 0x00) ^ __builtin_ia32_pclmulqd
common/crc32c.c:406:14: error: incompatible types when initializing type ‘v2di {aka vector(2) long long int}’ using type ‘int’ common/crc32c.c:471:14: error: incompatible types when initializing type ‘v2di {aka vector(2) long long int}’ using type ‘int’ v2di F = builtin_ia32_pclmulqdq128 (D, K, 0x00) ^ builtin_ia32_pclmulqd`
Almost a year has passed. : ((
Any plans on porting it?
A little patch (maybe it even works on MIPS, idk) https://github.com/ICQFan4ever/MTProxyARMPatch
Compiled on ARMv7 successfully
Thank you! It compiles successfully on my Raspberry pi 4b :D
A little patch (maybe it even works on MIPS, idk) https://github.com/ICQFan4ever/MTProxyARMPatch
Compiled on ARMv7 successfully
Can add that the patch works on Raspberry Pi 3 in 2020
Compiled failed on ARMv8 on Raspberry Pi 4
I tried to compile for arm ampere for Oracle, it did not work.
I tried to compile for arm ampere for Oracle, it did not work. lscpu listing is on the screenshot
A little patch (maybe it even works on MIPS, idk) https://github.com/ICQFan4ever/MTProxyARMPatch
Compiled on ARMv7 successfully
Thanks a lot it worked for Orange PI PC. I think it at least works at most of the armhf platforms .
The patch output was:
$ patch -p1 < arm.patch
patching file Makefile
Hunk #2 FAILED at 13.
1 out of 2 hunks FAILED -- saving rejects to file Makefile.rej
patching file common/cpuid.c
patching file common/crc32.c
patching file common/crc32c.c
patching file common/precise-time.h
patching file common/server-functions.h
and then the make
command execution didn't work :(
Architecture: ARMv8
Can't build on Ubuntu 16.04 ARMv71 (scaleway hosting)
cc: error: unrecognized argument in option ‘-march=core2’ cc: note: valid arguments to ‘-march=’ are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6kz armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv7ve armv8-a armv8-a+crc armv8.1-a armv8.1-a+crc iwmmxt iwmmxt2 native cc: error: unrecognized command line option ‘-m64’ cc: error: unrecognized command line option ‘-mpclmul’ cc: error: unrecognized command line option ‘-mfpmath=sse’ cc: error: unrecognized command line option ‘-mssse3’
Docker image not working same way....