Note that there are some explanatory texts on larger screens.

plurals
  1. POCross Compile helloworld.c to ARM (Cortex-A5)
    text
    copied!<p>I am trying to cross compile simple helloworld.c to run on ARM (Cortex-A5)</p> <p>I get the following error</p> <pre><code>gcc: error trying to exec 'cc1' execvp: No such file or directory </code></pre> <p><strong>HW/SW</strong>: SAMA5D31 processor, Android Linux</p> <p><strong>Host</strong>: Ubuntu 12.04</p> <p>Makefile </p> <pre><code>CC=/home/userid/android4sam_v4.0/cross_compile_mentor/arm-2013.05/bin/arm-none-linux-gnueabi-gcc CFLAG=I. helloworld:helloworld.o $(CC)-o helloworld helloworld.o -I. </code></pre> <p>I have compile the program on the host machine and works fine. Then I exported the cross compiler path and tried to compile</p> <p><strong>cross compiler path is</strong></p> <pre><code>/home/userid/android4sam_v4.0/cross_compiler_mentor/arm-2013.05/arm-none-linux-gnueabi/bin </code></pre> <p>Also read a few post pointing to GCC_EXEC_PREFIX (env). When I echo $GCC_EXEC_PREFIX, I don't get anything back. If this is the cause can someone suggest how to address the issue.</p> <p>Also I have read about defining -mcpu=cortex-A5. Is this necessary?</p> <p>Also I did a <strong><em>locate cc1</em></strong> found the following</p> <pre><code>/usr/lib/gcc/arm-linux-gnueabi/4.4.7/cc1 /usr/lib/gcc/arm-linux-gnueabi/4.6/cc1 </code></pre> <p>I also have looked at <a href="http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html" rel="nofollow">Environment Variables Affecting GCC</a> </p> <p>I also read something about "xgcc -B " I am not sure if this is relevant to addressing the issue.</p> <p>Output from <strong><em>gcc -print-search-dirs</em></strong></p> <pre><code>install: /usr/lib/gcc/x86_64-linux-gnu/4.6/ programs: =/usr/lib/gcc/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux- gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/bin/ libraries: =/usr/lib/gcc/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/:/lib/x86_64-linux-gnu/4.6/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/4.6/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../:/lib/:/usr/lib/ </code></pre> <p>Also following command compiled without any issues</p> <pre><code>arm-linux-gnueabi-gcc -o serial -static serial.c </code></pre> <p><strong>Update 12/1/2013</strong> The following issue was resolved by modifying the CC variable as Chris Stratton suggest </p> <pre><code>gcc: error trying to exec 'cc1' execvp: No such file or directory </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload