Configuring linaro toolcahin to cross compile .c file

Asked by swati

hi.. i have ubuntu 12.04 on desktop. i have got linaro toolchaion from this link https://launchpad.net/linaro-toolchain-binaries/+milestone/2012.04 .
 then extracted linux binary gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux.tar.bz2 and followed these commnads:
tar xjf gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux.tar.bz2

i tried this!!
 export ARM_CROSS_TOOLS=pwd/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi- export ARMCC=${ARMEL_CROSS_TOOLS}gcc

& then

$ARMCC hello.c

now if i want to compile simple .c file, how can i do it with gcc-linaro-arm-linux-gnueabi, so that i can run the output file on Linaro(hackberry)?

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Zhenqiang Chen (zhenqiang-chen) said :
#1

Thank you for try our toolchain.

This link is for Embedded toolchain. For Linaro toolchain, please ask question at:

https://launchpad.net/linaro-toolchain-binaries

For your issue, you defined "ARM_CROSS_TOOLS" but use "ARMEL_CROSS_TOOLS". So ARMCC is native "gcc"

Revision history for this message
swati (swati-deshmukh) said :
#2

thnx for replying me!!
now i did export ARMCC=${ARM_CROSS_TOOLS}gcc
and then
ARMCC hello.c

but still i am getting ARMCC command not found error

Revision history for this message
Zhenqiang Chen (zhenqiang-chen) said :
#3

pwd should be `pwd`.

Revision history for this message
swati (swati-deshmukh) said :
#4

See my env variables are these:

echo $ARM_CROSS_TOOLS
/home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/arm-linux-gnueabi/bin/
pcadmin@pcadmin-ThinkCentre-M90:~$ echo $ARMCC
/home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/arm-linux-gnueabi/bin/gcc

my hello.c is in /home/pcadmin

now whetn i m doing this
$ARMCC hello.c -------m getting error here---
gcc: error trying to exec 'cc1': execvp: No such file or directory

________________________________________
From: <email address hidden> [<email address hidden>] On Behalf Of Zhenqiang Chen [<email address hidden>]
Sent: Thursday, February 07, 2013 10:45 AM
To: Swati Deshmukh
Subject: Re: [Question #221190]: Configuring linaro toolcahin to cross compile .c file

Your question #221190 on GCC ARM Embedded changed:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

Zhenqiang Chen proposed the following answer:

pwd should be `pwd`.

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190/+confirm?answer_id=2

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

You received this question notification because you asked the question.

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"

Revision history for this message
Zhenqiang Chen (zhenqiang-chen) said :
#5

Your ARMCC should be /home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi-gcc

not

/home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/arm-linux-gnueabi/bin/gcc

Revision history for this message
swati (swati-deshmukh) said :
#6

yes Zhenqiang!
 i tried that also.. but now effect..
this .tar file works as it is right? it does not need any istallation?

please suggest me some way
________________________________________
From: <email address hidden> [<email address hidden>] On Behalf Of Zhenqiang Chen [<email address hidden>]
Sent: Thursday, February 07, 2013 12:01 PM
To: Swati Deshmukh
Subject: Re: [Question #221190]: Configuring linaro toolcahin to cross compile .c file

Your question #221190 on GCC ARM Embedded changed:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

    Status: Open => Answered

Zhenqiang Chen proposed the following answer:

Your ARMCC should be /home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi-gcc

not

/home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/arm-
linux-gnueabi/bin/gcc

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190/+confirm?answer_id=4

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

You received this question notification because you asked the question.

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"

Revision history for this message
swati (swati-deshmukh) said :
#7

is it related to PATH issue?
________________________________________
From: <email address hidden> [<email address hidden>] On Behalf Of Zhenqiang Chen [<email address hidden>]
Sent: Thursday, February 07, 2013 12:01 PM
To: Swati Deshmukh
Subject: Re: [Question #221190]: Configuring linaro toolcahin to cross compile .c file

Your question #221190 on GCC ARM Embedded changed:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

    Status: Open => Answered

Zhenqiang Chen proposed the following answer:

Your ARMCC should be /home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi-gcc

not

/home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/arm-
linux-gnueabi/bin/gcc

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190/+confirm?answer_id=4

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

You received this question notification because you asked the question.

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"

Revision history for this message
Zhenqiang Chen (zhenqiang-chen) said :
#8
Revision history for this message
swati (swati-deshmukh) said :
#9

no... i am not gettting it!!

________________________________________
From: <email address hidden> [<email address hidden>] On Behalf Of Zhenqiang Chen [<email address hidden>]
Sent: Thursday, February 07, 2013 12:56 PM
To: Swati Deshmukh
Subject: Re: [Question #221190]: Configuring linaro toolcahin to cross compile .c file

Your question #221190 on GCC ARM Embedded changed:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

    Status: Open => Answered

Zhenqiang Chen proposed the following answer:

Please read README.txt at https://launchpad.net/linaro-toolchain-binaries/+milestone/2012.04

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190/+confirm?answer_id=7

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

You received this question notification because you asked the question.

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"

Revision history for this message
swati (swati-deshmukh) said :
#10

i tried setting PATH
now my path varisble is -->
echo $PATH
Result: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/pcadmin/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin
still no effect
________________________________________
From: <email address hidden> [<email address hidden>] On Behalf Of Zhenqiang Chen [<email address hidden>]
Sent: Thursday, February 07, 2013 12:56 PM
To: Swati Deshmukh
Subject: Re: [Question #221190]: Configuring linaro toolcahin to cross compile .c file

Your question #221190 on GCC ARM Embedded changed:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

    Status: Open => Answered

Zhenqiang Chen proposed the following answer:

Please read README.txt at https://launchpad.net/linaro-toolchain-binaries/+milestone/2012.04

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190/+confirm?answer_id=7

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

You received this question notification because you asked the question.

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"

Revision history for this message
Zhenqiang Chen (zhenqiang-chen) said :
#11

What does "no effect" mean?

What's the output of the following command?

which arm-linux-gnueabi-gcc

Revision history for this message
swati (swati-deshmukh) said :
#12

i got that cc1 error solved.. it was not executable. i changed its permission..
but now anothr thning about "march"

 sudo $ARMCC hello.c
Assembler messages:
Fatal error: invalid -march= option: `armv7-a'

________________________________________
From: <email address hidden> [<email address hidden>] On Behalf Of Zhenqiang Chen [<email address hidden>]
Sent: Thursday, February 07, 2013 2:25 PM
To: Swati Deshmukh
Subject: Re: [Question #221190]: Configuring linaro toolcahin to cross compile .c file

Your question #221190 on GCC ARM Embedded changed:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

    Status: Open => Answered

Zhenqiang Chen proposed the following answer:

What does "no effect" mean?

What's the output of the following command?

which arm-linux-gnueabi-gcc

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190/+confirm?answer_id=10

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/gcc-arm-embedded/+question/221190

You received this question notification because you asked the question.

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"

Revision history for this message
Joey Ye (jinyun-ye) said :
#13

Guys, please remove the confidential disclaim in your email response.

Swati, since the compiler can run now, can you please follow the gcc user manual? Or if you need further help can you please share your exact command line with -march problem, so that we might take a look.

Thanks - Joey

Revision history for this message
swati (swati-deshmukh) said :
#14

this is the error i am getting..
sudo $ARMCC hello.c
Assembler messages:
Fatal error: invalid -march= option: `armv7-a'

how to manually configure it?

Revision history for this message
Joey Ye (jinyun-ye) said :
#15

Strange. Can you reinstall it with appropriate permission and exactly
follow readme?

By the way, this is a linaro problem that better to go that forum.
On Feb 7, 2013 6:41 PM, "swati" <email address hidden>
wrote:

> Question #221190 on GCC ARM Embedded changed:
> https://answers.launchpad.net/gcc-arm-embedded/+question/221190
>
> swati posted a new comment:
> this is the error i am getting..
> sudo $ARMCC hello.c
> Assembler messages:
> Fatal error: invalid -march= option: `armv7-a'
>
>
> how to manually configure it?
>
> --
> You received this question notification because you are an answer
> contact for GCC ARM Embedded.
>

Revision history for this message
swati (swati-deshmukh) said :
#16

it was the probelm of .tar file.. i reisntalled it.. it worked fine..
hello.c cross compiled successfully!!
 $ file a.out
 a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x6095506510e3dcd07d84cbb5e4122fe9a937859c, not stripped

but i tried to execute ./a.out on linaro.. it says: bash:no such file or directory

Revision history for this message
Joey Ye (jinyun-ye) said :
#17

Compile option doesn't match you os. Check fpu settings of your compiler
and os
On Feb 8, 2013 2:06 PM, "swati" <email address hidden>
wrote:

> Question #221190 on GCC ARM Embedded changed:
> https://answers.launchpad.net/gcc-arm-embedded/+question/221190
>
> swati posted a new comment:
> it was the probelm of .tar file.. i reisntalled it.. it worked fine..
> hello.c cross compiled successfully!!
> $ file a.out
> a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically
> linked (uses shared libs), for GNU/Linux 2.6.16,
> BuildID[sha1]=0x6095506510e3dcd07d84cbb5e4122fe9a937859c, not stripped
>
> but i tried to execute ./a.out on linaro.. it says: bash:no such file or
> directory
>
> --
> You received this question notification because you are an answer
> contact for GCC ARM Embedded.
>

Can you help with this problem?

Provide an answer of your own, or ask swati for more information if necessary.

To post a message you must log in.