Home » Language IDEs » C / C++ IDE (CDT) » Adding new "toolchain" to Eclipse. (add toolchain )
Adding new "toolchain" to Eclipse. [message #1799172] |
Fri, 30 November 2018 20:14  |
Eclipse User |
|
|
|
Here are some results of my search for cross-compiling Eclipse for Raspberry Pi.
git clone https://github.com/raspberrypi/tools
The g++ compiler at
tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++
works to compile C or C++ code on my Pi Zero with Raspian Jessie. Interestingly, the gcc compiler in the same place did not work.
The post is pretty old so I am hoping somebody can help me in implementing this on Eclipse.
I did try to "implement" : this "tool in Build-> Setting but got lost.
I Eclipse terminology - I have can choose two "toolchains" Cross GSS and Linux GCC .
I can add / modify these "toolchains" or I should be able to ADD a new one using the downloaded "tools" from git.
I need , like ro have , step by step instruction on HOW. - to add new "toolchain".
Preferably to newest Eclipse 2018-09 - using its layout and terminology.
Can anybody help me ?
Any hint / help will be appreciated.
EDIT
OK, I have been doing my homework.
The standard " Cross prefix" in Eclipse IDE is " arm-linux-gnueabihf " .
Is this "prefix" part of the "toolchain" ?
Assuming "tools" folder is part of Linux (kernel?)
How is its purpose / function defined and where ?
/tools/arm-bcm2708
Where does the "subfolder " "arm-bcm2708" came from?
Stand-by for more silly questions...
[Updated on: Fri, 30 November 2018 21:33] by Moderator
|
|
| | | |
Re: Adding new "toolchain" to Eclipse. [message #1799202 is a reply to message #1799180] |
Sat, 01 December 2018 12:10   |
Eclipse User |
|
|
|
You most likely do not need to add a new tool chain to your Eclipse in order to build your program. You should be able to configure the Cross GCC tool chain to get what you want.
Cross compiling can be quite confusing so you need to make sure you have a clear understanding of the concept and terms particularly the difference between host and target. Here is a link that may help explain the concepts https://wiki.osdev.org/GCC_Cross-Compiler.
This explanation assumes that you are running Eclipse on a Windows/Linux/Mac PC and are attempting to compile for a target Rasberry Pi device. This is not a procedure for running a compiler on the target Rasberry Pi device. This is an important distinction. This host where the tools are running is different from the target where the resulting program will run.
If you intention is to run the build tools on the Rasberry Pi device that will also be running the resulting program, you don't need a cross compiler.
Make sure you have the Cross GCC tool chain installed in Eclipse. (Help->About Eclipse IDE, click Installation Details and look for C/C++ GCC Cross Compiler Support).
If it isn't installed, use the Help->Install New Software dialog to install it. Be sure to restart Eclipse after installing.
Configuring the tool
Open Project Properties and go to the Tool Chain Editor under the C/C++ Build section. Select Cross GCC in the Current Toolchain selection box.
Select the Settings section right above Tool Chain Editor under C/C++ Build.
On the Tool Settings tab, select the Cross Settings item at the very top. This displays two text fields Prefix and Path. These two fields are used to narrow down the numerous cross compiler tools to the specific set you are interested in. Building a program involves a number of tools. You need to use a combination of assemblers, compilers, archivers, and linkers to get the program. If you look closely at the various directories you pullled down from the rasberripi/tools github site, you will see that there are several files that all end in '*gcc', or '*g++', or *ar', etc. These are command suffixes that denote the various tools used. gcc will compiler C files, g++ will compile C++ files, etc. Also notice that there is a common prefix that begins the name of each tool such as 'bcm2708-*', or 'arm-bcm2708-linux-gnueabi-*'. This prefix specifies the target architecture that the tool is built for. Combining the prefix with the various command suffixes gives you the set of tools required for the target platform. This prefix string is what you place in the Prefix field of the Cross Settings.
The Path box should contain the absolute path to the folder where the tool chain files reside. If you have cloned the git repository into a directory called /tools and you want to use the tools in the arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/ folder, you would set the Path text field to 'tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/' This gives Eclipse the place to start looking for the tools. If you want to use the arm-linux-gnueabihf tools, you need to set the Prefix to 'arm-linux-gnueabihf-'.
Eclipse will now combine the combination of the Path and Prefix strings when picking the individual tools. For instance, the default command for the Cross GCC Compiler is gcc (This is the C compiler). Eclipse combines these three strings together to come up with a command 'tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc'. This will then be the command that is run when compiling C source files.
|
|
| |
Re: Adding new "toolchain" to Eclipse. [message #1799220 is a reply to message #1799210] |
Sun, 02 December 2018 12:50   |
Eclipse User |
|
|
|
David,
thanks very much for your post.
First I have to apology for "jumping the gun" with my (other) reset post.
Somehow, probably me, I quit getting notification from this thread and your
post cleared some of the questions. Thanks,.
Secondly it seems to be no win situation , again blame it on customer - me .
No matter how I post it is either "confusing" or I miss some important stuff and then get reply I really do not need.
There is no answer for that and I am sorry for unnecessarily wasting some poster's tine.
That out of the way , so if do not mind I will replay to parts I really need more help.
"If you look closely at the various directories you pullled down from the rasberripi/tools github site, you will see that there are several files that all end in '*gcc', or '*g++', or *ar', etc"
I have been jumping form Oxygen to Eclipse 2018-09 and honestly have no idea where to look for these.
I assume I'll find the correct ones in SAME folder I am running the Eclipse ( back to Oxygen) from.
Here is MY the absolute path media/jim/DEV/Eclipse_Oxugen_3A_CLEAN/eclipse/eclipse
I should be able to use "find " to verify, right?
When I first try to cross compile I was successful when I DID NOT specify the "path"
SO I got spoiled and now it came back to hunt me,
BTW - like to know how "make": finds the correct gcc /g to use without "path".
EDIT
See attached file
Since "arm-linux-gnueabihf" at lest works cross compiling for arm7 and came
with "default " download with Eclipse I'll stick with it for now.
At least until I figure out if I can ever get
to cross compile for "armv6l".
Seem unlikely after few weeks trying.
Since "/tools" came form 3rd party I need to find if it indeed will work for arm6.
I'll skip using it for now.
Thanks again,
PS
Just found "clone" of Raspberry Pi Zero with "arm7" processor - time to switch!
And all this "exercise" just because I picked WRONG product - again!
If you look closely at the various directories you pullled down from the rasberripi/tools github site, you will see that there are several files that all end in '*gcc', or '*g++', or *ar', etc.
Attachment: PATH
(Size: 33.35KB, Downloaded 492 times)
[Updated on: Sun, 02 December 2018 13:28] by Moderator
|
|
|
Re: Adding new "toolchain" to Eclipse. [message #1799228 is a reply to message #1799220] |
Sun, 02 December 2018 18:49  |
Eclipse User |
|
|
|
You seem to be confusing the things supplied by Eclipse with the things from other providers. Eclipse does not come with any C/C++ compilers, linkers, etc. Eclipse provides the UI that sits in front of these tools. The compilers all come from other providers. Either the OS provider that may include compilers, etc to develop software on the OS, or by third party providers that provide them for stand alone boards/computers such as Raspbery Pi or Arduino.
In your case, you downloaded tools from a RaspberyPi/tools Github repository. These appear to be cross compilers that can be used to build software for Raspbery Pi boards with various processor architectures. They are provided by the owner of the specific Github repository not by Eclipse. If you browse through the directory structure of that repository, you will be able to see the pattern that I discussed.
Eclipse is able to provide a UI to help with development because there are general conventions that tool providers follow to make it easier to work with their tools. One of those conventions appears to be to prefix all of the tools common for a specific architecture with a common string. These are then grouped together under a common folder that further identifies the architecture.
These are general conventions because there are no specific standards for the build tools. This tends to make C/C++ development quite difficult. You have to learn all the different tools required to build projects in addition to learning the language itself. When you venture into attempting to use one platform to build software that will run on a different platform, it drastically increased the complexity. However, it is possible to successfully navigate the complexity.
|
|
|
Goto Forum:
Current Time: Sat Jul 05 05:07:05 EDT 2025
Powered by FUDForum. Page generated in 0.04659 seconds
|