Erros cross-compiling for MIPS
Hello, I am trying to get ECL to run on a MIPS-based wireless router that runs OpenWRT. This one: system type : Qualcomm Atheros QCA956X ver 1 rev 0 machine : TP-Link Archer C7 v4 processor : 0 cpu model : MIPS 74Kc V5.0 BogoMIPS : 385.84 wait instruction : yes microsecond timers : yes tlb_entries : 32 extra interrupt vector : yes hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb] isa : mips1 mips2 mips32r1 mips32r2 ASEs implemented : mips16 dsp dsp2 Options implemented : tlb 4kex 4k_cache prefetch mcheck ejtag llsc dc_aliases perf_cntr_intr_bit cdmm nan_legacy nan_2008 contextconfig perf shadow register sets : 1 OpenWRT has a framework for building packages; almost everything is in one Makefile and possibly patches, but the system takes care of whatever is needed to cross compile, usually. So, I have tried creating an ECL package, and, well, it complained I was cross-compiling :-) and told me that I should fill in a cross_config file. So I did (the only change was to choose ECL_BIGENDIAN=yes): ECL_STACK_DIR=down CL_FIXNUM_TYPE=int CL_FIXNUM_BITS=32 CL_FIXNUM_MAX=536870911L CL_FIXNUM_MIN=-536870912L CL_INT_BITS=32 CL_LONG_BITS=32 ECL_BIGENDIAN=yes ECL_NEWLINE=LF ECL_FILE_CNT=0 ECL_STDINT_HEADER="#include <stdint.h>" ECL_UINT8_T=uint8_t ECL_UINT16_T=uint16_t ECL_UINT32_T=uint32_t ECL_UINT64_T=no ECL_INT8_T=int8_t ECL_INT16_T=int16_t ECL_INT32_T=int32_t ECL_INT64_T=no ECL_LONG_LONG_BITS=no ECL_WORKING_ENVIRON=yes ECL_TO_RUN=/usr/local/bin/ecl Then, when compiling, I got the error below. It seems that I probably got something wrong in the cross_config file (is that correct?) Does it look like something easy/obvious to fix? Is the output of the configure script necessary? Thank you! Jeronimo . . . Making all in src make[6]: Entering directory '/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/build/atomic/src' make[7]: Entering directory '/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/build/atomic/src' libtool: compile: mips-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I../src -I/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/src/bdwgc/libatomic_ops/src -I/home/jeronimo/pkg/openwrt/staging_dir/target-mips_24kc_musl/usr/include -I/home/jeronimo/pkg/openwrt/staging_dir/target-mips_24kc_musl/include -I/home/jeronimo/pkg/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/usr/include -I/home/jeronimo/pkg/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/include/fortify -I/home/jeronimo/pkg/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/include -fPIC -Wall -Wextra -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3:ecl-16.1.3 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/jeronimo/pkg/openwrt/staging_dir/target-mips_24kc_musl/usr/include/ -fPIC -D_THREAD_SAFE -MT atomic_ops.lo -MD -MP -MF .deps/atomic_ops.Tpo -c /home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/src/bdwgc/libatomic_ops/src/atomic_ops.c -fPIC -DPIC -o atomic_ops.o {standard input}: Assembler messages: {standard input}:24: Error: opcode not supported on this processor: mips2 (mips2) `sync ' {standard input}:47: Error: opcode not supported on this processor: mips2 (mips2) `ll $2,0($4)' {standard input}:49: Error: opcode not supported on this processor: mips2 (mips2) `sc $5,0($4)' make[7]: *** [Makefile:597: atomic_ops.lo] Error 1 make[7]: Leaving directory '/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/build/atomic/src' make[6]: *** [Makefile:460: all] Error 2
Hello,
Making all in src make[6]: Entering directory '/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/build/atomic/src' make[7]: Entering directory '/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/build/atomic/src' libtool: compile: mips-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I../src -I/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/src/bdwgc/libatomic_ops/src -I/home/jeronimo/pkg/openwrt/staging_dir/target-mips_24kc_musl/usr/include -I/home/jeronimo/pkg/openwrt/staging_dir/target-mips_24kc_musl/include -I/home/jeronimo/pkg/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/usr/include -I/home/jeronimo/pkg/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/include/fortify -I/home/jeronimo/pkg/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/include -fPIC -Wall -Wextra -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3:ecl-16.1.3 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/jeronimo/pkg/openwrt/staging_dir/target-mips_24kc_musl/usr/include/ -fPIC -D_THREAD_SAFE -MT atomic_ops.lo -MD -MP -MF .deps/atomic_ops.Tpo -c /home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/src/bdwgc/libatomic_ops/src/atomic_ops.c -fPIC -DPIC -o atomic_ops.o {standard input}: Assembler messages: {standard input}:24: Error: opcode not supported on this processor: mips2 (mips2) `sync ' {standard input}:47: Error: opcode not supported on this processor: mips2 (mips2) `ll $2,0($4)' {standard input}:49: Error: opcode not supported on this processor: mips2 (mips2) `sc $5,0($4)' make[7]: *** [Makefile:597: atomic_ops.lo] Error 1 make[7]: Leaving directory '/home/jeronimo/pkg/openwrt/build_dir/target-mips_24kc_musl/ecl-16.1.3/build/atomic/src' make[6]: *** [Makefile:460: all] Error 2
This is an error in the libatomic_ops package. Since this package is widely used, I suggest looking whether OpenWRT already has it available and whether they have patches. You should also open an issue with the people developing this library. Best regards, Marius Gerbershagen
participants (2)
-
Jeronimo Pellegrini
-
Marius Gerbershagen