shyjack 发表于 18-6-2010 08:50:27

cross compile for mips

hi there,

Does anyone here have experience to cross compile C programs?I need to compile C programs under cygwin or x86linux, the target program will be running on mipsel-linux environment.So far I had tried to compile a cross-compiler by myself with no success, then I downloaded some pre-compiled cross-compiler, but the utility mipsel-linux-gcc outputs nothing after being invoked but returns the code 127.

My dlink G604T dsl router is in revision B & the latest firmware still doesn't have ssh server. What I am trying to do is to compile a tiny, self contained ssh server on this dsl router.

Could anyone pls help me?

Many thanks!
gaohd@hotmail.com

jerryzh 发表于 18-6-2010 09:51:28

how about C library?
Use matching compiler and library.

shyjack 发表于 18-6-2010 12:19:59

The problem is I don't know what version of gcc and option that this cross-compiler is compiled.

e.g if you gcc -v, it will tell you the exact version and compiling options
$ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /managed/gcc-build/final-v3-bootstrap/gcc-3.4.4-999/configure --verbose --program-suffix=-3 --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc--libdir=/usr/lib --ibexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext --enable-ersion-specific-runtime-libs --without-x --enable-libgcj --disable-java-awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-threads=posix --enable-java-c=boehm --disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchronization --enable-libstdcxx-debu

but command "mipsel-linux-gcc -v" outpus nothing.maybe the cross-compiler I downloaded is wrong.

Thank you anyway.
页: [1]
查看完整版本: cross compile for mips