12 February 2018, 21:17 | #121 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
|
12 February 2018, 21:22 | #122 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,039
|
Warpcollect does 2 things. Invoke ld and then Elf2Exe2. You still need to link object files (created with -c) using a linker in case you don't use warpcollect.
|
12 February 2018, 21:25 | #123 | |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Quote:
Sorry, been a long day today at a new job. |
|
12 February 2018, 21:36 | #124 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
since I saw the "ELF" in the hexdump. where is the warpcollect source? ==> warpcollect on aminet #1) as a reference. this way you can build the warpos (wos) binary: Code:
/gg/bin/ppc-morphos-gcc-4 -warpup -O2 helloworld.c -c -o helloworld.o /gg/bin/ld.exe helloworld.o -o helloworld.exe \ -L/gg/ppc-amigaos/lib /gg/ppc-amigaos/lib/startupwos.o -lcwos on the Amiga with warpup system: Elf2Exe2 helloworld.exe helloworld_wos.exe maybe have to choose a different cpu with the gcc (-m ....) . Last edited by emufan; 13 February 2018 at 01:20. |
|
13 February 2018, 00:00 | #125 | |
Moon 1969 = amiga 1985
Join Date: Apr 2007
Location: belgium
Age: 48
Posts: 3,913
|
Quote:
|
|
13 February 2018, 01:07 | #126 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
|
13 February 2018, 01:47 | #127 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
#1) edit warpcollect.c and change the path to `ld`: Code:
137: strcpy(exec, "/ade/ppc-amigaos/bin/ld"); to 137 strcpy(exec, "/gg/ppc-amigaos/bin/ld"); Code:
mv /gg/ppc-amigaos/bin/ld /gg/ppc-amigaos/bin/ld_amigaos ln -s /gg/bin/ld.exe /gg/ppc-amigaos/bin/ld.exe Code:
touch /gg/bin/elf2exe2 Code:
cp warpcollect.exe /gg/lib/gcc-lib/ppc-morphos/4.4.5/ Code:
$ /gg/bin/ppc-morphos-gcc-4 -warpup -O2 helloworld.c -o helloworld.exe $ file helloworld.exe helloworld.exe: ELF 32-bit MSB relocatable, PowerPC or cisco 4500, version 1 (SYSV) Code:
Elf2Exe2 helloworld.exe helloworld_wos.exe Last edited by emufan; 13 February 2018 at 01:55. |
|
13 February 2018, 02:13 | #128 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,039
|
You still get illegal instruction?
|
13 February 2018, 02:17 | #129 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
yes, there is a debugger window popup:
Code:
PowerPC Program exception Illegal instruction The excepting instruction is located at 083E3AA4 Task name: 'Shell Process_PPC3' Task address: 08489C70 Task ID: 102 SRR0: 083E3AA4 SRR1: 0008F070 MSR: 00003000 HID0: 0000C084 PVR: 00090204 DAR: 00000004 DSISR: 08000000 SDR1: 0880007F DEC: 00016556 TBU: 00000000 TBL: 082992EB XER: 00000000 CR: 40000000 FPSCR: 00000000 LR: 083E3E80 CTR: 00000000 R0-R3: 6D9B313B 0869DCD0 0848A148 083F3B0C IBAT0: 40001FFF 40000022 R4-R7: 083D7D78 00000000 00000001 0000000D IBAT1: 50000FFF 50000022 R8-R11: 083DEE80 08390000 00000000 0869DD68 IBAT2: 00000000 00000000 R12-R15: 01000000 0869DE10 08435AC8 08439EE4 IBAT3: 00000000 00000000 R16-R19: 0869DD60 0000004C 00000000 00000000 DBAT0: 40001FFF 4000002A R20-R23: 00000000 00000000 083D7D78 083D794E DBAT1: 50000FFF 5000002A R24-R27: 0843C510 083D794E 083D7D78 08423210 DBAT2: 00000000 00000000 R28-R31: 00000004 086D4B6E 020F7D3B 083D771C DBAT3: 00000000 00000000 F0-F3: 0 5.5821 E-269 5.5790 E-269 5.5790 E-269 F4-F7: 5.5821 E-269 3.7938 E-270 6.4063 E-304 9.3669 E-299 F8-F11: 5.5790 E-269 0 0 0 F12-F15: 0 0 0 0 F16-F19: 0 0 0 0 F20-F23: 0 0 0 0 F24-F27: 0 0 0 0 F28-F31: 0 0 0 0 Warp-OS 2001 by Sam Jordan Code:
version libs:Warp.library warp.library 5.1 version libs:warpHW.library warpHW.library 1.0 version libs:PowerPC.library powerpc.library 16.1 |
13 February 2018, 02:46 | #130 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,039
|
This is on a real Amiga or winuae? The output of a WarpOS exception is almost useless. It helps if you could disassemble around the address in srr0 and lr with for example vdappc from Frank Wille.
|
13 February 2018, 03:16 | #131 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
no idea about the debuging stuff. it's winuae.
i've attached the two binaries, you can try on ur own, if you want. |
13 February 2018, 04:32 | #132 |
Registered User
Join Date: Dec 2015
Location: USA
Posts: 2,958
|
Emufan you have brought great shame honor to the Amiga Coders subforum.
Your Hello World worked for me. Keep in mind WinUAE is notoriously unstable for WarpOS applications. 1st run: worked Then I ran elf2exe2 on your executable and ran the output, it was the same file size (expectedly). Code:
PowerPC Program exception Illegal instruction The excepting instruction is located at 0AA80938 Task name: 'Shell Process_PPC7' Task address: 087DF4F0 Task ID: 103 SRR0: 0AA80938 SRR1: 0008F070 MSR: 00003000 HID0: 0000C084 PVR: 00090204 DAR: 00000004 DSISR: 08000000 SDR1: 08C0003F DEC: 00015305 TBU: 00000012 TBL: 881ACF13 XER: 20000000 CR: 40000000 FPSCR: 00000000 LR: 0924E93C CTR: 00000000 R0-R3: 00001000 0936FA60 087DF9C8 0936FA70 IBAT0: 40000FFF 40000022 R4-R7: 093B3140 0003FE88 00000000 0003FE88 IBAT1: 00000000 00000000 R8-R11: 0003FE88 00000000 093B3158 093B3130 IBAT2: 00000000 00000000 R12-R15: 40000000 0936FE80 0875FEA0 087642BC IBAT3: 00000000 00000000 R16-R19: 0936FDC0 0000004C 00000000 00000000 DBAT0: 40000FFF 4000002A R20-R23: 00000000 00000000 09230000 09230000 DBAT1: 00000000 00000000 R24-R27: 093B3120 093B3160 093B3140 0936FA70 DBAT2: 00000000 00000000 R28-R31: 08768FD0 0AA8093B 00000000 000000FF DBAT3: 00000000 00000000 F0-F3: 0 6.3102 E-268 2.9783 E-313 2.1409 E-314 F4-F7: 1.2661 E-297 6.8330 E-268 1.2120 E-264 1.2120 E-264 F8-F11: 6.8330 E-268 0 0 0 F12-F15: 0 0 0 0 F16-F19: 0 0 0 0 F20-F23: 0 0 0 0 F24-F27: 0 0 0 0 F28-F31: 0 0 0 0 Warp-OS 2001 by Sam Jordan Last edited by grelbfarlk; 21 February 2018 at 02:05. |
13 February 2018, 09:06 | #133 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,039
|
Emufan at least appeased the subforum by offering the offending programs. Some others just repeated the sacrilege (including not stating real Amiga or UAE).
|
13 February 2018, 11:08 | #134 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
I ran into the same issue with crashing binaries last time I tried as well. I gave up at that point. So did you get this to work in the end?
SIDENOTE: I made sure my WarpOS setup was working by testing known working binaries before attempting to test my own. Could this be useful in any way? http://aminet.net/package/dev/debug/checkstack |
13 February 2018, 12:26 | #135 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,039
|
I'll test the binaries later today. They are still in ELF format?
|
13 February 2018, 12:58 | #136 | |
Registered User
Join Date: Dec 2015
Location: USA
Posts: 2,958
|
Quote:
When I was compiling under WinUAE I just used the 68k WarpOS compiler then the only WarpOS PPC part that had to run under WinUAE was Elf2Exe, which if it crashed only took a second to rerun. I've never seen a situation where a WarpOS program worked in WinUAE but did not work on the real Amiga. |
|
13 February 2018, 13:51 | #137 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,039
|
Could you post a compile with -Wl,--verbose so I can see if the right stuff is linked?
|
13 February 2018, 16:22 | #138 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
|
I don't have the time to read the whole thread, but when I see something like mos2wos, elf2exe and using a V.4-ABI gcc to generate WarpOS executables I have probably read enough.
In case you are wondering about crashes: Did you consider that WarpOS is PowerOpen-ABI and not V.4-ABI? The stack frame format is different! The only gcc-port which implements PowerOpen-ABI was StormC. All other gcc-ports were hacks, which tried to convert the stack frame on the fly, when calling WarpOS kernel functions (because they expect PowerOpen). You would still run into problems with callbacks from the kernel. of course... |
13 February 2018, 16:59 | #139 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,039
|
Yup. I know of the stack incompatibilities. Mos2wos contains the hacks to jump to WarpOS kernel. I did have to adjust them to comply with gcc4, so maybe I did something wrong.
Seeing the amount of stuff compiled for WarpOS with gcc (also with mos2wos) and this, I still think something else is wrong. Especially as it is an instruction exception within a (to the eye) correct memory space. I'll check as soon as I am able to :-). |
13 February 2018, 18:47 | #140 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
Code:
$ /gg/bin/ppc-morphos-gcc-4 -warpup -O2 -Wl,--verbose helloworld.c -o helloworld.exe GNU ld version 2.9.1 (with BFD 2.9.1) Supported emulations: morphos morphos_baserel using internal linker script: ================================================== OUTPUT_FORMAT("elf32-morphos", "elf32-morphos", "elf32-morphos") OUTPUT_ARCH(powerpc) SEARCH_DIR(/gg/lib); SEARCH_DIR(/gg/usr/lib); SEARCH_DIR(/opt/ppc-warpos/ppc-morphos/lib); /* Do we need any of these for elf? __DYNAMIC = 0; */ PROVIDE (__stack = 0); PROVIDE (__machtype = 0x1); SECTIONS { /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } .gnu.version : { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } .rela.text : { *(.rela.text) *(.rela.text.*) *(.rela.gnu.linkonce.t*) } .rela.data : { *(.rela.data) *(.rela.data.*) *(.rela.gnu.linkonce.d*) } .rela.rodata : { *(.rela.rodata) *(.rela.rodata.*) *(.rela.gnu.linkonce.r*) } .rela.got : { *(.rela.got) } .rela.got1 : { *(.rela.got1) } .rela.got2 : { *(.rela.got2) } .rela.ctors : { *(.rela.ctors) } .rela.dtors : { *(.rela.dtors) } .rela.init : { *(.rela.init) } .rela.fini : { *(.rela.fini) } .rela.bss : { *(.rela.bss) *(.rela.bss.*) *(.rela.gnu.linkonce.b.*) } .rela.plt : { *(.rela.plt) } .rela.sdata : { *(.rela.sdata) *(.rela.sdata.*) *(.rela.gnu.linkonce.s.*) } .rela.sbss : { *(.rela.sbss) *(.rela.sbss.*) *(.rela.gnu.linkonce.sb.*) } .rela.sdata2 : { *(.rela.sdata2) *(.rela.sdata2.*) } .rela.sbss2 : { *(.rela.sbss2) *(.rela.sbss2.*) } .text : { PROVIDE (__text_start = .); *(.text) *(.text.*) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.gnu.linkonce.t*) PROVIDE (__text_end = .); } =0 PROVIDE (__text_size = SIZEOF(.text)); .init : { *(.init) } =0 .fini : { *(.fini) } =0 .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) } .rodata1 : { *(.rodata1) *(.rodata1.*) } _etext = .; PROVIDE (etext = .); .sdata2 : { *(.sdata2) *(.sdata2.*) } .sbss2 : { *(.sbss2) *(.sbss2.*) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. It would be more correct to do this: . = ALIGN(0x10000) + (ALIGN(8) & (0x10000 - 1)); The current expression does not correctly handle the case of a text segment ending precisely at the end of a page; it causes the data segment to skip a page. The above expression does not have this problem, but it will currently (2/95) cause BFD to allocate a single segment, combining both text and data, for this case. This will prevent the text segment from being shared among multiple executions of the program; I think that is more important than losing a page of the virtual address space (note that no actual memory is lost; the page which is skipped can not be referenced). */ . = ALIGN(8) + 0x10000; .data : { PROVIDE (__data_start = .); *(.data) *(.data.*) *(.gnu.linkonce.d*) CONSTRUCTORS PROVIDE (__data_end = .); } PROVIDE (__data_size = SIZEOF(.data)); .data1 : { *(.data1) *(.data1.*) } .got1 : { *(.got1) } .dynamic : { *(.dynamic) } /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ PROVIDE (_GOT2_START_ = .); .got2 : { *(.got2) } PROVIDE (__CTOR_LIST__ = .); .ctors : { *(.ctors) } PROVIDE (__CTOR_END__ = .); PROVIDE (__DTOR_LIST__ = .); .dtors : { *(.dtors) } PROVIDE (__DTOR_END__ = .); PROVIDE (_FIXUP_START_ = .); .fixup : { *(.fixup) } PROVIDE (_FIXUP_END_ = .); PROVIDE (_GOT2_END_ = .); PROVIDE (_GOT_START_ = .); .got : { *(.got) } .got.plt : { *(.got.plt) } PROVIDE (_GOT_END_ = .); /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ .sdata : { PROVIDE (__sdata_start = .); *(.sdata) *(.sdata.*) *(.gnu.linkonce.s.*) PROVIDE (__r13_init = 0x8000); PROVIDE (__sdata_end = .); } PROVIDE (__sdata_size = SIZEOF(.sdata)); _edata = .; PROVIDE (edata = .); .sbss : { PROVIDE (__sbss_start = .); *(.sbss) *(.sbss.*) *(.gnu.linkonce.sb.*) *(.scommon) *(.dynsbss) PROVIDE (__sbss_end = .); } PROVIDE (__sbss_size = SIZEOF(.sbss)); .plt : { *(.plt) } .bss : { PROVIDE (__bss_start = .); PROVIDE (__bss_start = .); *(.dynbss) *(.bss) *(.bss.*) *(.gnu.linkonce.b.*) *(COMMON) PROVIDE (__bss_end = .); } PROVIDE (__bss_size = SIZEOF(.bss)); _end = . ; PROVIDE (end = .); /* These are needed for ELF backends which have not yet been converted to the new style linker. */ .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } /* DWARF debug sections. Symbols in the DWARF debugging sections are relative to the beginning of the section so we begin them at 0. */ /* DWARF 1 */ .debug 0 : { *(.debug) } .line 0 : { *(.line) } /* GNU DWARF 1 extensions */ .debug_srcinfo 0 : { *(.debug_srcinfo) } .debug_sfnames 0 : { *(.debug_sfnames) } /* DWARF 1.1 and DWARF 2 */ .debug_aranges 0 : { *(.debug_aranges) } .debug_pubnames 0 : { *(.debug_pubnames) } /* DWARF 2 */ .debug_info 0 : { *(.debug_info) } .debug_abbrev 0 : { *(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame 0 : { *(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 : { *(.debug_loc) } .debug_macinfo 0 : { *(.debug_macinfo) } /* SGI/MIPS DWARF 2 extensions */ .debug_weaknames 0 : { *(.debug_weaknames) } .debug_funcnames 0 : { *(.debug_funcnames) } .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } /* These must appear regardless of . */ } ================================================== attempt to open /gg/ppc-amigaos/lib/startupwos.o succeeded /gg/ppc-amigaos/lib/startupwos.o attempt to open /tmp/ccTMAfJX.o succeeded /tmp/ccTMAfJX.o attempt to open /gg/ppc-amigaos/lib//libgccwos.a succeeded attempt to open /gg/ppc-amigaos/lib//libcwos.a succeeded (/gg/ppc-amigaos/lib//libcwos.a)__nocommandline.o (/gg/ppc-amigaos/lib//libcwos.a)exit.o (/gg/ppc-amigaos/lib//libcwos.a)__stdiowin.o (/gg/ppc-amigaos/lib//libcwos.a)printf.o (/gg/ppc-amigaos/lib//libcwos.a)vprintf.o (/gg/ppc-amigaos/lib//libcwos.a)__stdio.o (/gg/ppc-amigaos/lib//libcwos.a)fdopen.o (/gg/ppc-amigaos/lib//libcwos.a)fopen.o (/gg/ppc-amigaos/lib//libcwos.a)freopen.o (/gg/ppc-amigaos/lib//libcwos.a)open.o (/gg/ppc-amigaos/lib//libcwos.a)vfprintf.o (/gg/ppc-amigaos/lib//libcwos.a)calloc.o (/gg/ppc-amigaos/lib//libcwos.a)free.o (/gg/ppc-amigaos/lib//libcwos.a)malloc.o (/gg/ppc-amigaos/lib//libcwos.a)realloc.o (/gg/ppc-amigaos/lib//libcwos.a)strlen.o (/gg/ppc-amigaos/lib//libcwos.a)fpclassify.o (/gg/ppc-amigaos/lib//libcwos.a)log10.o (/gg/ppc-amigaos/lib//libcwos.a)pow.o (/gg/ppc-amigaos/lib//libcwos.a)scalbn.o (/gg/ppc-amigaos/lib//libcwos.a)sqrt.o (/gg/ppc-amigaos/lib//libcwos.a)_ctype_.o (/gg/ppc-amigaos/lib//libcwos.a)__seterrno.o (/gg/ppc-amigaos/lib//libcwos.a)errno.o (/gg/ppc-amigaos/lib//libcwos.a)__amigapath.o (/gg/ppc-amigaos/lib//libcwos.a)strdup.o (/gg/ppc-amigaos/lib//libcwos.a)__decimalpoint.o (/gg/ppc-amigaos/lib//libcwos.a)__chkabort.o (/gg/ppc-amigaos/lib//libcwos.a)raise.o (/gg/ppc-amigaos/lib//libcwos.a)__fflush.o (/gg/ppc-amigaos/lib//libcwos.a)fputc.o (/gg/ppc-amigaos/lib//libcwos.a)getenv.o (/gg/ppc-amigaos/lib//libcwos.a)copysign.o (/gg/ppc-amigaos/lib//libcwos.a)floor.o (/gg/ppc-amigaos/lib//libcwos.a)huge_val.o (/gg/ppc-amigaos/lib//libcwos.a)inf.o (/gg/ppc-amigaos/lib//libcwos.a)log.o (/gg/ppc-amigaos/lib//libcwos.a)__signalfunc.o (/gg/ppc-amigaos/lib//libcwos.a)__swbuf.o attempt to open /gg/ppc-amigaos/lib/end.o succeeded /gg/ppc-amigaos/lib/end.o |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
emufan can you please port this to Amiga!!? | xboxown | Coders. C/C++ | 93 | 29 November 2017 09:06 |
Just curious; Graphics Card | Sim085 | support.Hardware | 31 | 12 October 2017 15:27 |
Curious about Natami | Pat the Cat | Amiga scene | 13 | 07 January 2017 22:16 |
Hey hey, new guy here... | CarlosTex | Member Introductions | 4 | 05 August 2011 01:29 |
hey hey 16k | Amiga1992 | Nostalgia & memories | 5 | 16 August 2006 22:26 |
|
|