November 24, 2013
On 11/24/2013 06:21 AM, Johannes Pfau wrote:
> Am Sun, 24 Nov 2013 14:19:43 +0100
> schrieb "Mike" <none@none.com>:
>
>> On Sunday, 24 November 2013 at 12:53:42 UTC, Iain Buclaw wrote:
>>> On Sunday, 24 November 2013 at 12:43:01 UTC, Mike wrote:
>>>> I am very new to D, but I finally got my toolchain compiled
>>>> and working.  I'm using LDC.  I failed with GDC and eventually
>>>> gave up.
>>>>
>>>
>>> I know Johannes has some patches yet to trickle down into gdc.
>>> And druntime is does not support ARM fully in 2.063, but it
>>> would be helpful if you could take some time to let people know
>>> what went wrong when you tried things, rather than just giving
>>> up.  Otherwise, nothing will get fixed.
>
> Cortex-M is the 'bare metal' branch of ARM where you usually don't run
> linux so druntime won't work anyway. There are some compiler fixes in
> my branch that could be interesting though:
> https://github.com/jpf91/GDC/commits/arm
>
> BTW: I'll start merging back the fixes to gdc master this week. Some
> fixes have to be merged into phobos upstream though so it might take
> some time.
>

I actually tried to get a gdc build a week or two ago for a cortex-a8 using ng-crosstools-linaro. I managed to get up to compiling druntime, which then was pointing to a commit prior to

https://github.com/D-Programming-Language/druntime/commit/541e7ba00d5e75426bb677d7f7548a47a904551f

so it failed. Then I figured I'd wait for your fixes.


November 24, 2013
Am Sun, 24 Nov 2013 18:18:22 +0100
schrieb "jerro" <a@a.com>:

> It seems languages other than C are disabled for bare metal builds. You could try searching for cc.ini in your crosstool-ng installation and commenting out the line
> 
> if ! BARE_METAL
> 
> and
> 
> endif # ! BARE_METAL
> 

Good to know. I'll prepare a patch
( I'm currently implementing cross-native builds for crosstool-NG
anyway)
December 01, 2013
On Sunday, 24 November 2013 at 18:38:19 UTC, Johannes Pfau wrote:
> Am Sun, 24 Nov 2013 18:18:22 +0100
> schrieb "jerro" <a@a.com>:
>
>> It seems languages other than C are disabled for bare metal builds. You could try searching for cc.ini in your crosstool-ng installation and commenting out the line
>> 
>> if ! BARE_METAL
>> 
>> and
>> 
>> endif # ! BARE_METAL
>> 
>
> Good to know. I'll prepare a patch
> ( I'm currently implementing cross-native builds for crosstool-NG
> anyway)

Just tried again with crosstools-ng 1.19.0.  I commented out the appropriate lines in my cc.ini file, but the build failed with...

" The following requested languages could not be built: d "

... in the build.log file.

Also, the instructions here (http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG) say:

"If druntime & phobos do not yet compile for your target you can disable them:

Start ct-ng menuconfig, go to "C compiler" and add "--disable-libphobos" to "Core gcc extra config" and "gcc extra config". "

While the "Core gcc extra config" option exists, "gcc extra config" does not.

The quest continues...
December 01, 2013
On Sunday, 1 December 2013 at 05:23:19 UTC, Mike wrote:
> On Sunday, 24 November 2013 at 18:38:19 UTC, Johannes Pfau wrote:
>> Am Sun, 24 Nov 2013 18:18:22 +0100
>> schrieb "jerro" <a@a.com>:
>>
>>> It seems languages other than C are disabled for bare metal builds. You could try searching for cc.ini in your crosstool-ng installation and commenting out the line
>>> 
>>> if ! BARE_METAL
>>> 
>>> and
>>> 
>>> endif # ! BARE_METAL
>>> 
>>
>> Good to know. I'll prepare a patch
>> ( I'm currently implementing cross-native builds for crosstool-NG
>> anyway)
>
> Just tried again with crosstools-ng 1.19.0.  I commented out the appropriate lines in my cc.ini file, but the build failed with...
>
> " The following requested languages could not be built: d "
>
> ... in the build.log file.
>
> Also, the instructions here (http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG) say:
>
> "If druntime & phobos do not yet compile for your target you can disable them:
>
> Start ct-ng menuconfig, go to "C compiler" and add "--disable-libphobos" to "Core gcc extra config" and "gcc extra config". "
>
> While the "Core gcc extra config" option exists, "gcc extra config" does not.
>
> The quest continues...

Thinking about this a little more, I figured the only way GCC would not no about D is if the GCC sources were not patched...and sure enough, I had crosstools pointing to the wrong folder.  My mistake.
December 01, 2013
On Sunday, 1 December 2013 at 06:00:08 UTC, Mike wrote:
> On Sunday, 1 December 2013 at 05:23:19 UTC, Mike wrote:
>> On Sunday, 24 November 2013 at 18:38:19 UTC, Johannes Pfau wrote:
>>> Am Sun, 24 Nov 2013 18:18:22 +0100
>>> schrieb "jerro" <a@a.com>:
>>>
>>>> It seems languages other than C are disabled for bare metal builds. You could try searching for cc.ini in your crosstool-ng installation and commenting out the line
>>>> 
>>>> if ! BARE_METAL
>>>> 
>>>> and
>>>> 
>>>> endif # ! BARE_METAL
>>>> 
>>>
>>> Good to know. I'll prepare a patch
>>> ( I'm currently implementing cross-native builds for crosstool-NG
>>> anyway)
>>
>> Just tried again with crosstools-ng 1.19.0.  I commented out the appropriate lines in my cc.ini file, but the build failed with...
>>
>> " The following requested languages could not be built: d "
>>
>> ... in the build.log file.
>>
>> Also, the instructions here (http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG) say:
>>
>> "If druntime & phobos do not yet compile for your target you can disable them:
>>
>> Start ct-ng menuconfig, go to "C compiler" and add "--disable-libphobos" to "Core gcc extra config" and "gcc extra config". "
>>
>> While the "Core gcc extra config" option exists, "gcc extra config" does not.
>>
>> The quest continues...
>
> Thinking about this a little more, I figured the only way GCC would not no about D is if the GCC sources were not patched...and sure enough, I had crosstools pointing to the wrong folder.  My mistake.

I was finally able to build a GDC cross compiler using GCC 4.8.2, the GDC 4.8 branch, and crosstools-ng 1.19.0.  However, I found the following errors in the instructions located here (http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG)

1.  The "Other Languages" option does not appear for a bare metal build.  You must modify the cc.ini file to make it available per jerro's insructions above.  Thanks jerro
2.  The "Core gcc extra config" option exists, but the "gcc extra config" does not.  It doesn't appear to be necessary, but I have yet to test this toolchain.
3.  The "Paths and misc options, Local tarballs directory" option does not seem to be correct.  For me, I had to go to "C Compiler" -> "gcc version" and choose "Custom gcc" and point crosstools-ng to the folder containing the merged GCC/GDC source code.

I hope this information is useful to someone.
December 01, 2013
Am Sun, 01 Dec 2013 09:58:01 +0100
schrieb "Mike" <none@none.com>:

> I was finally able to build a GDC cross compiler using GCC 4.8.2, the GDC 4.8 branch, and crosstools-ng 1.19.0.  However, I found the following errors in the instructions located here (http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG)

BTW: The new location is http://wiki.dlang.org/GDC/Cross_Compiler/crosstool-NG

> 
> 1.  The "Other Languages" option does not appear for a bare metal build.  You must modify the cc.ini file to make it available per jerro's insructions above.  Thanks jerro

That's a bug in crosstool-NG, I'll try to get it fixed.

> 2.  The "Core gcc extra config" option exists, but the "gcc extra config" does not.  It doesn't appear to be necessary, but I have yet to test this toolchain.

It's indeed not necessary for bare-metal builds. That's probably because the instructions weren't tested on bare metal builds.

> 3.  The "Paths and misc options, Local tarballs directory" option does not seem to be correct.  For me, I had to go to "C Compiler" -> "gcc version" and choose "Custom gcc" and point crosstools-ng to the folder containing the merged GCC/GDC source code.

Back when I wrote those instructions the "Custom gcc" option didn't exist. Custom gcc will work just fine, but there's a subtle difference: crosstool-NG may automatically apply some patches for certain GCC versions. It won't apply those patches when using the "Custom gcc" option.

However, the method described in the wiki only works if the patched sources are packaged into a new tarball with exactly the same name as the original tarball (gcc-4.7.1.tar.bz2/gcc-4.8.2.tar.bz2/...). Then crosstool-NG may have cached the extracted sources and those have to be deleted. And nowadays crosstool-NG might actually prefer .tar.xz files, so if you have an unpatched tar.xz file in the source directory it file has to be deleted. I'll probably add some text about these issues to the documentation.

> I hope this information is useful to someone.

It definitely is. Thanks for the feedback!
December 01, 2013
Am Sun, 24 Nov 2013 09:35:57 -0800
schrieb Ellery Newcomer <ellery-newcomer@utulsa.edu>:

> On 11/24/2013 06:21 AM, Johannes Pfau wrote:
> > Am Sun, 24 Nov 2013 14:19:43 +0100
> > schrieb "Mike" <none@none.com>:
> >
> >> On Sunday, 24 November 2013 at 12:53:42 UTC, Iain Buclaw wrote:
> >>> On Sunday, 24 November 2013 at 12:43:01 UTC, Mike wrote:
> >>>> I am very new to D, but I finally got my toolchain compiled and working.  I'm using LDC.  I failed with GDC and eventually gave up.
> >>>>
> >>>
> >>> I know Johannes has some patches yet to trickle down into gdc. And druntime is does not support ARM fully in 2.063, but it would be helpful if you could take some time to let people know what went wrong when you tried things, rather than just giving up.  Otherwise, nothing will get fixed.
> >
> > Cortex-M is the 'bare metal' branch of ARM where you usually don't run linux so druntime won't work anyway. There are some compiler fixes in my branch that could be interesting though: https://github.com/jpf91/GDC/commits/arm
> >
> > BTW: I'll start merging back the fixes to gdc master this week. Some fixes have to be merged into phobos upstream though so it might take some time.
> >
> 
> I actually tried to get a gdc build a week or two ago for a cortex-a8 using ng-crosstools-linaro. I managed to get up to compiling druntime, which then was pointing to a commit prior to
> 
> https://github.com/D-Programming-Language/druntime/commit/541e7ba00d5e75426bb677d7f7548a47a904551f
> 
> so it failed. Then I figured I'd wait for your fixes.
> 
> 

Hi,
as Iain started merging 2.064 the ARM branch merge will probably be
delayed until the 2.064 merge is complete. I updated my branch to
be on the last 2.063 revision which still compiles with gcc-4.8:
https://github.com/jpf91/GDC/commits/arm

It'd be awesome if you could help with some alpha-testing. Unfortunately cross-compilers are completely untested and I'll first have to make the test suite run for cross-compilers. But if you could build a native compiler, run the test suite and unit tests and report the results, that'd be awesome.

See http://wiki.dlang.org/GDC/Test_Suite
and http://wiki.dlang.org/GDC/Test_Suite#Running_unit_tests
for more information.

1 2
Next ›   Last »