adrian-thurston / colm

The Colm Programming Language
MIT License
167 stars 32 forks source link

Cross-Compilation Error: mips64 OpenWrt #123

Closed Grommish closed 4 years ago

Grommish commented 4 years ago

I'm attempting to incorporate Colm into OpenWrt (as a dep on ragel, which is next), I run into the following error..

Host: x86_64-linux-gnu Target: mips64-linux-muslabi64 Built from master branch (commit c9ff691c82b565224be74bc89767cf9e61c0a960, pulled 9/13/2020)

Compiled using GCC10.x and MUSL

OpenWrt-libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o  .libs/libfsm_la-idbase.o .libs/libfsm_la-fsmstate.o .libs/libfsm_la-fsmbase.o .libs/libfsm_la-fsmattach.o .libs/libfsm_la-fsmmin.o .libs/libfsm_la-fsmgraph.o .libs/libfsm_la-fsmap.o .libs/libfsm_la-fsmcond.o .libs/libfsm_la-fsmnfa.o .libs/libfsm_la-common.o .libs/libfsm_la-redfsm.o .libs/libfsm_la-gendata.o .libs/libfsm_la-allocgen.o .libs/libfsm_la-codegen.o .libs/libfsm_la-actexp.o .libs/libfsm_la-binvar.o .libs/libfsm_la-tables.o .libs/libfsm_la-tabgoto.o .libs/libfsm_la-tabbreak.o .libs/libfsm_la-tabvar.o .libs/libfsm_la-binary.o .libs/libfsm_la-bingoto.o .libs/libfsm_la-binbreak.o .libs/libfsm_la-actloop.o .libs/libfsm_la-flat.o .libs/libfsm_la-flatgoto.o .libs/libfsm_la-flatbreak.o .libs/libfsm_la-flatvar.o .libs/libfsm_la-switch.o .libs/libfsm_la-switchgoto.o .libs/libfsm_la-switchbreak.o .libs/libfsm_la-switchvar.o .libs/libfsm_la-goto.o .libs/libfsm_la-gotoloop.o .libs/libfsm_la-gotoexp.o .libs/libfsm_la-ipgoto.o .libs/libfsm_la-dot.o .libs/libfsm_la-asm.o   -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o  -Wl,--no-undefined   -Wl,-soname -Wl,libfsm.so.0 -o .libs/libfsm.so.0.0.0
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: Relocations in generic ELF (EM: 8)
/usr/bin/ld: .libs/libfsm_la-idbase.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:499: libfsm.la] Error 1
adrian-thurston commented 4 years ago

Hmm, this doesn't really seem specific to colm. Seems like an environment error. Have you tried searching for others with the same problem? It seems like there are other instances of this error and the solution is to pass the right linker args.

Grommish commented 4 years ago

I looked at that, but I suspect you are correct. There are other things going on to look at first.

Closing.

I should mention @adrian-thurston, I'm attempting to put Colm/Ragel into the Openwrt environment (i want to integrate Hyperscan libraries into an IDS/IPS). So I may have other problems, especially since it's all cross-compile, and I'll apologize in advance :+1: