Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » GCC Cross compiler configuration (GCC )
GCC Cross compiler configuration [message #1770186] Tue, 08 August 2017 23:00 Go to next message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
In the Cross compiler prefix text box, enter arm-none-eabi-, including the hyphen (-) at the end, to specify the correct compiler for Armstrap targets.

In the Cross compiler path text box, browse to the location of the <user>/Desktop/armstrap/gcc-arm/bin directory to specify the location of the compiler.


OK , building cross compiled project , thus selecting GCC cross
Now I need to configure Cross compiler prefix and Cross compiler path.
I COULD just "cut and paste " from the above example, but I like to know why.
How are these entries made , what resources are needed.


For example where do I get the (embedded hardware ) target name from BEFORE I start building my
new project.

Is "make target" same as cross compiler target?
Probably not because it can be "made" after the project is build.

Update
OK , found this under in /usr/bin on the target hardware
arm-linux-gnueabihf-gcc-4.9
is that "GCC prefix " ?


Question
If I want to continue discussion should I edit the OP or add to it?

OK, I got few @problems@ configuring cross GCC
When I add JUST the above prefix and press a button the Eclipse "takes off" and I loose control of configuration.
If I just press "browse" to look for the location of GCC on the host (RPI) I get to choose from "This computer". That tells me that I need to have some path directing me to the host already. There are samples of code for Windows , but nothing to tell me how to set the path to the host in Linux.
Perhaps something like this <user>/Desktop/armstrap/gcc-arm/bin ?

Apparently incorrect GCC path triggers @New Connection@ which it really confusing at this point since I do not have "Targer" specified , not yet.





[Updated on: Wed, 09 August 2017 13:59]

Report message to a moderator

Re: GCC Cross compiler configuration [message #1770217 is a reply to message #1770186] Wed, 09 August 2017 07:33 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
You need the compiler on your host machine, the same one Eclipse is on.

The prefix is the part up to, but not including the gcc.
The path is the directory on your host machine that the target compiler is installed.

[Updated on: Wed, 09 August 2017 14:00]

Report message to a moderator

Re: GCC Cross compiler configuration [message #1770256 is a reply to message #1770217] Wed, 09 August 2017 12:52 Go to previous messageGo to next message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
Thanks
So I need just the bin path for now, right?


pi@pi:~ $ whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc
pi@pi:~ $
Re: GCC Cross compiler configuration [message #1770268 is a reply to message #1770256] Wed, 09 August 2017 13:59 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Quote:
You need the compiler on your host machine, the same one Eclipse is on.


Is eclipse on your pi?

[Updated on: Wed, 09 August 2017 14:00]

Report message to a moderator

Re: GCC Cross compiler configuration [message #1770269 is a reply to message #1770268] Wed, 09 August 2017 14:01 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
For example I have /scratch/arm/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc as my cross compiler on my host machine.

Then my prefix is arm-none-eabi- and my path is /scratch/arm/gcc-arm-none-eabi-4_9-2015q3/bin
Re: GCC Cross compiler configuration [message #1770317 is a reply to message #1770269] Wed, 09 August 2017 22:31 Go to previous messageGo to next message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
So I need to identify the entire path to my (cross) compiler on the host , where my finished executable will be,
and it is not /usr/bin/gcc ?

Am I looking for "arm " GCC ? My host is ARM architecture.

Apparently this package is missing from my OS
whereis gcc-arm-none-eabi



but my prefix is correct arm-linux-gnueabihf-gcc-4.9

I think I can figure it now, thanks.

[Updated on: Wed, 09 August 2017 22:52]

Report message to a moderator

Re: GCC Cross compiler configuration [message #1770341 is a reply to message #1770317] Thu, 10 August 2017 07:33 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Vaclav,

Google for 'raspberry cross compile eclipse' and read the answers.

You did not tell your host system (Windows, Linux, OS X, else...), but there are responses for every of them.

You could start at <https://raspberrypi.stackexchange.com/questions/27163/cross-compiling-with-windows-using-eclipse>.


--

Tauno Voipio
Re: GCC Cross compiler configuration [message #1770343 is a reply to message #1770341] Thu, 10 August 2017 07:40 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Quote:
whereis gcc-arm-none-eabi


You need to download/install a cross compiler for your board. I don't expect cross compilers for every board to be available in a package manager.

Quote:
but my prefix is correct arm-linux-gnueabihf-gcc-4.9

No.
Re: GCC Cross compiler configuration [message #1770352 is a reply to message #1770317] Thu, 10 August 2017 09:57 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Vaclav Sal wrote on Thu, 10 August 2017 01:31
So I need to identify the entire path to my (cross) compiler on the host , where my finished executable will be,
and it is not /usr/bin/gcc ?

Am I looking for "arm " GCC ? My host is ARM architecture.

Apparently this package is missing from my OS
whereis gcc-arm-none-eabi



but my prefix is correct arm-linux-gnueabihf-gcc-4.9

I think I can figure it now, thanks.


You seem to mix up the compilers generating code for the computer it is run on (usually called 'host').

You *do* need an 'arm-linux-gnueabihf-' toolset on your host computer for Pi. Please note that there is more than just gcc in the toolset:
- gcc (with cc1 and cpp)
- as
- ld
- other binary uitlities
- runtime libraries
- linker scripts for target

arm-none-eabi- toolset is targeted for raw hardware, mostly small embedded chips. It is not the right one for Raspberry Pi.

Please read the references I showed in previous post.


--

Tauno Voipio
Re: GCC Cross compiler configuration [message #1770398 is a reply to message #1770352] Thu, 10 August 2017 17:09 Go to previous messageGo to next message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
Tauno Voipio wrote on Thu, 10 August 2017 09:57
Vaclav Sal wrote on Thu, 10 August 2017 01:31
So I need to identify the entire path to my (cross) compiler on the host , where my finished executable will be,
and it is not /usr/bin/gcc ?

Am I looking for "arm " GCC ? My host is ARM architecture.

Apparently this package is missing from my OS
whereis gcc-arm-none-eabi



but my prefix is correct arm-linux-gnueabihf-gcc-4.9

I think I can figure it now, thanks.


You seem to mix up the compilers generating code for the computer it is run on (usually called 'host').

You *do* need an 'arm-linux-gnueabihf-' toolset on your host computer for Pi. Please note that there is more than just gcc in the toolset:
- gcc (with cc1 and cpp)
- as
- ld
- other binary uitlities
- runtime libraries
- linker scripts for target

arm-none-eabi- toolset is targeted for raw hardware, mostly small embedded chips. It is not the right one for Raspberry Pi.

Please read the references I showed in previous post.


Yes, I am pretty mixed up - it is a long and crooked way from "cross GCC"
to ARM compiler (toolset) build for specific hardware.
The terminology is not always intuitive - in SSH I have server and client , in "cross compiling " I have a "host".
So what do you call the machine where I am using Eclipse to write the software on ?

Anyway, I did some research before posting here and still not sure how "prefix" gets to be AFTER the path entry.
Should prefix be in FRONT?

I sure appreciate all the help I am getting here, you guys are awesome.
Thanks


Re: GCC Cross compiler configuration [message #1770401 is a reply to message #1770398] Thu, 10 August 2017 18:26 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Did you read and follow the instructions at <https://raspberrypi.stackexchange.com/questions/27163/cross-compiling-with-windows-using-eclipse>?


--

Tauno Voipio
Re: GCC Cross compiler configuration [message #1770410 is a reply to message #1770401] Fri, 11 August 2017 01:31 Go to previous messageGo to next message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
Did not read it in details, not yet.
But been thru similar " how to" without knowing that I need cross GCC for Raspberry PI.
That really helps now.
Been busy trying to replace Raspbian OS on Pi and updating hardware on my PC.
Re: GCC Cross compiler configuration [message #1770524 is a reply to message #1770401] Mon, 14 August 2017 00:06 Go to previous message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
OK, I got thru the TCF tutorial , not sure how to actually implement Agent, but working on that.

Now onto croos GCC

There reference posted is OK, but it does not tell me I need specific ARM Cross GCC for Raspberry ,
it is just "cut and paste " without much explanation why.
"cut and paste" does not work for me well. Sorry.

Previous Topic:Fake Errors
Next Topic:CDT Process Type: ADDFILES
Goto Forum:
  


Current Time: Wed Apr 24 14:53:58 GMT 2024

Powered by FUDForum. Page generated in 0.05641 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top