Thread overview | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 23, 2012 ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Hi, # Introduction I've started some initial work to get a working GDC crosscompiler targeting ARM platforms. Currently I'm able to compile the toolchain and produce a working "Hello World!" binary that I'm able to execute on my BeagleBoard developement platform with ArchLinux installed. The generated assembly looks sane, unfortunately the program hangs, but I'm able to debug it in gdb and I see it loops somewhere at: 2261 in /home/dpc/lab/d-cross/test-tc-1/.build/src/gcc-4.6.2/libphobos/gc/gcx.d => 0x2f950 <_D2gc3gcx2GC6mallocMFkkPkZPv+648>: str r2, [r4, r9, lsl #2] I'm going to investigate this and possibly fix with time. Anyone interested in getting this to work seamlessly is kindly requested to join efforts and share the results. # How to compile There's a crosstool-ng tool that is a great way to assemble and build (cross-)toolchains. I've added some hacks to integrate the gdc repository and thus add a gdc support. I've pushed the forked crosstools-ng here: https://bitbucket.org/xdpcx/crosstool-ng-dlang/ (I prefer git, but original crosstools-ng is using hg, so I sticked with it). Grab that code and learn to how to use ct-ng. Basically installing crosstool-ng it's just a metter of downloading and doing: ./bootstrap ./configure make make install (I use `./configure --prefix="$HOME/opt"` for home-local configuration.) This will give you `ct-ng` command that you can use in any directory cd ~/my/toolchain/buildir mkdir src cp ~/config/that/i/prepared/for/you/config .config ct-ng menuconfig ct-ng build ls arm-none-linux-eabi I attach the mentioned config. Actually, as I don't know how to attach it I've put it here: http://pastebin.ca/2121043 If anyone is interested I could upload the compiled binaries somewhere, as the toolchain is static. Regards, Dawid Ciężarkiewicz |
February 23, 2012 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dawid Ciężarkiewicz | Am Thu, 23 Feb 2012 15:25:59 +0000 (UTC) schrieb Dawid Ciężarkiewicz <dpc@ucore.info>: > Hi, > > # Introduction > > I've started some initial work to get a working GDC crosscompiler targeting ARM platforms. Currently I'm able to compile the toolchain and produce a working "Hello World!" binary that I'm able to execute on my BeagleBoard developement platform with ArchLinux installed. The generated assembly looks sane, unfortunately the program hangs, but I'm able to debug it in gdb and I see it loops somewhere at: > > 2261 in > /home/dpc/lab/d-cross/test-tc-1/.build/src/gcc-4.6.2/libphobos/gc/gcx.d > => 0x2f950 <_D2gc3gcx2GC6mallocMFkkPkZPv+648>: str r2, > [r4, r9, lsl #2] > > I'm going to investigate this and possibly fix with time. Anyone interested in getting this to work seamlessly is kindly requested to join efforts and share the results. That's issue 120: https://bitbucket.org/goshawk/gdc/issue/120/fsection-anchors-broken-on-arm > > # How to compile > > There's a crosstool-ng tool that is a great way to assemble and build (cross-)toolchains. I've added some hacks to integrate the gdc repository and thus add a gdc support. > > I've pushed the forked crosstools-ng here: > > https://bitbucket.org/xdpcx/crosstool-ng-dlang/ > > (I prefer git, but original crosstools-ng is using hg, so I > sticked with it). > > Grab that code and learn to how to use ct-ng. > > Basically installing crosstool-ng it's just a metter of downloading and doing: > > ./bootstrap > ./configure > make > make install > > (I use `./configure --prefix="$HOME/opt"` for home-local > configuration.) > > This will give you `ct-ng` command that you can use in any directory > > cd ~/my/toolchain/buildir > mkdir src > cp ~/config/that/i/prepared/for/you/config .config > ct-ng menuconfig > ct-ng build > ls arm-none-linux-eabi > > I attach the mentioned config. > > Actually, as I don't know how to attach it I've put it here: http://pastebin.ca/2121043 Integrating GDC with crosstools is nice. If you find the time, could you please add a page to the GDC wiki on how to setup/use crosstool-ng? > If anyone is interested I could upload the compiled binaries somewhere, as the toolchain is static. > > Regards, > Dawid Ciężarkiewicz |
February 23, 2012 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes Pfau | On 23 February 2012 18:03, Johannes Pfau <nospam@example.com> wrote: > Am Thu, 23 Feb 2012 15:25:59 +0000 (UTC) > schrieb Dawid Ciężarkiewicz <dpc@ucore.info>: > >> Hi, >> >> # Introduction >> >> I've started some initial work to get a working GDC crosscompiler targeting ARM platforms. Currently I'm able to compile the toolchain and produce a working "Hello World!" binary that I'm able to execute on my BeagleBoard developement platform with ArchLinux installed. The generated assembly looks sane, unfortunately the program hangs, but I'm able to debug it in gdb and I see it loops somewhere at: >> >> 2261 in /home/dpc/lab/d-cross/test-tc-1/.build/src/gcc-4.6.2/libphobos/gc/gcx.d => 0x2f950 <_D2gc3gcx2GC6mallocMFkkPkZPv+648>: str r2, [r4, r9, lsl #2] >> >> I'm going to investigate this and possibly fix with time. Anyone interested in getting this to work seamlessly is kindly requested to join efforts and share the results. > > That's issue 120: https://bitbucket.org/goshawk/gdc/issue/120/fsection-anchors-broken-on-arm > >> >> # How to compile >> >> There's a crosstool-ng tool that is a great way to assemble and build (cross-)toolchains. I've added some hacks to integrate the gdc repository and thus add a gdc support. >> >> I've pushed the forked crosstools-ng here: >> >> https://bitbucket.org/xdpcx/crosstool-ng-dlang/ >> >> (I prefer git, but original crosstools-ng is using hg, so I >> sticked with it). >> >> Grab that code and learn to how to use ct-ng. >> >> Basically installing crosstool-ng it's just a metter of downloading and doing: >> >> ./bootstrap >> ./configure >> make >> make install >> >> (I use `./configure --prefix="$HOME/opt"` for home-local >> configuration.) >> >> This will give you `ct-ng` command that you can use in any directory >> >> cd ~/my/toolchain/buildir >> mkdir src >> cp ~/config/that/i/prepared/for/you/config .config >> ct-ng menuconfig >> ct-ng build >> ls arm-none-linux-eabi >> >> I attach the mentioned config. >> >> Actually, as I don't know how to attach it I've put it here: http://pastebin.ca/2121043 > > Integrating GDC with crosstools is nice. If you find the time, could you please add a page to the GDC wiki on how to setup/use crosstool-ng? > >> If anyone is interested I could upload the compiled binaries somewhere, as the toolchain is static. >> >> Regards, >> Dawid Ciężarkiewicz > > Does crosstools allow you to build a cross compiler for architecture X? -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
February 23, 2012 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | Dnia Thu, 23 Feb 2012 19:41:53 +0000, Iain Buclaw napisał(a): > Does crosstools allow you to build a cross compiler for architecture X? Yes, exactly. Canadian cross-compilers too. So other architectures could potenatially work, too. I don't have equipement to test them. -- Dawid Ciężarkiewicz |
February 23, 2012 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes Pfau | Dnia Thu, 23 Feb 2012 19:03:46 +0100, Johannes Pfau napisał(a): > That's issue 120: https://bitbucket.org/goshawk/gdc/issue/120/fsection-anchors-broken-on- arm Thanks. Must try without -O2 now. > Integrating GDC with crosstools is nice. If you find the time, could you please add a page to the GDC wiki on how to setup/use crosstool-ng? Quick re-edition of my post is now here: https://bitbucket.org/goshawk/gdc/wiki/crosstool-ng I don't know if I should link the page anywhere. -- Dawid Ciężarkiewicz |
February 23, 2012 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dawid Ciężarkiewicz | 2012/2/23 Dawid Ciężarkiewicz <dpc@ucore.info>:
> Dnia Thu, 23 Feb 2012 19:03:46 +0100, Johannes Pfau napisał(a):
>> That's issue 120: https://bitbucket.org/goshawk/gdc/issue/120/fsection-anchors-broken-on-
> arm
>
> Thanks. Must try without -O2 now.
-O2 is fine as long as you also use -fno-section-anchors.
|
April 22, 2013 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dawid Ciężarkiewicz | Hi, Dawid! On Thursday, 23 February 2012 at 15:25:59 UTC, Dawid Ciężarkiewicz wrote: > Hi, > > # Introduction > > I've started some initial work to get a working GDC crosscompiler > targeting ARM platforms. Currently I'm able to compile the > toolchain and produce a working "Hello World!" binary that I'm > able to execute on my BeagleBoard developement platform with > ArchLinux installed. The generated assembly looks sane, > unfortunately the program hangs, but I'm able to debug it in gdb > and I see it loops somewhere at: > > 2261 in > /home/dpc/lab/d-cross/test-tc-1/.build/src/gcc-4.6.2/libphobos/gc/gcx.d > => 0x2f950 <_D2gc3gcx2GC6mallocMFkkPkZPv+648>: str r2, > [r4, r9, lsl #2] > > I'm going to investigate this and possibly fix with time. Anyone > interested in getting this to work seamlessly is kindly requested > to join efforts and share the results. > > > # How to compile > > There's a crosstool-ng tool that is a great way to assemble and > build (cross-)toolchains. I've added some hacks to integrate the > gdc repository and thus add a gdc support. > > I've pushed the forked crosstools-ng here: > > https://bitbucket.org/xdpcx/crosstool-ng-dlang/ > > (I prefer git, but original crosstools-ng is using hg, so I > sticked with it). > > Grab that code and learn to how to use ct-ng. > > Basically installing crosstool-ng it's just a metter of > downloading and doing: > > ./bootstrap > ./configure > make > make install > > (I use `./configure --prefix="$HOME/opt"` for home-local > configuration.) > > This will give you `ct-ng` command that you can use in any > directory > > cd ~/my/toolchain/buildir > mkdir src > cp ~/config/that/i/prepared/for/you/config .config > ct-ng menuconfig > ct-ng build > ls arm-none-linux-eabi > > I attach the mentioned config. > > Actually, as I don't know how to attach it I've put it here: > http://pastebin.ca/2121043 I tried to do that and build failed: [DEBUG] ==> Executing: 'sh' './gcc/d/setup-gcc.sh' [ALL ] This version of GCC (4.4) is not supported. do you have somewhere corrected code / config? > > If anyone is interested I could upload the compiled binaries > somewhere, as the toolchain is static. I will greatly appreciate that! > > Regards, > Dawid Ciężarkiewicz |
April 30, 2013 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timofei Bolshakov | I was able to compile DGC to the Hello, World status for ARM using crosstools-ng 1.18 eglibc. uclibc would not work, it lack some of the functions in the library, context switching. There are several places I cheat ( to get Hello, World! ). Please advise: ../gcc-4.7.2/libphobos/libdruntime/core/sys/posix/ucontext.d:274: Error: static assert "Not implemented" ../gcc-4.7.2/libphobos/libdruntime/core/thread.d:3409: Error: static assert "Not implemented" ../gcc-4.7.2/libphobos/libdruntime/core/thread.d:4237: Error: static assert "Not implemented" I simply commented static asserts - and I do not think it will fly with any real multi threading program. All the places consider context switching and assembly-level register manipulation. Can somebody help me with that? |
April 30, 2013 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | I was able to compile DGC to the Hello, World status for ARM using crosstools-ng 1.18 eglibc. uclibc would not work, it lack some of the functions in the library, context switching. There are several places I cheat ( to get Hello, World! ). Please advise: ../gcc-4.7.2/libphobos/libdruntime/core/sys/posix/ucontext.d:274: Error: static assert "Not implemented" ../gcc-4.7.2/libphobos/libdruntime/core/thread.d:3409: Error: static assert "Not implemented" ../gcc-4.7.2/libphobos/libdruntime/core/thread.d:4237: Error: static assert "Not implemented" I simply commented static asserts - and I do not think it will fly with any real multi threading program. All the places consider context switching and assembly-level register manipulation. Can somebody help me with that? |
May 02, 2013 Re: ARM targetting cross-toolchain with GDC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timofei Bolshakoc | Am Tue, 30 Apr 2013 22:40:32 +0200 schrieb "Timofei Bolshakoc" <tbolsh@gmail.com>: > I was able to compile DGC to the Hello, World status for ARM using crosstools-ng 1.18 eglibc. uclibc would not work, it lack some of the functions in the library, context switching. There are several places I cheat ( to get Hello, World! ). Please advise: > > ../gcc-4.7.2/libphobos/libdruntime/core/sys/posix/ucontext.d:274: Error: static assert "Not implemented" Add this to ucontext.d: https://gist.github.com/jpf91/5502741 You probably also need this for core/sys/posix/sys/stat.d https://gist.github.com/jpf91/5502725 > > I simply commented static asserts - and I do not think it will fly with any real multi threading program. All the places consider context switching and assembly-level register manipulation. Can somebody help me with that? The definition of ucontext_t should be enough. But this code is only for fibers real threads don't need this support code and should work fine without it. You probably also need the stat_t definition posted above to do any kind of IO. |
Copyright © 1999-2021 by the D Language Foundation