Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross compile filed , cross toolchain not found! #902

Closed
linuxsky opened this issue Jul 28, 2020 · 5 comments
Closed

cross compile filed , cross toolchain not found! #902

linuxsky opened this issue Jul 28, 2020 · 5 comments
Milestone

Comments

@linuxsky
Copy link

linuxsky commented Jul 28, 2020

OS:Ubuntu 18.04
xmake version: xmake v2.3.5+202007280802,
cross toolchain: /usr/bin/aarch64-linux-gnu-gcc
$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.

project tbox:

xxx @ xxx-desktop in ~/workspace/github/tbox on git:master o [8:09:13] C:130
$ xmake f -p linux --cross=aarch64-linux-gnu-
checking for the architecture ... x86_64
error: cross toolchain not found!

@waruqi
Copy link
Member

waruqi commented Jul 28, 2020

对于当前版本,还是需要指定下 --sdk= 交叉编译工具链根目录的

$ xmake f --cross=aarch64-linux-gnu- --sdk=/usr -c

我刚稍微改进了下,对于/usr, /usr/local等常用系统目录也会去探测下,如果想更加省事就,先更新到master版本

$ xmake update master
$ xmake f --cross=aarch64-linux-gnu- -c

@waruqi waruqi added this to the v2.3.6 milestone Jul 28, 2020
@linuxsky
Copy link
Author

对于当前版本,还是需要指定下 --sdk= 交叉编译工具链根目录的

$ xmake f --cross=aarch64-linux-gnu- --sdk=/usr -c

我刚稍微改进了下,对于/usr, /usr/local等常用系统目录也会去探测下,如果想更加省事就,先更新到master版本

$ xmake update master
$ xmake f --cross=aarch64-linux-gnu- -c

[ 86%]: ccache compiling.release src/demo/platform/poller_server.c
/usr/bin/ccache /usr/bin/aarch64-linux-gnu-gcc -c -fvisibility=hidden -Wall -Werror -Os -std=c99 -Isrc -Ibuild/linux/x86_64/release -D__tb_small__ -D__tb_prefix__="demo" -Wno-error=deprecated-declarations -fno-strict-aliasing -Wno-error=expansion-to-defined -fno-stack-protector -o build/.objs/demo/linux/x86_64/release/src/demo/platform/poller_server.c.o src/demo/platform/poller_server.c
error: aarch64-linux-gnu-gcc: error trying to exec 'cc1plus': execvp: No such file or directory
warning: add_cxflags("-Wno-error=deprecated-declarations") is ignored, please pass {force = true} or call set_policy("check.auto_ignore_flags", false) if you want to set it.
warning: add_cxflags("-fno-strict-aliasing") is ignored, please pass {force = true} or call set_policy("check.auto_ignore_flags", false) if you want to set it.
warning: add_cxflags("-Wno-error=expansion-to-defined") is ignored, please pass {force = true} or call set_policy("check.auto_ignore_flags", false) if you want to set it.
warning: add_cxflags("-fno-stack-protector") is ignored, please pass {force = true} or call set_policy("check.auto_ignore_flags", false) if you want to set it.

这块如果需要用c++编译器 估计要手动指定 吧?
aarch64-linux-gnu-cpp 或者 也用 aarch64-linux-gnu-gcc 编译c++ ?

@waruqi
Copy link
Member

waruqi commented Jul 28, 2020

error: aarch64-linux-gnu-gcc: error trying to exec 'cc1plus': execvp: No such file or directory

你没装g++,apt install g++-aarch64-linux-gnu

@waruqi
Copy link
Member

waruqi commented Jul 28, 2020

没啥问题 我这里先close了 。。我这边测试已经完全可以了的。

@waruqi waruqi closed this as completed Jul 28, 2020
@linuxsky
Copy link
Author

没啥问题 我这里先close了 。。我这边测试已经完全可以了的。

没问题,解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants