LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mageia (https://www.linuxquestions.org/questions/mageia-97/)
-   -   Cross-compiler to ARMv7 (https://www.linuxquestions.org/questions/mageia-97/cross-compiler-to-armv7-4175588851/)

mackowiakp 09-06-2016 08:25 AM

Cross-compiler to ARMv7
 
How can I cross compile program to ARMv7 prosessor on Mageia 5? Where is no (like in Ubuntu) gcc-arm-linux-gnueabihf in Mageia repo. Can I port something from other source?

rtmistler 09-06-2016 12:37 PM

What package manager does Mageia have? You can't search in a repository for the gnueabi tools? Another option is to build the gnueabi tools from source and install them on your machine. I don't know if one of the Linux download links here is the source tarball for the toolchain https://launchpad.net/gcc-arm-embedded, but it's worth a look.

For what it's worth, if you have room on your target, try to build on the target. I've used cross compilers before, but usually a company has to set them up for me, meaning I've purchased it, and had their experts set up a framework to cross compile and deploy. Every time I try to install a tool chain to cross compile, I can get it to work, but eventually something breaks the situation, like needing a special library and not having had the library path properly set up, etc.

mackowiakp 09-10-2016 09:00 AM

Yep, You are right. I decided to create native environment for compilation of programs on ARMv7 platform. I have a router Asus RT-AC68R based on ARMv7, with TomatoUSB software installed on it. I plugged into a USB port, 32GB pen and I mounted it to /opt. Then I have uploaded entware (not optware), several applications form entware and the GCC compiler + all dependings on what opkg considered for use together with gcc.
I have a strange situation. I'm trying to compile the simplest possible programs for testing:

Code:

#include <stdio.h>

int main ()
{
    printf ( "Hello World");
}

I do this by using the command - gcc -o test test.c - where test.c is the program above.
then I try to run this program and I get the following message:

Code:

root @ asus: /opt/FTDI # ./test
-sh: ./test: not found
root @ asus: /opt/FTDI # ls -la test
-rwxr-xr-x 1 root root 5580 Sep 10 9:33 test

shell tells me that there is no such program, although as you can see there is any, and is executable for all.

I have no idea what it might be caused. Can someone help me?
Here are a few additional information straight from Asus:

Code:

root@asus:/opt/FTDI# echo $PATH
/opt/bin:/opt/sbin:/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/home/root:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin:
root@asus:/opt/FTDI# echo $LD_LIBRARY_PATH
/lib:/usr/lib:/usr/local/lib:/opt/lib:/opt/usr/lib:/opt/include
root@asus:/opt/FTDI# opkg list-installed|grep gcc
gcc - 5.4.0-1
libgcc - 5.4.0-5
root@asus:/opt/FTDI# uname -a
Linux asus 2.6.36.4brcmarm #5 SMP PREEMPT Tue Aug 16 22:49:47 CEST 2016 armv7l GNU/Linux

Any idea whats going wrong?


All times are GMT -5. The time now is 09:35 PM.