简体   繁体   English

一个人如何为Coldfire工具链编译程序?

[英]How would one compile a program for the Coldfire toolchain?

I'm trying to compile a simple hello world application to be run on uCLinux (2.4) which is running on a board with a Freescale Coldfire (MCF5280C) processor...and I'm not quite sure what to do here. 我正在尝试编译一个简单的hello world应用程序,以在uCLinux(2.4)上运行,该应用程序在装有Freescale Coldfire(MCF5280C)处理器的板上运行...我不确定在这里做什么。

I know I need to compile with the correct version/tools from Freescale to target this hardware, so I downloaded and installed the Coldfire tool chain and verified that one I have is for my target: 我知道我需要使用飞思卡尔的正确版本/工具进行编译才能针对此硬件,因此我下载并安装了Coldfire工具链,并验证了我拥有的链适合我的目标:

mike@linux-4puc:/usr/local/m68k-elf/bin> ./gcc -v
Reading specs from /usr/local/lib/gcc-lib/m68k-elf/2.95.3/specs
gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)

I tried a simple gcc "file" type command: 我尝试了一个简单的gcc "file"类型命令:

mike@linux-4puc:/home/mike> /usr/local/m68k-elf/bin/gcc test.c
/usr/local/m68k-elf/bin/ld.real: cannot open crt0.o: No such file or directory
collect2: ld returned 1 exit status

Which does not work at all.. so it's clearly more complex that than. 这根本不起作用..所以它显然比。 The output almost looks like it wants me to build the tool chain before I use it?? 输出几乎看起来像是要我在使用它之前构建工具链? Anyone ever done this before? 有人做过吗? Not sure what I need to do or if I just need some flags. 不知道我需要做什么或者是否只需要一些标志。

You might also try seeing if you have a command called m68k-elf-gcc or something along those lines. 您也可以尝试查看是否有一个名为m68k-elf-gcc的命令或类似的命令。 This is a common naming for cross-compilers. 这是交叉编译器的通用命名。

As for your problem, it sounds like there is something wrong with your compiler setup. 至于您的问题,听起来好像编译器设置有问题。 crt0.o is the object file that contains C-runtime setup code. crt0.o是包含C运行时安装代码的目标文件。 The linker (what is actually giving the error) should know where this file is if setup properly. 如果安装正确,链接器(实际上是在提供错误的地方)应该知道该文件在哪里。

When you installed you should have run make install as the last step without having modified anything since the make step. 安装后,您应该将make install作为最后一步运行,而无需对make进行任何修改。 The configuration step will setup certain variables and such based on the path where it's supposed to be installed. 配置步骤将根据应安装的路径设置某些变量等。

Where did you get a FreeScale toolchain? 您从哪里获得FreeScale工具链? I took a look at their site and it seemed only third parties supplied C++ cross-compilers. 我看了看他们的网站,似乎只有第三方提供了C ++交叉编译器。 In the toolchain I get from NetBurner (for use with their hardware) the crt0.o file exists under the gcc-m68k\\m68k-elf\\lib directory. 在我从NetBurner获得的工具链(用于其硬件)中,crt0.o文件位于gcc-m68k \\ m68k-elf \\ lib目录下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM