Jump to page: 1 2
Thread overview
Building LDC for FreeBSD PowerPC64
Dec 09, 2021
Curtis Hamilton
Dec 09, 2021
Brian Callahan
Dec 10, 2021
Curtis Hamilton
Dec 10, 2021
kinke
Dec 10, 2021
Curtis Hamilton
Dec 11, 2021
Curtis Hamilton
Dec 11, 2021
kinke
Dec 16, 2021
Curtis Hamilton
Dec 17, 2021
Johan
Dec 17, 2021
Curtis Hamilton
Dec 18, 2021
Johan
Dec 19, 2021
Curtis Hamilton
Jan 07, 2022
Curtis Hamilton
Dec 16, 2021
Curtis Hamilton
December 09, 2021
I was wondering if there has been any success in building LDC on FreeBSD PowerPC64?

I've been unsuccessful in building LDC on FreeBSD 13 on my Power9 Blackbird.   The results usually end with "relocation R_PPC64_TOC16_DS out of range" errors when linking LDC2.

Any ideas?


December 09, 2021
On Thursday, 9 December 2021 at 16:10:37 UTC, Curtis Hamilton wrote:
> I was wondering if there has been any success in building LDC on FreeBSD PowerPC64?
>
> I've been unsuccessful in building LDC on FreeBSD 13 on my Power9 Blackbird.   The results usually end with "relocation R_PPC64_TOC16_DS out of range" errors when linking LDC2.
>
> Any ideas?

Probably wants -mcmodel=medium (alternatively, -mcmodel=large).
December 09, 2021
Thanks for the response, but I had tried that and it didn't work.  Below is the full error output:

: && /usr/bin/c++ -DDMDV2 -O3 -DNDEBUG  obj/ldc2.o -o bin/ldc2
 lib/libldc.a  -lLLVM-10  -L/usr/local/llvm10/lib  -Wl,--export-dynamic
 -L/usr/xports/tmp/lts-build/lib  -lphobos2-ldc  -ldruntime-ldc  -lpthread
 -lm  -m64 && :
ld: error: ti_ushort.d:(function ldc.dso_ctor.2rt8typeinfo9ti_ushort:
.text+0x1E): relocation R_PPC64_TOC16_DS out of range: 35408 is not in
[-32768, 32767]
ld: error: ti_uint.d:(function ldc.dso_ctor.2rt8typeinfo7ti_uint:
.text+0x1E): relocation R_PPC64_TOC16_DS out of range: 35312 is not in
[-32768, 32767]
ld: error: utf.d:(function _D2rt4util3utf7toUTF32FxAaZAyw:
.text._D2rt4util3utf7toUTF32FxAaZAyw+0x1E): relocation R_PPC64_TOC16_DS out
of range: 35800 is not in [-32768, 32767]
ld: error: ti_real.d:(function ldc.dso_ctor.2rt8typeinfo7ti_real:
.text+0x1E): relocation R_PPC64_TOC16_DS out of range: 35160 is not in
[-32768, 32767]
ld: error: ti_ireal.d:(function ldc.dso_ctor.2rt8typeinfo8ti_ireal:
.text+0xA): relocation R_PPC64_TOC16_DS out of range: 35040 is not in
[-32768, 32767]
ld: error: ti_wchar.d:(function ldc.dso_ctor.2rt8typeinfo8ti_wchar:
.text+0x1E): relocation R_PPC64_TOC16_DS out of range: 35512 is not in
[-32768, 32767]
ld: error: ti_double.d:(function
_D2rt8typeinfo9ti_double10TypeInfo_d8toStringMxFNaNbNfZAya:
.text._D2rt8typeinfo9ti_double10TypeInfo_d8toStringMxFNaNbNfZAya+0xA):
relocation R_PPC64_TOC16_DS out of range: 34744 is not in [-32768, 32767]
ld: error: random.d:(function ldc.dso_ctor.2rt4util6random: .text+0x1E):
relocation R_PPC64_TOC16_DS out of range: 35632 is not in [-32768, 32767]
ld: error: ti_creal.d:(function
_D2rt8typeinfo8ti_creal10TypeInfo_c4initMxFNaNbNiNeZAxv:
.text._D2rt8typeinfo8ti_creal10TypeInfo_c4initMxFNaNbNiNeZAxv+0xA):
relocation R_PPC64_TOC16_DS out of range: 34640 is not in [-32768, 32767]
ld: error: utf.d:(function ldc.dso_ctor.2rt4util3utf: .text+0x1E):
relocation R_PPC64_TOC16_DS out of range: 35816 is not in [-32768, 32767]
ld: error: ti_float.d:(function
_D2rt4util8typeinfo15__T8FloatingTfZ6hashOfFNaNbNefZm:
.text._D2rt4util8typeinfo15__T8FloatingTfZ6hashOfFNaNbNefZm+0xA):
relocation R_PPC64_TOC16_DS out of range: 34832 is not in [-32768, 32767]
ld: error: utf.d:(function _D2rt4util3utf6decodeFxAwKmZw:
.text._D2rt4util3utf6decodeFxAwKmZw+0x5A): relocation R_PPC64_TOC16_DS out
of range: 35776 is not in [-32768, 32767]
ld: error: ti_Ashort.d:(function
_D2rt8typeinfo9ti_Ashort11TypeInfo_As8toStringMxFNaNbNfZAya:
.text._D2rt8typeinfo9ti_Ashort11TypeInfo_As8toStringMxFNaNbNfZAya+0xA):
relocation R_PPC64_TOC16_DS out of range: 34280 is not in [-32768, 32767]
ld: error: ti_ushort.d:(function ldc.dso_ctor.2rt8typeinfo9ti_ushort:
.text+0x3E): relocation R_PPC64_TOC16_DS out of range: 35416 is not in
[-32768, 32767]
ld: error: ti_ireal.d:(function ldc.dso_ctor.2rt8typeinfo8ti_ireal:
.text+0x3E): relocation R_PPC64_TOC16_DS out of range: 35048 is not in
[-32768, 32767]
ld: error: ti_short.d:(function
_D2rt8typeinfo8ti_short10TypeInfo_s8toStringMxFNaNbNfZAya:
.text._D2rt8typeinfo8ti_short10TypeInfo_s8toStringMxFNaNbNfZAya+0xA):
relocation R_PPC64_TOC16_DS out of range: 35200 is not in [-32768, 32767]
ld: error: ti_uint.d:(function ldc.dso_ctor.2rt8typeinfo7ti_uint:
.text+0x3E): relocation R_PPC64_TOC16_DS out of range: 35320 is not in
[-32768, 32767]
ld: error: utf.d:(function _D2rt4util3utf7toUTF32FxAuZAyw:
.text._D2rt4util3utf7toUTF32FxAuZAyw+0x1E): relocation R_PPC64_TOC16_DS out
of range: 35800 is not in [-32768, 32767]
ld: error: ti_real.d:(function ldc.dso_ctor.2rt8typeinfo7ti_real:
.text+0x3E): relocation R_PPC64_TOC16_DS out of range: 35168 is not in
[-32768, 32767]
ld: error: utf.d:(function ldc.dso_ctor.2rt4util3utf: .text+0x3E):
relocation R_PPC64_TOC16_DS out of range: 35824 is not in [-32768, 32767]
ld: error: too many errors emitted, stopping now (use -error-limit=0 to see
all errors)
c++: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.


On Thu, Dec 9, 2021 at 5:40 PM Brian Callahan via digitalmars-d-ldc < digitalmars-d-ldc@puremagic.com> wrote:

> On Thursday, 9 December 2021 at 16:10:37 UTC, Curtis Hamilton wrote:
> > I was wondering if there has been any success in building LDC on FreeBSD PowerPC64?
> >
> > I've been unsuccessful in building LDC on FreeBSD 13 on my Power9 Blackbird.   The results usually end with "relocation R_PPC64_TOC16_DS out of range" errors when linking LDC2.
> >
> > Any ideas?
>
> Probably wants -mcmodel=medium (alternatively, -mcmodel=large).
>


December 10, 2021
Which D host compiler are you using?
December 10, 2021
I’m using ltsmaster.

On Thu, Dec 9, 2021 at 10:00 PM kinke via digitalmars-d-ldc < digitalmars-d-ldc@puremagic.com> wrote:

> Which D host compiler are you using?
>


December 11, 2021
Unfortunately I’ve not been successful in using LDC-0.17.6 or ltsmaster to bootstrap and build a newer LDC release.

But I have managed to build LDC-1.23 using GDC as the host D compiler. However, the resulting build errors when building itself or other D Lang package. Below is the error message.  Any ideas?

#0 0x0000000812b17248 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/llvm10/lib/libLLVM-10.so+0x1f93248)
#1 0x0000000812b178f4 (/usr/local/llvm10/lib/libLLVM-10.so+0x1f938f4)
#2 0x0000000812b14970 llvm::sys::RunSignalHandlers()
(/usr/local/llvm10/lib/libLLVM-10.so+0x1f90970)
#3 0x0000000812b18030 (/usr/local/llvm10/lib/libLLVM-10.so+0x1f94030)
#4 0x0000000815924274 handle_signal
/usr/src/lib/libthr/thread/thr_sig.c:303:3

ninja: build stopped: subcommand failed.

On Fri, Dec 10, 2021 at 12:22 AM Curtis Hamilton <clhamilto@gmail.com> wrote:

> I’m using ltsmaster.
>
> On Thu, Dec 9, 2021 at 10:00 PM kinke via digitalmars-d-ldc < digitalmars-d-ldc@puremagic.com> wrote:
>
>> Which D host compiler are you using?
>>
>


December 11, 2021
On Saturday, 11 December 2021 at 05:15:33 UTC, Curtis Hamilton wrote:
> Unfortunately I’ve not been successful in using LDC-0.17.6 or ltsmaster to bootstrap and build a newer LDC release.
>
> But I have managed to build LDC-1.23 using GDC as the host D compiler.

Yeah, gdc is the suggested bootstrap way. - So you got that LDC to successfully build druntime and Phobos? I wouldn't have thought you'd get that far ;) - there's a number of (old) reported PowerPC issues on GitHub.
December 16, 2021
On Sat, Dec 11, 2021 at 6:55 PM kinke via digitalmars-d-ldc < digitalmars-d-ldc@puremagic.com> wrote:

> On Saturday, 11 December 2021 at 05:15:33 UTC, Curtis Hamilton wrote:
> > Unfortunately I’ve not been successful in using LDC-0.17.6 or ltsmaster to bootstrap and build a newer LDC release.
> >
> > But I have managed to build LDC-1.23 using GDC as the host D compiler.
>
> Yeah, gdc is the suggested bootstrap way. - So you got that LDC to successfully build druntime and Phobos? I wouldn't have thought you'd get that far ;) - there's a number of (old) reported PowerPC issues on GitHub.
>
Yes, I’ve been successful in getting LDC to build using GDC as the host D. In fact, the resulting build seems to be working well.  I did have to make a few changes to the code to get everything working.

First, PowerPC64 uses elfv2 vice elfv1 on FreeBSD 13, so that needed to be changed in “driver/target machine.cop”.  I also had to update “druntime/src/core/sys/freebsd/config.d” for FreeBSD 13.  Most recent druntime has been updated.

Lastly, I needed to apply the patch from @dbankov-vmware
https://github.com/dbankov-vmware/ldc/tree/fix-for-3795
 that allows LDC to build using static “phobos” which lets LDC to be
independent of GDC.

regards


December 16, 2021
On Thu, Dec 16, 2021 at 9:55 AM Curtis Hamilton <clhamilto@gmail.com> wrote:

>
>
> On Sat, Dec 11, 2021 at 6:55 PM kinke via digitalmars-d-ldc < digitalmars-d-ldc@puremagic.com> wrote:
>
>> On Saturday, 11 December 2021 at 05:15:33 UTC, Curtis Hamilton wrote:
>> > Unfortunately I’ve not been successful in using LDC-0.17.6 or ltsmaster to bootstrap and build a newer LDC release.
>> >
>> > But I have managed to build LDC-1.23 using GDC as the host D compiler.
>>
>> Yeah, gdc is the suggested bootstrap way. - So you got that LDC to successfully build druntime and Phobos? I wouldn't have thought you'd get that far ;) - there's a number of (old) reported PowerPC issues on GitHub.
>>
> Yes, I’ve been successful in getting LDC to build using GDC as the host D.  In fact, the resulting build seems to be working well.  I did have to make a few changes to the code to get everything working.
>
> First, PowerPC64 uses elfv2 vice elfv1 on FreeBSD 13, so that needed to be changed in “driver/target machine.cop”.  I also had to update “druntime/src/core/sys/freebsd/config.d” for FreeBSD 13.  Most recent druntime has been updated.
>
> Lastly, I needed to apply the patch from @dbankov-vmware
> https://github.com/dbankov-vmware/ldc/tree/fix-for-3795
>  that allows LDC to build using static “phobos” which lets LDC to be
> independent of GDC.
>
> regards
>
I hate autocorrection, the file should be “driver/targetmachine.cpp”….


December 17, 2021
On Thursday, 16 December 2021 at 14:55:52 UTC, Curtis Hamilton wrote:
> On Sat, Dec 11, 2021 at 6:55 PM kinke via digitalmars-d-ldc < digitalmars-d-ldc@puremagic.com> wrote:
>
>> On Saturday, 11 December 2021 at 05:15:33 UTC, Curtis Hamilton wrote:
>> > Unfortunately I’ve not been successful in using LDC-0.17.6 or ltsmaster to bootstrap and build a newer LDC release.
>> >
>> > But I have managed to build LDC-1.23 using GDC as the host D compiler.
>>
>> Yeah, gdc is the suggested bootstrap way. - So you got that LDC to successfully build druntime and Phobos? I wouldn't have thought you'd get that far ;) - there's a number of (old) reported PowerPC issues on GitHub.
>>
> Yes, I’ve been successful in getting LDC to build using GDC as the host D. In fact, the resulting build seems to be working well.  I did have to make a few changes to the code to get everything working.

Good news :)
Would you be so kind to submit the required changes as PRs on Github?

Thanks!
  Johan



« First   ‹ Prev
1 2