Porting to a New Target Platform

47 views
Skip to first unread message

Curtis Hamilton

unread,
Oct 10, 2020, 12:58:40 PM10/10/20
to dylan...@googlegroups.com
I'm attempting to port opendylan to freebsd on powerpc64 (ppc64-freebsd) using the guidance contained at https://github.com/dylan-lang/opendylan/blob/30b4a9192eecf4f5458c88f3901866af9dc1cf90/documentation/hacker-guide/source/topics/porting.rst, using x86_64-freebsd as the host system.

Although the guidance provided most of the steps necessary, I had to transfer the "_build" files to the target system to do the linking.  Eventually, I was able to complete the compiler build.  The issue I have is that when I execute dylan-compiler it runs, but just seems to hang.  The compiler does not output any errors, it just sits there.

Any suggestions as to what to look at?

Thanks in advance!

Peter Housel

unread,
Oct 10, 2020, 3:07:13 PM10/10/20
to dylan-lang
Have you tried building hello-world and running that? If that locks up, run it in the debugger (gdb or lldb), stop it, and look at the backtrace. We can help interpret the backtrace if necessary.

-Peter-

Curtis Hamilton

unread,
Oct 10, 2020, 4:53:34 PM10/10/20
to Peter Housel, dylan...@googlegroups.com

Thanks for the response.

Here's the backtrace from gdb:

root@blackbird:/usr/ports/lang/opendylan/work/opendylan-2013.2 # gdb _build/bin/dylan-compiler
GNU gdb (GDB) 8.3 [GDB v8.3 for FreeBSD]
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "powerpc64-portbld-freebsd12.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from _build/bin/dylan-compiler...
(gdb) run
Starting program: /usr/ports/lang/opendylan/work/opendylan-2013.2/_build/bin/dylan-compiler
^C
Program received signal SIGINT, Interrupt.
0x00000008103104bc in .Kend_locking_object_cellYdispatch_engine_internalVdylanI () from /usr/local/lib/opendylan/lib/libdylan.so
(gdb) backtrace
#0  0x00000008103104bc in .Kend_locking_object_cellYdispatch_engine_internalVdylanI () from /usr/local/lib/opendylan/lib/libdylan.so
#1  0x000000081030fcb0 in .Kend_locking_multiple_objectsYdispatch_engine_internalVdylanI () from /usr/local/lib/opendylan/lib/libdylan.so
#2  0x0000000810319848 in .Khandle_missed_dispatchVKgI () from /usr/local/lib/opendylan/lib/libdylan.so
#3  0x0000000810309c38 in .KPgf_dispatch_absentVKgI () from /usr/local/lib/opendylan/lib/libdylan.so
#4  0x0000000813c88e80 in ?? ()
#5  0x000000081032efe8 in .Kmake_first_threadYthreads_internalVdylanI () from /usr/local/lib/opendylan/lib/libdylan.so
#6  0x0000000810330310 in ._Init_dylan__X_thread_for_user () from /usr/local/lib/opendylan/lib/libdylan.so
#7  0x00000008102ed080 in ._Init_dylan_ () from /usr/local/lib/opendylan/lib/libdylan.so
(gdb) frame 0
#0  0x00000008103104bc in .Kend_locking_object_cellYdispatch_engine_internalVdylanI () from /usr/local/lib/opendylan/lib/libdylan.so
(gdb) disass
Dump of assembler code for function .Kend_locking_object_cellYdispatch_engine_internalVdylanI:
   0x0000000810310494 <+0>:    mflr    r0
   0x0000000810310498 <+4>:    std     r0,16(r1)
   0x000000081031049c <+8>:    std     r31,-8(r1)
   0x00000008103104a0 <+12>:    stdu    r1,-304(r1)
   0x00000008103104a4 <+16>:    mr      r31,r1
   0x00000008103104a8 <+20>:    std     r3,352(r31)
   0x00000008103104ac <+24>:    addis   r8,r2,0
   0x00000008103104b0 <+28>:    ld      r9,-28528(r8)
   0x00000008103104b4 <+32>:    ld      r9,0(r9)
   0x00000008103104b8 <+36>:    std     r9,144(r31)
=> 0x00000008103104bc <+40>:    ld      r9,144(r31)
   0x00000008103104c0 <+44>:    ld      r9,16(r9)
   0x00000008103104c4 <+48>:    std     r9,152(r31)
   0x00000008103104c8 <+52>:    ld      r9,152(r31)
   0x00000008103104cc <+56>:    std     r9,160(r31)
   0x00000008103104d0 <+60>:    ld      r10,352(r31)
   0x00000008103104d4 <+64>:    ld      r9,144(r31)
   0x00000008103104d8 <+68>:    cmpd    cr7,r10,r9
   0x00000008103104dc <+72>:    bne     cr7,0x8103104ec <.Kend_locking_object_cellYdispatch_engine_internalVdylanI+88>
   0x00000008103104e0 <+76>:    addis   r10,r2,0
   0x00000008103104e4 <+80>:    ld      r9,-28760(r10)
   0x00000008103104e8 <+84>:    b       0x8103104f4 <.Kend_locking_object_cellYdispatch_engine_internalVdylanI+96>
   0x00000008103104ec <+88>:    addis   r8,r2,0
   0x00000008103104f0 <+92>:    ld      r9,-28784(r8)
   0x00000008103104f4 <+96>:    std     r9,168(r31)
   0x00000008103104f8 <+100>:    ld      r10,168(r31)
   0x00000008103104fc <+104>:    addis   r8,r2,0
   0x0000000810310500 <+108>:    ld      r9,-28784(r8)
   0x0000000810310504 <+112>:    cmpd    cr7,r10,r9
   0x0000000810310508 <+116>:    beq     cr7,0x810310574 <.Kend_locking_object_cellYdispatch_engine_internalVdylanI+224>
   0x000000081031050c <+120>:    ld      r9,144(r31)
   0x0000000810310510 <+124>:    ld      r9,16(r9)
   0x0000000810310514 <+128>:    std     r9,176(r31)
   0x0000000810310518 <+132>:    ld      r9,176(r31)
   0x000000081031051c <+136>:    std     r9,184(r31)
   0x0000000810310520 <+140>:    addis   r10,r2,0
   0x0000000810310524 <+144>:    ld      r9,-28528(r10)
   0x0000000810310528 <+148>:    ld      r10,184(r31)
   0x000000081031052c <+152>:    std     r10,0(r9)
   0x0000000810310530 <+156>:    addis   r8,r2,0
   0x0000000810310534 <+160>:    ld      r9,-28528(r8)
   0x0000000810310538 <+164>:    ld      r9,0(r9)
   0x000000081031053c <+168>:    std     r9,192(r31)
   0x0000000810310540 <+172>:    ld      r9,192(r31)
   0x0000000810310544 <+176>:    std     r9,200(r31)
   0x0000000810310548 <+180>:    bl      0x810309bd0 <.get_teb>
   0x000000081031054c <+184>:    mr      r10,r3
   0x0000000810310550 <+188>:    ld      r9,192(r31)
   0x0000000810310554 <+192>:    std     r9,32(r10)
   0x0000000810310558 <+196>:    bl      0x810309bd0 <.get_teb>
   0x000000081031055c <+200>:    mr      r10,r3
   0x0000000810310560 <+204>:    li      r9,1
   0x0000000810310564 <+208>:    stw     r9,24(r10)
   0x0000000810310568 <+212>:    ld      r9,200(r31)
   0x000000081031056c <+216>:    std     r9,112(r31)
   0x0000000810310570 <+220>:    b       0x8103106c4 <.Kend_locking_object_cellYdispatch_engine_internalVdylanI+560>
   0x0000000810310574 <+224>:    ld      r9,144(r31)
   0x0000000810310578 <+228>:    std     r9,128(r31)
   0x000000081031057c <+232>:    ld      r9,160(r31)
   0x0000000810310580 <+236>:    std     r9,136(r31)
   0x0000000810310584 <+240>:    ld      r9,128(r31)
   0x0000000810310588 <+244>:    std     r9,208(r31)
   0x000000081031058c <+248>:    ld      r9,136(r31)
   0x0000000810310590 <+252>:    std     r9,216(r31)
   0x0000000810310594 <+256>:    ld      r10,216(r31)
   0x0000000810310598 <+260>:    addis   r8,r2,0
   0x000000081031059c <+264>:    ld      r9,-28576(r8)
   0x00000008103105a0 <+268>:    cmpd    cr7,r10,r9
   0x00000008103105a4 <+272>:    bne     cr7,0x8103105b4 <.Kend_locking_object_cellYdispatch_engine_internalVdylanI+288>
--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(gdb)

--
You received this message because you are subscribed to the Google Groups "dylan-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dylan-lang+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dylan-lang/43a3e919-75f9-4db6-a047-8045327e5269n%40googlegroups.com.

Curtis Hamilton

unread,
Jan 9, 2021, 11:42:01 AM1/9/21
to dylan-lang
When attempting to compile opendylan for a new platform, I'm getting the below:

There were 0 warnings, 0 serious warnings and 0 errors.
Build of 'dylan-compiler' completed
Invoking undefined Jam rule DylanLibrary
Invoking undefined Jam rule DylanLibraryFiles
Invoking undefined Jam rule DylanLibraryBaseAddress
Invoking undefined Jam rule DylanLibraryCHeaders
Invoking undefined Jam rule DylanLibraryRCFiles
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses
Invoking undefined Jam rule DylanLibraryUses

Internal error: Link failed: don't know how to build exe
Exiting with return code -1

I know these rules are being invoked from "posix-build.jam".  I don't seem to be able to find where these are defined. Does anyone know how to resolve this?

Thanks in advance.

Curtis Hamilton

unread,
Jan 11, 2021, 1:09:50 AM1/11/21
to Peter Housel, dylan...@googlegroups.com
Thanks for the assistance. I was able to resolve my earlier problem, but now I’ve run into another issue.  The build is looking for powerpc versions of some libraries and files (see below). Any thoughts on this? Is there a way to specify the location of these files? I have them in a local directory on the build host.

I’ve attached my .jam files being used.

/usr/local
/bin/powerpc64-unknown-freebsd12.1-ld: /usr/lib/crti.o: Relocations in generic ELF (EM: 62)
/usr/local/bin/powerpc64-unknown-freebsd12.1-ld: /usr/lib/crti.o: Relocations in generic ELF (EM:
62)
/usr/local/bin/powerpc64-unknown
-freebsd12.1-ld: /usr/lib/crti.o
: Relocations in generic ELF (
EM: 62)
/usr/local/bin/
powerpc64-unknown-freebsd12.1-ld: /usr/lib
/crti.o: error adding symbols: file
in wrong format

collect2: error: ld returned 1 exit status


ppc64-freebsd-build.jam
ppc64-freebsd-custom-build.jam
Reply all
Reply to author
Forward
0 new messages