【发布时间】:2016-07-18 14:53:20
【问题描述】:
我尝试使用
制作“hello world - 项目”- Jam (perforce) 构建系统
- C++
- Linux
- arm-poky-linux-gnueabi-gcc 编译器
helloworld-perforce-jam.cpp
#include <stdio.h>
int main(int args, char* argv[])
{
printf("\n\n\nHello World from HELLOWORLD-PERFORCE-JAM!!!\n\n\n\n");
return 0;
}
Jamfile
Echo $(CC) ;
Main helloworld-perforce-jam : helloworld-perforce-jam.cpp ;
如果我在没有 Jam-build 系统的情况下直接使用 arm-poky-linux-gnueabi-gcc,则没有任何障碍:
ygyerts@ygyerts:$ /home/user/full_path/arm-poky-linux-gnueabi-gcc helloworld-perforce-jam.cpp
将创建一个适用于 ARM 架构的可执行文件。
如果我使用默认 gcc(由 Jam 定义),则没有任何拦截器,例如:
ygyerts@ygyerts:$ jam
cc
...found 66 target(s)...
...updating 1 target(s)...
Link helloworld-perforce-jam
Chmod1 helloworld-perforce-jam
...updated 1 target(s)...
有一个可执行文件!!!x86 架构!!!将被创建。
但想法是使用自定义 gcc 编译器 (/home/user/full_path/arm-poky-linux-gnueabi-gcc)。而且这是一个拦截器,我不知道怎么...
我尝试使用 jam 可执行文件的参数,如下所示:
ygyerts@ygyerts:$ jam -s CC=/home/user/full_path/arm-poky-linux-gnueabi-gcc
/home/user/full_path/arm-poky-linux-gnueabi-gcc
...found 66 target(s)...
...updating 2 target(s)...
C++ helloworld-perforce-jam.o
Link helloworld-perforce-jam
helloworld-perforce-jam.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
/home/ygyerts/TOOLING/TeamCity/TeamCity-9.1.7/buildAgent/work/e58af29ade3fd40c/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -o helloworld-perforce-jam helloworld-perforce-jam.o
...failed Link helloworld-perforce-jam ...
...failed updating 1 target(s)...
...updated 1 target(s)...
请帮助我了解如何设置所有必需的环境以使用 arm-linux 架构构建 helloworld,而不是使用 x86_64-linux...
【问题讨论】: