各位大神,如何配置buildroot用外部编译器?
离线
我也遇到了类似的问题,搭车请教。
硬件环境是ilicheepi一代,系统是ubuntu17.10,想用buildroot创建根文件系统。
我打算用最新版本的交叉编译器,apt-get下载的版本是arm-linux-gnueabihf-gcc 7.2。查看了下,命令应该是在/usr/bin下,而相关库在/usr/arm-linux-gnueabihf文件夹下。
那么我在buildroot配置菜单里,toolchains是这么选的:
选择外部编译器;
选择编译器路径:/usr
选择编译器头?:arm-linux-genueabihf
然后我执行make,但仍报以下错误:
>>> toolchain-external-custom Configuring
Distribution toolchains are unsuitable for use by Buildroot,
as they were configured in a way that makes them non-relocatable,
and contain a lot of pre-built libraries that would conflict with
the ones Buildroot wants to build.
package/pkg-generic.mk:224: recipe for target '/opt/buildroot-2017.11/output/build/toolchain-external-custom/.stamp_configured' failed
make: *** [/opt/buildroot-2017.11/output/build/toolchain-external-custom/.stamp_configured] Error 1
any@Any-Desktop-PC:/opt/buildroot-2017.11$
意思是:
交叉编译器不适合buildroot使用?
原因是它们以一种可重新定位的方式配置?
并且,包含了很多预置的库,这些库可能和buildroot想要创建的东西冲突?
最近编辑记录 Any (2018-01-13 11:22:50)
离线
/bin不用加的,make时会自动追加/bin
试了下:
>>> toolchain-external-custom Configuring
Cannot execute cross-compiler '/usr/bin/bin/arm-linux-gnueabihf-gcc'
package/pkg-generic.mk:224: recipe for target '/opt/buildroot-2017.11/output/build/toolchain-external-custom/.stamp_configured' failed
make: *** [/opt/buildroot-2017.11/output/build/toolchain-external-custom/.stamp_configured] Error 1
最近编辑记录 Any (2018-01-13 11:26:47)
离线
ls -l /usr/bin/arm-linux-gnueabihf-gcc
你看下文件是否存在?是否可以执行?
any@Any-Desktop-PC:/opt$ ls -l /usr/bin/arm-linux-gnueabihf-gcc
lrwxrwxrwx 1 root root 25 9月 18 22:11 /usr/bin/arm-linux-gnueabihf-gcc -> arm-linux-gnueabihf-gcc-7
离线
Distribution toolchains are unsuitable for use by Buildroot,
as they were configured in a way that makes them non-relocatable,
and contain a lot of pre-built libraries that would conflict with
the ones Buildroot wants to build.
我知道了, 你这个工具链不可以被重定位(non-relocatable), buildroot不接受这个工具链.
在线
附件为make menuconfig的截图。
https://whycan.cn/files/members/395/QQ20180113113653.png
https://whycan.cn/files/members/395/QQ20180113113723.png
最近编辑记录 Any (2018-01-13 11:44:29)
离线
Distribution toolchains are unsuitable for use by Buildroot,
as they were configured in a way that makes them non-relocatable,
and contain a lot of pre-built libraries that would conflict with
the ones Buildroot wants to build.我知道了, 你这个工具链不可以被重定位(non-relocatable), buildroot不接受这个工具链.
arm-linxu-gnueabihf版本太新了?
buildroot我也是下载的最新版的。
有什么解决的办法呢?除了下载低版本的交叉编译器。
最近编辑记录 Any (2018-01-13 11:47:42)
离线
你这个工具链哪里来的?
试一试用这个命令安装的工具链 sudo apt-get install gcc-arm-linux-gnueabihf
就是这么来的...
在ubuntu14.04下用这个命令的话,默认安装的是4.8版本,但在ubunt17.10下,安装的就是7.2版本。
any@Any-Desktop-PC:/opt/buildroot-2017.11$ sudo apt-get install gcc-arm-linux-gnueabihf
[sudo] any 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
gcc-arm-linux-gnueabihf 已经是最新版 (4:7.2.0-1ubuntu1)。
下列软件包是自动安装的并且现在不需要了:
linux-headers-4.13.0-19 linux-headers-4.13.0-19-generic linux-image-4.13.0-19-generic
linux-image-extra-4.13.0-19-generic linux-signed-image-4.13.0-19-generic
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 2 个软件包未被升级。
最近编辑记录 Any (2018-01-13 11:50:34)
离线
看能否执行这个:
sudo apt-get install gcc-4.8-arm-linux-gnueabihf
现在的问题是想用高版本的...
低版本的我通过下载tar文件也安装过。
4.6版本的编译通过了,还没下到板子上试。
最近编辑记录 Any (2018-01-13 13:01:03)
离线
在线
晕哥 说:看能否执行这个:
sudo apt-get install gcc-4.8-arm-linux-gnueabihf现在的问题是想用高版本的...
低版本的我通过下载tar文件也安装过。4.6版本的编译通过了,还没下到板子上试。
既然想用最新的工具链, 那应该不选external buildroot chains, 而应该让buildroot下载源码自己去生成arm-linux-gcc工具链。
在线
如果我们在 buildroot 中的 toolchain 指定外部编译工具为之前在 Ubuntu 上面 apt-get 的交叉编译器,那么编译的时候则会出现错误信息:
Distribution toolchains are unsuitable for use by Buildroot,
as they were configured in a way that makes them non-relocatable,
and contain a lot of pre-built libraries that would conflict with
the ones Buildroot wants to build.
这是因为 Ubuntu 得到的交叉编译器被配置成不可重定位的,而且包含了一些与 buildroot 相冲突的库,官方解释:
Distro toolchains, i.ie. toolchains coing with distributions, will
almost invariably be unsuitable for use with Buildroot:they are mostly non-relocatable;
their sysroot is tainted with a lot of extra libraries.
Especially, the toolchains coming with Ubuntu (really, all the Debian
familly of distros) are configured with –sysroot=/ which makes them
non-relocatable, and they already contain quite some libraries that
conflict (in any combination of version, API or ABI) with what Buildroot
wants to build (i.e. extra libraries, some not even present in
Buildroot…) but also their mere preence when Buildroot does not expect
them to be already built (so that a package would enable features when
it should not).
所以我们要自己下载交叉编译工具或者让 buildroot 自动下载。
参考链接: BeagleBone Black 从零到一 (3 Linux 镜像、initramfs、Device Tree及根文件系统)
在线
如果我们在 buildroot 中的 toolchain 指定外部编译工具为之前在 Ubuntu 上面 apt-get 的交叉编译器,那么编译的时候则会出现错误信息:
Distribution toolchains are unsuitable for use by Buildroot,
as they were configured in a way that makes them non-relocatable,
and contain a lot of pre-built libraries that would conflict with
the ones Buildroot wants to build.这是因为 Ubuntu 得到的交叉编译器被配置成不可重定位的,而且包含了一些与 buildroot 相冲突的库,官方解释:
Distro toolchains, i.ie. toolchains coing with distributions, will
almost invariably be unsuitable for use with Buildroot:they are mostly non-relocatable;
their sysroot is tainted with a lot of extra libraries.
Especially, the toolchains coming with Ubuntu (really, all the Debian
familly of distros) are configured with –sysroot=/ which makes them
non-relocatable, and they already contain quite some libraries that
conflict (in any combination of version, API or ABI) with what Buildroot
wants to build (i.e. extra libraries, some not even present in
Buildroot…) but also their mere preence when Buildroot does not expect
them to be already built (so that a package would enable features when
it should not).所以我们要自己下载交叉编译工具或者让 buildroot 自动下载。
参考链接: BeagleBone Black 从零到一 (3 Linux 镜像、initramfs、Device Tree及根文件系统)
首先感谢您的帮助。
通过之前下载安装的arm-linux-gnueabi 4.6版本,创建根文件成功了。
您的意思是说apt-get安装的交叉编译器不行,非要下载安装包安装的才可以?
如何我再下载最新版的交叉编译器的安装包,再安装,这样的话,我电脑上可能就有两个最新版的交叉编译器了,够乱的。
再问个问题,make menuconfig时,我没有选enable root login with password,结果创建根文件系统后,用串口调试,发现提示需要登录,然后我账户和密码都输入为root,结果提示不正确。
后来我选中那个选项后,设了密码,再make了一遍,才可以。
在这里想问下,没选那个选项之前,为什么登录不了?
最近编辑记录 Any (2018-01-13 13:57:02)
离线
1. 多个版本gcc会有点冲突,但是可以手工解决:
看下我安装了4.7, 4.8之后, 编译器是这种结构: arm-linux-gnueabihf-gcc-4.8
默认gcc 是这样指向: /usr/bin/arm-linux-gnueabihf-gcc -> arm-linux-gnueabihf-gcc-4.8
如果要修改 /usr/bin/arm-linux-gnueabihf-gcc 指向 arm-linux-gnueabihf-gcc-4.7 也很容易,
重新执行一次 ln 命令即可。
yunge@ubuntu:/tmp/pc_simulator$ ls /usr/bin/arm-linux-gnueabihf-* -l
-rwxr-xr-x 1 root root 27720 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-addr2line
-rwxr-xr-x 2 root root 60456 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-ar
-rwxr-xr-x 2 root root 633856 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-as
-rwxr-xr-x 1 root root 27200 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-c++filt
lrwxrwxrwx 1 root root 27 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-cpp -> arm-linux-gnueabihf-cpp-4.8
-rwxr-xr-x 1 root root 562424 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-cpp-4.7
-rwxr-xr-x 1 root root 755408 Apr 1 2016 /usr/bin/arm-linux-gnueabihf-cpp-4.8
-rwxr-xr-x 1 root root 2814104 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-dwp
-rwxr-xr-x 1 root root 31504 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-elfedit
lrwxrwxrwx 1 root root 27 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-gcc -> arm-linux-gnueabihf-gcc-4.8
-rwxr-xr-x 1 root root 562424 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-gcc-4.7
-rwxr-xr-x 1 root root 755408 Apr 1 2016 /usr/bin/arm-linux-gnueabihf-gcc-4.8
-rwxr-xr-x 1 root root 26952 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-gcc-ar-4.7
-rwxr-xr-x 1 root root 26976 Apr 1 2016 /usr/bin/arm-linux-gnueabihf-gcc-ar-4.8
-rwxr-xr-x 1 root root 26952 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-gcc-nm-4.7
-rwxr-xr-x 1 root root 26976 Apr 1 2016 /usr/bin/arm-linux-gnueabihf-gcc-nm-4.8
-rwxr-xr-x 1 root root 26952 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-gcc-ranlib-4.7
-rwxr-xr-x 1 root root 26976 Apr 1 2016 /usr/bin/arm-linux-gnueabihf-gcc-ranlib-4.8
lrwxrwxrwx 1 root root 28 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-gcov -> arm-linux-gnueabihf-gcov-4.8
-rwxr-xr-x 1 root root 215760 Feb 26 2014 /usr/bin/arm-linux-gnueabihf-gcov-4.7
-rwxr-xr-x 1 root root 318368 Apr 1 2016 /usr/bin/arm-linux-gnueabihf-gcov-4.8
-rwxr-xr-x 1 root root 98536 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-gprof
-rwxr-xr-x 4 root root 521488 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-ld
-rwxr-xr-x 4 root root 521488 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-ld.bfd
-rwxr-xr-x 2 root root 3965664 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-ld.gold
-rwxr-xr-x 2 root root 40728 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-nm
-rwxr-xr-x 2 root root 220144 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-objcopy
-rwxr-xr-x 2 root root 343400 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-objdump
-rwxr-xr-x 2 root root 60456 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-ranlib
-rwxr-xr-x 1 root root 434928 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-readelf
-rwxr-xr-x 1 root root 31656 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-size
-rwxr-xr-x 1 root root 27616 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-strings
-rwxr-xr-x 2 root root 220152 Jul 7 2015 /usr/bin/arm-linux-gnueabihf-strip
2. 不是 apt-get 安装的不行,是刚好你安装的那个gcc版本没有重定位,或者有其他冲突, buildroot拒绝了执行。
3. 默认root登陆, 无密码.
在线
账户root密码空,登录也报错。不过这个通过选中那个选项解决了,不纠结这个了。
再次感谢,暂无问题了。
离线
晕哥,按上面方法出错了,
是什么问题
离线
/usr/local/arm_linux_4.8/bin/bin/armeb-linux-xxxxxxxxxxxx
貌似路径错了.
多了 bin了
离线
各位大神,不知道是buildroot问题,还是我的软件源的问题,attr-2.4.47 下载了一天了都没反应 是什么问题?
https://whycan.cn/files/members/404/IMG_20180619_180943.jpeg
离线
晕哥 说:/usr/local/arm_linux_4.8/bin/bin/armeb-linux-xxxxxxxxxxxx
貌似路径错了.
多了 bin了
晕哥,是不buildroot问题,还是我的软件源的问题,attr-2.4.47 下载了一天了都没反应 是什么问题?
离线
碰到这种情况, 你直接搜 attr-2.4.47.src.tar.gz, 然后用 wget 命令直接下载到 dl 目录即可.
https://download-mirror.savannah.gnu.org/releases/attr/
https://download-mirror.savannah.gnu.org/releases/attr/attr-2.4.47.src.tar.gz
在线
用Linaro或CodeBench的不好吗?
离线
晕哥 ,我也遇到类似交叉编译不匹配的现象。 toolchain-external-custom Configuring
Distribution toolchains are unsuitable for use by Buildroot,
as they were configured in a way that makes them non-relocatable,
and contain a lot of pre-built libraries that would conflict with
the ones Buildroot wants to build.
package/pkg-generic.mk:224: recipe for target '/opt/buildroot-2017.11/output/build/toolchain-external-custom/.stamp_configured' failed
make: *** [/opt/buildroot-2017.11/output/build/toolchain-external-custom/.stamp_configured] Error 1
any@Any-Desktop-PC:/opt/buildroot-2017.11$
离线
我用别的交叉编译库替换利用buildroot编译好的文件系统下的lib库所有内容,为什么起不来?
离线
>>> toolchain-external-custom Configuring
Incorrect selection of kernel headers: expected 2.6.x, got 4.10.x
package/pkg-generic.mk:228: recipe for target '/root/Documents/F1C100S/buildroot-2019.11/output/build/toolchain-external-custom/.stamp_configured' failed
make: *** [/root/Documents/F1C100S/buildroot-2019.11/output/build/toolchain-external-custom/.stamp_configured] Error 1
我的提示这个错误
离线
你用的是外部toolchain?
离线
kernel header (2.6.x) 那里改选 4.10.x
上面的改过来 了,编译了好久, 然后遇到问题了, 是不是 arm-linux-gnueabi_7.x 不支持?
arm-none-linux-gnueabihf_9.2 这个不行,
arm-none-linux-gnueabi_9.x的没找到
错误提示如下:
root@ubuntu:~/Documents/F1C100S/buildroot-2019.11# make
>>> toolchain-external-custom Configuring
Incorrect selection of the C library
package/pkg-generic.mk:228: recipe for target '/root/Documents/F1C100S/buildroot-2019.11/output/build/toolchain-external-custom/.stamp_configured' failed
make: *** [/root/Documents/F1C100S/buildroot-2019.11/output/build/toolchain-external-custom/.stamp_configured] Error 255
root@ubuntu:~/Documents/F1C100S/buildroot-2019.11#
离线
才想起,buildroot-2019.11 是这个版本的,会不会 arm-linux-gnueabi_7.x 不支持
离线
学习了!
离线
没记错的话,按照linaro的重新编译一个就好了,主要所sysroot的逻辑必须要配置正确,否则识别不了,其他问题倒是没发现
离线
外部工具链这个好, 以后Windows编译Linux app方便了。
离线