admin管理员组文章数量:1330632
I have begun to work on a Beaglebone Black for a school project, and we have been using Buildroot in order to build our custom images. Right now we are working with a basic 5.3 image.
We use Buildroot-2022.02.9.
For the image, we go from a beaglebone_defconfig using a make beaglebone_defconfig
we use a custom "Kernel version" in buildroot -5.3 version. And in the Toolchain menu, in the Kernel Headers we choose it to be the same as the kernel being built, and in Custom kernel headers series we choose 5.3.x.
The objective is to cross-compile a C program which will utilize the LEDs of the Beaglebone, but I am running tests with only a helloworld program and it doesn't work.
Also, the helloworld file is transfered using tftp and I see it in my directory using ls, and I've added the executable flag, just to tell you that it exists on my beaglebone.
Here's the issue:
When I run the helloworld file on my beaglebone after I've compiled it on my VM - , I get this error message :
-sh: ./helloworld: not found
At first, I thought I was using the wrong compiler, so I've used many. I can list :
arm-linux-gnueabihf
arm-linux-gnueabi
And I've tried many versions of those two toolchains. The prompt I give is simply:
arm-linux-gnueabihf-gcc helloworld.c –o helloworld
So I've done my research, and I've found that the message -sh: ./helloworld: not found
was misleading - see the verified answer on this post : Why can't I run custom application on my Beaglebone board?
So it is a dynamic linker problem, which in my case for the file when I look for it using readelf -a
is: /lib/ld-linux.so.3.
So, considering that it wasn't being found, I proceeded to search it on the /lib/ directory on my Beagleboard.
Turns out I don't even have it, not any single version of it.
My guess is that I should include it in my configuration when customizing it with buildroot, but I don't know how to set it and which one to choose being new on the topic.
Thus, what I need to do is use the correct cross-toolchain (which uses the same C library version) for the rootfs I am using or build a new rootfs with the same toolchain.
In buildroot, the C-library used when I go to the toolchain menu is uClibc-ng
,so I've tried to set it to glibc
but all I get is an error during the make process.
I have begun to work on a Beaglebone Black for a school project, and we have been using Buildroot in order to build our custom images. Right now we are working with a basic 5.3 image.
We use Buildroot-2022.02.9.
For the image, we go from a beaglebone_defconfig using a make beaglebone_defconfig
we use a custom "Kernel version" in buildroot -5.3 version. And in the Toolchain menu, in the Kernel Headers we choose it to be the same as the kernel being built, and in Custom kernel headers series we choose 5.3.x.
The objective is to cross-compile a C program which will utilize the LEDs of the Beaglebone, but I am running tests with only a helloworld program and it doesn't work.
Also, the helloworld file is transfered using tftp and I see it in my directory using ls, and I've added the executable flag, just to tell you that it exists on my beaglebone.
Here's the issue:
When I run the helloworld file on my beaglebone after I've compiled it on my VM - , I get this error message :
-sh: ./helloworld: not found
At first, I thought I was using the wrong compiler, so I've used many. I can list :
arm-linux-gnueabihf
arm-linux-gnueabi
And I've tried many versions of those two toolchains. The prompt I give is simply:
arm-linux-gnueabihf-gcc helloworld.c –o helloworld
So I've done my research, and I've found that the message -sh: ./helloworld: not found
was misleading - see the verified answer on this post : Why can't I run custom application on my Beaglebone board?
So it is a dynamic linker problem, which in my case for the file when I look for it using readelf -a
is: /lib/ld-linux.so.3.
So, considering that it wasn't being found, I proceeded to search it on the /lib/ directory on my Beagleboard.
Turns out I don't even have it, not any single version of it.
My guess is that I should include it in my configuration when customizing it with buildroot, but I don't know how to set it and which one to choose being new on the topic.
Thus, what I need to do is use the correct cross-toolchain (which uses the same C library version) for the rootfs I am using or build a new rootfs with the same toolchain.
In buildroot, the C-library used when I go to the toolchain menu is uClibc-ng
,so I've tried to set it to glibc
but all I get is an error during the make process.
1 Answer
Reset to default 2I found where the adapted toolchain compiler is :
~/Documents/buildroot/output/host/bin/arm-buildroot-linux-uclibcgnueabihf-gcc
The command line is then very simple:
~/Documents/buildroot/output/host/bin/arm-buildroot-linux-uclibcgnueabihf-gcc -o hello hello.c
You can obviously add it to PATH environment variable.
本文标签: cCross compilation doesn39t work for my Beaglebone Black because of dynamic linkerStack Overflow
版权声明:本文标题:c - Cross compilation doesn't work for my Beaglebone Black because of dynamic linker - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742265005a2443222.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论