confluentinc / librdkafka

The Apache Kafka C/C++ library
Other
194 stars 3.14k forks source link

target arm_cortex-a9_vfpv3 - Error: selected processor does not support `crc32b (ip),r0' in ARM mode #3415

Open pablomguevara opened 3 years ago

pablomguevara commented 3 years ago

Description

cross-compiling for target arm_cortex-a9_vfpv3 is failing

ARCH:=arm BOARDNAME:=Marvell Armada 37x/38x/XP CPU_TYPE:=cortex-a9

The actual error (more on the attached build_librdkafka_error.txt)

arm-openwrt-linux-muslgnueabi-gcc -MD -MP -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/home/pablo/sources/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/librdkafka-1.7.0:librdkafka-1.7.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/home/pablo/sources/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include -I/home/pablo/sources/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/include -I/home/pablo/sources/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-7.5.0_musl_eabi/usr/include -I/home/pablo/sources/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-7.5.0_musl_eabi/include/fortify -I/home/pablo/sources/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-7.5.0_musl_eabi/include  -I/home/pablo/sources/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include -I/home/pablo/sources/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include -I/home/pablo/sources/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include -I/home/pablo/sources/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include -I/home/pablo/sources/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include -I/home/pablo/sources/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/include -c crc32c.c -o crc32c.o
crc32c.c: In function 'crc32c_global_init':
crc32c.c:343:9: error: unknown register name '%edx' in 'asm'
         __asm__("cpuid" \
         ^
crc32c.c:374:9: note: in expansion of macro 'SSE42'
         SSE42(sse42);
         ^~~~~
crc32c.c:343:9: error: unknown register name '%ebx' in 'asm'
         __asm__("cpuid" \
         ^
crc32c.c:374:9: note: in expansion of macro 'SSE42'
         SSE42(sse42);
         ^~~~~
{standard input}: Assembler messages:
{standard input}:780: Error: selected processor does not support `crc32b (ip),r0' in ARM mode
{standard input}:808: Error: bad instruction `crc32q (ip),r0'
{standard input}:809: Error: bad instruction `crc32q 8192(ip),r8'
{standard input}:810: Error: bad instruction `crc32q 16384(ip),r4'
{standard input}:860: Error: bad instruction `crc32q (ip),r0'
{standard input}:861: Error: bad instruction `crc32q 256(ip),r8'
{standard input}:862: Error: bad instruction `crc32q 512(ip),r4'
{standard input}:901: Error: bad instruction `crc32q (ip),r0'
{standard input}:915: Error: selected processor does not support `crc32b (ip),r0' in ARM mode
../mklove/Makefile.base:97: recipe for target 'crc32c.o' failed
make[4]: *** [crc32c.o] Error 1
make[4]: Leaving directory '/home/pablo/sources/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/librdkafka-1.7.0/src'
Makefile:27: recipe for target 'libs' failed
make[3]: *** [libs] Error 2
make[3]: Leaving directory '/home/pablo/sources/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/librdkafka-1.7.0'
Makefile:67: recipe for target '/home/pablo/sources/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/librdkafka-1.7.0/.built' failed
make[2]: *** [/home/pablo/sources/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/librdkafka-1.7.0/.built] Error 2
make[2]: Leaving directory '/home/pablo/sources/openwrt/feeds/librdkafka/librdkafka'
time: package/feeds/librdkafka/librdkafka/compile#16.42#1.41#19.21
package/Makefile:111: recipe for target 'package/feeds/librdkafka/librdkafka/compile' failed
make[1]: *** [package/feeds/librdkafka/librdkafka/compile] Error 2
make[1]: Leaving directory '/home/pablo/sources/openwrt'
/home/pablo/sources/openwrt/include/toplevel.mk:225: recipe for target 'package/feeds/librdkafka/librdkafka/compile' failed
make: *** [package/feeds/librdkafka/librdkafka/compile] Error 2

How to reproduce

git clone https://git.openwrt.org/openwrt/openwrt.git git checkout v19.07.7 echo "src-git librdkafka https://github.com/pablomguevara/openwrt-packages.git" >> ./feeds.conf ./scripts/feeds update librdkafka ./scripts/feeds install librdkafka make menuconfig (set arch, and select librdkafka; or use the config.txt file attached) make tools/install make toolchain/install make package/feeds/librdkafka/librdkafka/compile PKG_HASH=skip V=sc

IMPORTANT: Always try to reproduce the issue on the latest released version (see https://github.com/edenhill/librdkafka/releases), if it can't be reproduced on the latest version the issue has been fixed.

Checklist

IMPORTANT: We will close issues where the checklist has not been completed.

Please provide the following information:

edenhill commented 2 years ago

Feel free to submit a PR to either add arm a9 support or use the software crc32 version.