I wrote a simple batch script which is executed in Eclipse "Post-build Step". The script takes the executable name as an input and, by using Putty (SSH shell connectivity), copies the binary file on raspberry pi.
By using Putty it should be possible to run the gdbserver on the raspberry (still working on that). At the moment the biggest problem would be to cross compile, as Ian said, gdb..
-
- Posts: 21
- Joined: Fri Jun 29, 2012 9:34 pm
Re: Cross-Compiler for Windows
Have just built a cross compile version of gdb (softfp), will also build hardfp version and upload as soon as I get time.
Re: Cross-Compiler for Windows
Thank you very much Ian, I'm looking forward to it!IanLinsdell wrote:Have just built a cross compile version of gdb (softfp), will also build hardfp version and upload as soon as I get time.
I also tried to build my own toolchain by following your guide but without any luck. It fails with this error:
It doesn't matter which PPL version I select from crosstool-ng menu or which GCC flavour. Did you have the same error?[ERROR] make[4]: *** [Grid_Generator_System.lo] Error 1
[ALL ] In file included from /myCross/.build/src/ppl-0.11.1/src/Init.defs.hh:84,
[ALL ] from /myCross/.build/src/ppl-0.11.1/src/Init.cc:26:
[ALL ] /myCross/.build/src/ppl-0.11.1/src/Init.inlines.hh: In function `void Parma_Polyhedra_Library::restore_pre_PPL_rounding()':
[ERROR] /myCross/.build/src/ppl-0.11.1/src/Init.defs.hh:78: error: `Parma_Polyhedra_Library::fpu_rounding_direction_type Parma_Polyhedra_Library::Init::old_rounding_direction' is private
[ERROR] /myCross/.build/src/ppl-0.11.1/src/Init.inlines.hh:42: error: within this context
[ALL ] /myCross/.build/src/ppl-0.11.1/src/checked.inlines.hh:632: confused by earlier errors, bailing out
[ALL ] Makefile:1158: recipe for target `Init.lo' failed
I'm using crosstool-ng 1.15.3 with Linaro GCC (tried many Linaro version + Vanilla GCC 4.6.3).
-
- Posts: 21
- Joined: Fri Jun 29, 2012 9:34 pm
Re: Cross-Compiler for Windows
Humm... I did not have that error with PPL,(CT_PPL_VERSION="0.11.2")
There is a softfloat version of the crosscompiler and gdb now at: https://github.com/IanLinsdell/Raspberrypi
I was unable to use the Linario compiler as I was continually getting URL error when trying to pull source from the Linario repository.
I looked at their site and it looked like they had chosen to maintain the cross compile environment themselves with their own version of crosstool-ng which might explain the error when crosstools tried to download.
There is a softfloat version of the crosscompiler and gdb now at: https://github.com/IanLinsdell/Raspberrypi
I was unable to use the Linario compiler as I was continually getting URL error when trying to pull source from the Linario repository.
I looked at their site and it looked like they had chosen to maintain the cross compile environment themselves with their own version of crosstool-ng which might explain the error when crosstools tried to download.
-
- Posts: 21
- Joined: Fri Jun 29, 2012 9:34 pm
Re: Cross-Compiler for Windows
Added hardfloat version for Raspbian Image also at same location:
https://github.com/IanLinsdell/Raspberrypi
I have verified that the softfp version compiles and runs with a sample GTK application on QEMU
https://github.com/IanLinsdell/Raspberrypi
I have verified that the softfp version compiles and runs with a sample GTK application on QEMU
Re: Cross-Compiler for Windows
Thank you very much for your efforts, I'll test the hardfp ASAP.IanLinsdell wrote:Humm... I did not have that error with PPL,(CT_PPL_VERSION="0.11.2")
There is a softfloat version of the crosscompiler and gdb now at: https://github.com/IanLinsdell/Raspberrypi
I was unable to use the Linario compiler as I was continually getting URL error when trying to pull source from the Linario repository.
I looked at their site and it looked like they had chosen to maintain the cross compile environment themselves with their own version of crosstool-ng which might explain the error when crosstools tried to download.
Sadly, I'm using the very same PPL version. By the way, to use the Linaro compiler, I simply googled for the tar.bz2 file crosstool-ng was looking for and copied it inside the \tarballs subfolder. I issued again a crosstool-ng build command and it didn't try to download gcc anymore and used the one I provided. I'm on another machine now, I'll try to rebuild the toolchain here!
Re: Cross-Compiler for Windows
Ian, your GDB works flawlessly! Simply perfect!
I was able to remotely debug my software from my Windows 7 machine!
Awesome!
I'm writing a little tutorial with all the settings I used.
I was able to remotely debug my software from my Windows 7 machine!

I'm writing a little tutorial with all the settings I used.
-
- Posts: 21
- Joined: Fri Jun 29, 2012 9:34 pm
Re: Cross-Compiler for Windows
Hi Dexterp37,
Glad the GDB worked out.
I would be interested in your gdb tutorial and Eclipse settings.
Would be great if you could post it when you are done ?
Ian
Glad the GDB worked out.
I would be interested in your gdb tutorial and Eclipse settings.
Would be great if you could post it when you are done ?
Ian
Re: Cross-Compiler for Windows
Here we gotIanLinsdell wrote:Hi Dexterp37,
Glad the GDB worked out.
I would be interested in your gdb tutorial and Eclipse settings.
Would be great if you could post it when you are done ?
Ian

Remote cross-debugging from Windows to Raspberry Pi
Please let me know if does or doesn't work for you and again, thank you for your GCC compilers. Even on my home machine, I still have the PPL library problem so I'm not able to compile the Linaro tool chain.

-
- Posts: 21
- Joined: Fri Jun 29, 2012 9:34 pm
Re: Cross-Compiler for Windows
Thanks Dexterp37,
Nice article
Nice article

Re: Cross-Compiler for Windows
You might want to install qemu and qemu-arm on windows, you can then run a virtual RaspPi.
James
James
Re: Cross-Compiler for Windows
Just a last message: I finally compiled the whole Linaro tool chain!
You can find it at this address: https://github.com/Dexterp37/raspi-ar/t ... /toolchain

It contains hardfp version of linaro gcc and linaro gdb! Hope this helps!
You can find it at this address: https://github.com/Dexterp37/raspi-ar/t ... /toolchain

It contains hardfp version of linaro gcc and linaro gdb! Hope this helps!
Re: Cross-Compiler for Windows
Do you think it would be cheating to write the programme using Lazarus in windows and then install and use it with Lazarus on the RasPi?Toad King wrote:Does anybody know of any method for cross-compiling Ras-Pi programs/libraries from Windows? I know there are some Linux/Unix methods, but I can't find any from Windows. Am I going to be forced to use a virtual machine for it?
If discrimination is not challenged then we are effectively in collusion with the perpetrators of such behaviour:-Oxford dictionaries
- CasaDelGato
- Posts: 49
- Joined: Mon Jul 16, 2012 9:36 pm
Re: Cross-Compiler for Windows
So, where do I get this "cross-arm-gcc-softfp V1" package?CopperPhil wrote:Hi Dexterp37,
- install Eclipse with CDT
- install Cygwin
- extract cross-arm-gcc-softfpV1 somewhere (let's say in "...\toolchain")
Worlds only All Electric Ford F250
- CasaDelGato
- Posts: 49
- Joined: Mon Jul 16, 2012 9:36 pm
Re: Cross-Compiler for Windows
Thanks.
I downloaded the .cmake file ok, but the .rar file seems to be corrupt? 30KB and WinRar can't open it.
I downloaded the .cmake file ok, but the .rar file seems to be corrupt? 30KB and WinRar can't open it.
Worlds only All Electric Ford F250
Re: Cross-Compiler for Windows
The cmake file is needed if you are trying to build a cmake project with Cygwin.
For the toolchain, you need to download arm-unknown-linux-gnueabi_hardfp.rar
For the toolchain, you need to download arm-unknown-linux-gnueabi_hardfp.rar
- CasaDelGato
- Posts: 49
- Joined: Mon Jul 16, 2012 9:36 pm
Re: Cross-Compiler for Windows
As I said, the ...hardfp.rar file at github.com/Dexterp37 seems to be corrupt.
With the way this forum hides links, I hadn't realized 2 different links were provided in the earlier msg.
So I tried the .zip file from github.com/IanLinsdell/, and that also comes down as corrupt.
Either something is really hosed with my Firefox downloads, or both those files aren't really in the format they are saying they are in.
Would someone else please check to see that they can be downloaded AND opened with WinRar under MS WIndows?
With the way this forum hides links, I hadn't realized 2 different links were provided in the earlier msg.
So I tried the .zip file from github.com/IanLinsdell/, and that also comes down as corrupt.
Either something is really hosed with my Firefox downloads, or both those files aren't really in the format they are saying they are in.
Would someone else please check to see that they can be downloaded AND opened with WinRar under MS WIndows?
Worlds only All Electric Ford F250
Re: Cross-Compiler for Windows
Try to download the compressed repository from HERE. You will find the file in the toolchain folder.
Otherwise, use a git client to download it and you should have no problems!
Otherwise, use a git client to download it and you should have no problems!
- CasaDelGato
- Posts: 49
- Joined: Mon Jul 16, 2012 9:36 pm
- CasaDelGato
- Posts: 49
- Joined: Mon Jul 16, 2012 9:36 pm
Re: Cross-Compiler for Windows
I'm finally getting back to trying to set this up.
This may sound odd but, in Step 2, you said:
It sounds like we have multiple choices?
This may sound odd but, in Step 2, you said:
Exactly where do we get the Cross Compiler?IanLinsdell wrote:
2. Extract the cross compiler (If usnig QEMU to test your app use the soft float version) into the /opt
directory. e.g. C:\cygwin\opt\
Your expanded cross compiler should be expanded into the following directory:
e.g. C:\cygwin\opt\cross\x-tools\arm-unknown-linux-gnueabi
}
It sounds like we have multiple choices?
Worlds only All Electric Ford F250
Re: Cross-Compiler for Windows
The ones from Ian Linsdell can be downloaded from https://github.com/IanLinsdell/Raspberrypi
In my previous post I've also provided a link to the ones I've compiled. To recap
Ian Linsdell ( https://github.com/IanLinsdell/Raspberrypi )
- Soft fp Cross Compilers
- Hard fp Cross Compilers
Me (https://github.com/Dexterp37/raspi-ar/tree/development)
- Hard fp Linaro Cross Compilers (with GDB)
In my previous post I've also provided a link to the ones I've compiled. To recap
Ian Linsdell ( https://github.com/IanLinsdell/Raspberrypi )
- Soft fp Cross Compilers
- Hard fp Cross Compilers
Me (https://github.com/Dexterp37/raspi-ar/tree/development)
- Hard fp Linaro Cross Compilers (with GDB)
-
- Posts: 3
- Joined: Mon Aug 27, 2012 9:30 pm
Re: Cross-Compiler for Windows
I have been using the Cygwin arm-unknown-linux-gnueabi- and have noticed a bizzare issue.
I was attempting to make a librtmp.so.0 file for XBMC and I have compiled OpenSSL & zlib with no problem according to this site:
https://www.daphne-emu.com:9443/mediawi ... osscompile
The problem is that files seem to have strange sizes.
The librtmp.so.0 ends up 1.78MB according to ls in Cygwin and Windows, and the file seems it's normally to be around KBs not MBs.
I mean the outputed files seem to work but since I sometimes share my compiled files, people may end up thinking my files are infected or something is wrong with the strange file sizes.
I was attempting to make a librtmp.so.0 file for XBMC and I have compiled OpenSSL & zlib with no problem according to this site:
https://www.daphne-emu.com:9443/mediawi ... osscompile
The problem is that files seem to have strange sizes.
The librtmp.so.0 ends up 1.78MB according to ls in Cygwin and Windows, and the file seems it's normally to be around KBs not MBs.
I mean the outputed files seem to work but since I sometimes share my compiled files, people may end up thinking my files are infected or something is wrong with the strange file sizes.
Last edited by RedPenguin on Mon Mar 04, 2013 8:16 am, edited 1 time in total.
Re: Cross-Compiler for Windows
Try to run this command
if the file contains debug informations, it strips them.
Code: Select all
strip librtmp.so.0
-
- Posts: 3
- Joined: Mon Aug 27, 2012 9:30 pm
Re: Cross-Compiler for Windows
Thank you.
I did that and it did shrink it down to 1.5MB which I still don't understand.
I compiled librtmp the same way on the Pi itself with Raspbmc, libssl-dev, and zlib1g-dev, and it compiles to less than 200KB, so I am not sure why the cross-compiler makes it so much bigger.
I looked at the Windows, Linux, iOS version of librtmp and none are that big.
I did that and it did shrink it down to 1.5MB which I still don't understand.
I compiled librtmp the same way on the Pi itself with Raspbmc, libssl-dev, and zlib1g-dev, and it compiles to less than 200KB, so I am not sure why the cross-compiler makes it so much bigger.
I looked at the Windows, Linux, iOS version of librtmp and none are that big.