编译C为Mips架构 [英] Compile C for Mips architecture

查看:631
本文介绍了编译C为Mips架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了几种方法来做到这一点(到目前为止,我没有尝试过一对夫妇,但我想隔离这一个为了方便)

I have seen several ways to do this (and so far I havent tried a couple but I want to isolate this one for ease)

一个方法做这个威盛gcc和我喜欢​​这只是继续打墙。

There is supposed to be a way to do this VIA gcc and I would prefer this i just keep hitting walls.

我使用debian7并且可以使用任何其他的味道(我的时间是希望避免qemu casue我想要一个更小的规模。)
我在这里找到这个例子。

I am using debian7 and can use what ever other flavor out there (I am for the time being wanting to avoid qemu casue I want something smaller scale.) I am following this example found here.

http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/

我已经能够做的一切,在这一部分期间,我不得不安装
libgmp3c2-dummy_1.0_all.deb为ti继续

I have been able to do everything and during part of this I had to install libgmp3c2-dummy_1.0_all.deb for ti to continue

现在我需要编译,所有我编译是一个简单的hello世界脚本,但是,编译时我不能导致libgmp.so.3不在/ usr / lib / dir,但是有一个在/ usr / lib / mips-linux-gnu-gcc文件夹我想我会复制它以查看是否得到它编译,我得到这个elf文件编码的big-endian这是有道理的。但是它是什么,我缺少编译这个文件

just now I need to compile and all I am compiling is a simple hello world script however , upon compiling I can't cause libgmp.so.3 is not in the /usr/lib/ dir however, there is one in /usr/lib/mips-linux-gnu-gcc folder I thought I'd copy it over to see if get it to compile and I get that this elf file is encoded in big-endian which makes sense. but what is it that I am missing to compile this file??

,我试图编译的东西作为大端我认为,我有混淆从库或者我需要一个不同的libgmp.so.3 ..

and I tried to compile the thing as big endian I think that either that I have confusion from the libraries or that I need a differnt libgmp.so.3 ..

我也试过apt-get安装libgmp-dev libgmp3-dev太。

also I tried apt-get install libgmp-dev libgmp3-dev too.

感谢您帮助,如果你可以! :)如果你知道一个简单的方法来做这个不需要在我的机器上一堆空间,然后我是开放的,但我想尝试与GCC和使用工具链。

Thank you for helping helping if you can! :) and if you know of a simple way to do this that wont take a bunch of space on the my machine then I am open but I would like to try with GCC and using the tool chain.

谢谢!

推荐答案


编辑我想改进这个答案以方便别人使用...

Well I managed to compile MIPS in Debian. Edit I want to improve this answer for ease for use to others...

    1. deb http://www.emdebian.org/debian stable main to /etc/apt/sources.list 

    2. apt-get update.

    3. install libgmp3c2 from https://packages.debian.org/squeeze/libgmp3c2

    4. apt-get install gcc-4.3-mips-linux-gnu libgmp3c2-mips-cross this worked

然后只是mips-linux-gnu-gcc file.c -o executable

then just mips-linux-gnu-gcc file.c -o executable

这是它。

PS如果你使用路由器....使用-static选项编译时。
所以最后它看起来像

PS if you're working on Routers.... use the -static option when compiling. So in the end it looked like

mips-linux-gnu-gcc -EB -march=34kc -static test.c -o test

如果您无法识别密钥环公钥的问题,请使用 emdebian-archive-keyring 可以使用apt安装的软件包。

If you have problems with a keyring public key not being recognized, use the emdebian-archive-keyring package which can be installed using apt.

这篇关于编译C为Mips架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆