Preferred Installation Location

Asked by Chris Rhodin

I'm using the compiler on a Linux system. Assuming I have no conflicts with existing files (which I don't) is there any reason I can't install the compiler in /usr? This appears to work fine and saves me the hassle of modifying my environment.

Along the same lines, gcc has a way of specifying the architecture and revision of the compiler on the command line. My interest in this is not so much in the selection of the compiler as it is in checking the compiler when I resurrect an old project. If I install the compiler in /usr will this work?

Chris

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
Terry Guo (terry.guo) said :
#1

I think it's ok to install in /usr when there is no conflicts. Actually for Ubuntu, we have ppa format which will install tool chain in /usr, of course the sudo permission is needed.

what do you mean "specify the revision of compiler on the command line"? Can you please give an example?

Revision history for this message
Chris Rhodin (crhodin) said :
#2

These may be deprecated options, I got them from a 2.95 hard copy manual. The options are "-b machine" and -V "version". For example (foo.c is empty):

crhodin@devpc3:~/bin$ gcc -b arm-none-eabi foo.c
/usr/bin/gcc: error trying to exec '/usr/bin/arm-none-eabi-gcc-4.4.5': execvp: No such file or directory
crhodin@devpc3:~/bin$ gcc -b arm-none-eabi -V 4.7.4 foo.c
/usr/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
/usr/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/crt0.o: In function `start':
(.text+0xec): undefined reference to `main'
collect2: error: ld returned 1 exit status

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

Chris,

I don't expect "gcc -b arm-none-eabi" to fully work, as the driver gcc
should be correctly configured and built for ARM.

However, in your case "gcc -b arm-none-eabi -V 4.7.4 foo.c", it actaully
works, if only you give more options to find libraries. Try "gcc -b
arm-none-eabi -V 4.7.4 foo.c -lc -lc -lnosys" to see if it links.

- Joey

On Tue, Oct 8, 2013 at 5:01 AM, Chris Rhodin <
<email address hidden>> wrote:

> Question #236799 on GCC ARM Embedded changed:
> https://answers.launchpad.net/gcc-arm-embedded/+question/236799
>
> Chris Rhodin gave more information on the question:
> These may be deprecated options, I got them from a 2.95 hard copy
> manual. The options are "-b machine" and -V "version". For example
> (foo.c is empty):
>
> crhodin@devpc3:~/bin$ gcc -b arm-none-eabi foo.c
> /usr/bin/gcc: error trying to exec '/usr/bin/arm-none-eabi-gcc-4.4.5':
> execvp: No such file or directory
> crhodin@devpc3:~/bin$ gcc -b arm-none-eabi -V 4.7.4 foo.c
> /usr/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o):
> In function `exit':
> exit.c:(.text.exit+0x2c): undefined reference to `_exit'
> /usr/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/crt0.o:
> In function `start':
> (.text+0xec): undefined reference to `main'
> collect2: error: ld returned 1 exit status
>
> --
> 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 Chris Rhodin for more information if necessary.

To post a message you must log in.