English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 13 December 2017, 05:16   #201
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
Quote:
Originally Posted by Marlon_ View Post
Elf2exe2 usage:
./elf2exe2 file.elf file.hunk

Exactly the same way elf2hunk works.

So it should work just the same with warpcollect.
Very exciting, I hope you make it work.
grelbfarlk is online now  
Old 13 December 2017, 08:55   #202
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 822
Custom options are no longer supported, I mean. I use the -warpup option which is defined in the specs file to build for WarpOS. In the newer gcc versions only options compiled into gcc can be changed using the specs file. Custom options are ignored.


Quote:
Originally Posted by Marlon_ View Post
So, yeah, specs files still work:
Code:
[marlon@hastur]:~/tmp/MilkyTracker/morphos-cross-toolchain/WarpOS$ ppc-morphos-gcc -v -warpup test.cpp 
Reading specs from /opt/ppc-morphos/bin/../lib/gcc-lib/ppc-morphos/5.3.0/specs
COLLECT_GCC=ppc-morphos-gcc
COLLECT_LTO_WRAPPER=/opt/ppc-morphos/bin/../lib/gcc-lib/ppc-morphos/5.3.0/lto-wrapper
ppc-morphos-gcc: error: unrecognized command line option ‘-warpup’
Target: ppc-morphos
Configured with: ../gcc-5.3.0/configure --target=ppc-morphos --enable-languages=c,c++,objc --prefix=/gg --with-sysroot=/gg --libexecdir=/gg/lib --oldincludedir=/gg/include --program-prefix=ppc-morphos- --program-suffix=-5 --enable-threads=morphos --disable-bootstrap --with-pkgversion=GCC/MorphOS --with-bugurl=http://www.morphos-team.net/ --enable-version-specific-runtime-libs --with-gmp=/home/marlon/tmp/MilkyTracker/morphos/gcc5/libs --with-mpfr=/home/marlon/tmp/MilkyTracker/morphos/gcc5/libs --with-mpc=../libs
Thread model: morphos
gcc driver version 5.3.0 (GCC/MorphOS) executing gcc version 4.4.5
But I think the format might be different!
Hedeon is offline  
Old 13 December 2017, 14:57   #203
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 30
Posts: 485
Quote:
Originally Posted by Hedeon View Post
Custom options are no longer supported, I mean. I use the -warpup option which is defined in the specs file to build for WarpOS. In the newer gcc versions only options compiled into gcc can be changed using the specs file. Custom options are ignored.
the weird thing is, custom options still work if you specify the specs file with --specs= but not when gcc is automatically loading the specs file.
One could simply solve this (on Linux at least) by doing:
Code:
alias ppc-morphos-gcc='ppc-morphos-gcc --specs=SPECSFILE'
Regarding Elf2exe2, there are two alternatives that does essentially the same thing.
Elf2exe2 usage: ./Elf2exe2 elf-file hunk-file

1. elf2hunk from AROS repo: it does exactly this, but it's main purpose is to convert m68k-elf to m68k-hunk, so it requires some modification to produce the extended hunk format.
elf2hunk usage: ./elf2hunk elf-file hunk-file

2. vlink: according to the documentation it is possible to convert elf-files to amiga extended hunk format, I've done some tests, but with my version of vlink it gives me a segmentation fault for milkytracker, but works flawlessly with other smaller files.
vlink usage: ./vlink elf-file -bamigaehf -o hunk-file

I intend to investigate how vlink does things and do a fork of elf2hunk to replicate the functionality of Elf2exe2. All the information is there, someone just needs to do it.
The biggest hurdle is that I do not own a PPC accelerator, so I have no way to test the executables on hardware, but is it possible to set up UAE + QEMU-PPC to do a WarpOS setup?
If so how? Anyone got a guide?

Sorted!

Last edited by Marlon_; 13 December 2017 at 16:44.
Marlon_ is offline  
Old 13 December 2017, 16:45   #204
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
Quote:
Originally Posted by Marlon_ View Post
QEMU-PPC to do a WarpOS setup?
If so how? Anyone got a guide?
get the PPC CPU core plugin, WinUAE 3.0 or later - and try the settings in winuae:

config -> expansion:
-> Accelerator Board Settings:
---> Phase 5 - CyberStorm
---> CyberStorm PPC
-> Accelerator Board ROM file:
---> Cyberstorm PPC (128k)
-> Accelerator Board memory: 128mb

expansion roms are on the ftp/zone - expansion_boot_roms.zip
maybe that is already enough - cannot remember exactly.

but I have no idea which system software you need

Last edited by emufan; 13 December 2017 at 16:58.
emufan is offline  
Old 13 December 2017, 16:47   #205
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 30
Posts: 485
Quote:
Originally Posted by emufan View Post
get the PPC CPU core plugin, WinUAE 3.0 or later - and try the settings in the attached image.
expansion roms are on the ftp/zone - expansion_boot_roms.zip
maybe that is already enough - cannot remember exactly.
I run Mac / Linux and FS-UAE, but I got it sorted. It's the same setup I use to test my OS4.1 binaries with.
All I had to do was installing up to date WarpOS on OS39.
Marlon_ is offline  
Old 13 December 2017, 16:55   #206
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
Quote:
Originally Posted by Marlon_ View Post
I run Mac / Linux and FS-UAE, but I got it sorted. It's the same setup I use to test my OS4.1 binaries with.
All I had to do was installing up to date WarpOS on OS39.
ok, good
emufan is offline  
Old 13 December 2017, 22:46   #207
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 822
I think EHF is only for StormC. The WarpOS stuff I compile mostly have the standard hunks..Try the Aros one, I'd say.
Hedeon is offline  
Old 13 December 2017, 22:50   #208
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 30
Posts: 485
Quote:
Originally Posted by Hedeon View Post
I think EHF is only for StormC. The WarpOS stuff I compile mostly have the standard hunks..Try the Aros one, I'd say.
I've gotten as far as setting up a warpos toolchain, but the elf files are broken when I compile this:
Code:
#include<stdio.h>

int main()
{
    printf("Hello World");
}
Code:
$ ppc-warpos-g++ -Wall -fno-rtti -mhard-float -O3 -fomit-frame-pointer -fno-exceptions  -warpup -t WarpOS/test.cpp -o test.elf
/opt/ppc-morphos/bin/ppc-morphos-ld: mode morphos
/opt/ppc-warpos/lib/startupwos.o
/tmp/ccWqeBbM.o
(/opt/ppc-warpos/lib//libcwos.a)__nocommandline.o
(/opt/ppc-warpos/lib//libcwos.a)printf.o
(/opt/ppc-warpos/lib//libcwos.a)vprintf.o
(/opt/ppc-warpos/lib//libcwos.a)__stdio.o
(/opt/ppc-warpos/lib//libcwos.a)fopen.o
(/opt/ppc-warpos/lib//libcwos.a)calloc.o
(/opt/ppc-warpos/lib//libcwos.a)malloc.o
(/opt/ppc-warpos/lib//libcwos.a)freopen.o
(/opt/ppc-warpos/lib//libcwos.a)free.o
(/opt/ppc-warpos/lib//libcwos.a)errno.o
(/opt/ppc-warpos/lib//libcwos.a)__fflush.o
(/opt/ppc-warpos/lib//libcwos.a)open.o
(/opt/ppc-warpos/lib//libcwos.a)__seterrno.o
(/opt/ppc-warpos/lib//libcwos.a)realloc.o
(/opt/ppc-warpos/lib//libcwos.a)__chkabort.o
(/opt/ppc-warpos/lib//libcwos.a)raise.o
(/opt/ppc-warpos/lib//libcwos.a)__signalfunc.o
(/opt/ppc-warpos/lib//libcwos.a)memmove.o
(/opt/ppc-warpos/lib//libcwos.a)bcopy.o
(/opt/ppc-warpos/lib//libcwos.a)__amigapath.o
(/opt/ppc-warpos/lib//libcwos.a)strdup.o
(/opt/ppc-warpos/lib//libcwos.a)__stdiowin.o
(/opt/ppc-warpos/lib//libcwos.a)exit.o
(/opt/ppc-warpos/lib//libcwos.a)vfprintf.o
(/opt/ppc-warpos/lib//libcwos.a)_ctype_.o
(/opt/ppc-warpos/lib//libcwos.a)fputc.o
(/opt/ppc-warpos/lib//libcwos.a)__swbuf.o
(/opt/ppc-warpos/lib//libcwos.a)isinf.o
(/opt/ppc-warpos/lib//libcwos.a)isnan.o
(/opt/ppc-warpos/lib//libcwos.a)__decimalpoint.o
(/opt/ppc-warpos/lib//libcwos.a)pow.emb.o
/opt/ppc-warpos/lib/end.o
Even running Elf2exe2 in WarpOS produces a broken binary hunk. :/



Do you have any test sources I can use to test build something?
Marlon_ is offline  
Old 14 December 2017, 01:15   #209
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
Quote:
Originally Posted by Marlon_ View Post
I've gotten as far as setting up a warpos toolchain, but the elf files are broken when I compile this:


Do you have any test sources I can use to test build something?
How about bogomips?
https://github.com/Sakura-IT/SonnetA...ols/bogomips.c

Granted I've only tried to compile this under VBCC but it should work.

Also regarding UAE, from what I've seen, UAE is not so great for WarpOS. If the app launches then usually you're fine but I gave up on it as there's about a 50% chance the powerpc.library crashes on launching an app. So I could run a large compile and that would go fine up until elf2exe2 was called then about a 50% chance it would crash at that point.

Last edited by grelbfarlk; 14 December 2017 at 02:26.
grelbfarlk is online now  
Old 14 December 2017, 04:13   #210
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 30
Posts: 485
Quote:
Originally Posted by grelbfarlk View Post
How about bogomips?
https://github.com/Sakura-IT/SonnetA...ols/bogomips.c

Granted I've only tried to compile this under VBCC but it should work.

Also regarding UAE, from what I've seen, UAE is not so great for WarpOS. If the app launches then usually you're fine but I gave up on it as there's about a 50% chance the powerpc.library crashes on launching an app. So I could run a large compile and that would go fine up until elf2exe2 was called then about a 50% chance it would crash at that point.
Well, if I even get that far. According to elf2exe2, loadelfwos, vlink and elf2hunk, the compiler spits out junk. :P I've tested WarpOS binaries in UAE, so I know the issue doesn't lie within WarpOS.
Marlon_ is offline  
Old 14 December 2017, 04:41   #211
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
What kind of junk? Not that I'm going to be able to help but just curious. Also I believe in you, make it work.
grelbfarlk is online now  
Old 14 December 2017, 04:55   #212
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 30
Posts: 485
Quote:
Originally Posted by grelbfarlk View Post
What kind of junk? Not that I'm going to be able to help but just curious. Also I believe in you, make it work.
well, checkelfwos says .sdata 2 doesn't have memory allocation.
test.hunk generated by elf2hunk just gives me error #8000 0004 (memory), doesn't even launch WarpOS.
loadelfwos launches test.elf in WarpOS, but gives an error.
test.exe generated by elf2exe2 launches in WarpOS, and gives the same error as loadelfwos did.

Comparing test.hunk and test.exe in a binary/hex comparison/diff shows that he end result is completely different in the binaries.

But my conclusion is that something isn't exactly right when the binary was compiled in the toolchain either.

So far I've tested with gcc-5, but since gcc-4 works on MorphOS for Hedeon, I'll give that a go next. If that does work, that means I need to do changes to the specs file that Hedeon made for gcc-4 to make it work with gcc-5+ setups.

If you feel like messing about with this yourselves sometime, I've made a pretty straightforward morphos cross toolchain install script, which is located here: https://github.com/AmigaPorts/morphos-cross-toolchain

Then combine that with: http://aminet.net/package/dev/gcc/gcc-mos2wos

Replace warpcollect in lib/gcc-lib/ppc-morphos/[VERSION]/ with your own compile of http://aminet.net/package/dev/c/warpcollect with modified paths.

Or simply change lib/gcc-lib/ppc-morphos/[VERSION]/specs to use collect2 instead of warpcollect, and use Elf2exe2 on MorphOS/WarpOS

AROS elf2hunk is located here: https://github.com/michalsc/AROS/blo...unk/elf2hunk.c
it requires some modification and knowledge about elf and hunk headers.

I've already begun to make changes to the toolchain install script to accomodate for a warpos setup.
Usage:
Code:
$ ./toolchain-morphos -h
MorphOS Cross Toolchain v1.5
Usage: ./toolchain-morphos [OPTION]...

Options:
  -p,  --prefix                 choose the path for your prefix. Default: /opt/ppc-morphos
  -g,  --gcc                    pick the version of gcc you want to install. Available versions: gcc4, gcc5 (default)
  -w,  -warpup                  install WarpOS toolchain
  -v,  --version                display the SDK-version of MorphOS and exit
  -h,  --help                   print this help
To install the MorphOS toolchain (works as far as I know):
Code:
./toolchain-morphos --prefix /opt/ppc-morphos --gcc gcc5
To install the incomplete WarpOS toolchain (edits only apply to gcc5 so far):
Code:
./toolchain-morphos --prefix /opt/ppc-warpos --gcc gcc5 -warpup

Last edited by Marlon_; 14 December 2017 at 05:01.
Marlon_ is offline  
Old 15 December 2017, 02:36   #213
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
Here is where I was going to show a screenshot of a new project that just got built but my sys partition has been eaten....
New version of SDL 1.2.15 working with new SDL_Mixer and SDL_Image let me finally get this running. Freesynd 0.7 for Classic Amiga.



Then I read the readme and it has a lot of problems like every shot is a one hit kill.... and stuff. Oh well it was a good test of the libs.

Last edited by grelbfarlk; 15 December 2017 at 03:46.
grelbfarlk is online now  
Old 18 December 2017, 03:27   #214
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
Steve House fixed the ASL requester, it now works properly on WarpOS.
grelbfarlk is online now  
Old 18 December 2017, 03:47   #215
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 30
Posts: 485
Quote:
Originally Posted by grelbfarlk View Post
Steve House fixed the ASL requester, it now works properly on WarpOS.
And it looks alright as well? Can I get all your changes so I can apply them to the main source? Including makefile.

Assuming you're talking about MilkyTracker of course.
Marlon_ is offline  
Old 18 December 2017, 04:38   #216
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
Quote:
Originally Posted by Marlon_ View Post
And it looks alright as well? Can I get all your changes so I can apply them to the main source? Including makefile.

Assuming you're talking about MilkyTracker of course.
No it doesn't look right yet, still BE mode in 16-bit. It does look ok in 24-bit. Also 8-bit doesn't work. Send me a PM with your email or something.
grelbfarlk is online now  
Old 27 December 2017, 21:04   #217
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
Here someone see if they can make this work. It's Retroarch built with SNES2010, no other cores included-for now. I guess it needs xmb/monochrome/ and named_boxarts.png. Oh and a config file of some sort.

It's totally untested other than crashing with a black window looking for skins.

If it does work then I'll try to add some more cores. Final Burn Alpha seemed to build alright but it was built for MorphOS so optimistically it'd just need a recompile.

The xmb skin assets can be downloaded here:
https://github.com/libretro/retroarc...ive/master.zip

I guess XMB needs GL, so RGUI it is.


Attachment removed, I don't think it does anything.

A little progress

Last edited by grelbfarlk; 30 December 2017 at 23:33.
grelbfarlk is online now  
Old 31 December 2017, 18:43   #218
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
After trying to get various cores to work I found one that does sort of work to an extent. Libretro-PrBoom running from Retroarch:

grelbfarlk is online now  
Old 05 January 2018, 02:25   #219
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,425
Small status update, things are running faster but still not quite fast enough. PrBoom and Snes2005 cores work, PrBoom runs quite well and sound is good except for lacking music yet, Snes is still a bit slow and sound is glitchy. Problem I'm having with some of the other cores is the C++ limitation, or all of the game code in a C core is fine but it will have a single C++ source which causes all sorts of havoc. Haven't thought of a way of getting around that yet.
Also OpenTyrian kind of works but input is lagged to hell so it looks and sounds fine it's not playable because the input is horrible.

Had the idea to build the one .cpp include with 2.95.3 in a FBAlpha core, this was the result:
Code:
LD retroarch
/gg/ppc-amigaos/lib//libretro.a(libretro.o): In function `__default_alloc_template<false, 0>::_S_chunk_alloc(unsigned int, int &)':
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x14a):
undefined reference to `endl(ostream &)'
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x152):
undefined reference to `endl(ostream &)'
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x156):
undefined reference to `cerr'
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x16e):
undefined reference to `cerr'
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x170):
undefined reference to `ostream::operator<<(char const *)'
make: *** [retroarch] Error 1

Last edited by grelbfarlk; 05 January 2018 at 04:58.
grelbfarlk is online now  
Old 05 January 2018, 14:54   #220
trixster
Guru Meditating

 
Join Date: Jun 2014
Location: England
Posts: 1,196
Great work so far grelbfarlk! Interesting updates!
trixster is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sdl-1.2.15 Marlon_ Coders. C/C++ 40 13 March 2018 15:43
UAE for WarpOS 0.8.12 grelbfarlk request.Apps 0 23 November 2016 02:14
WarpOS Programming Help? esc support.Other 8 21 October 2015 11:37
WinUAE w/SDL mangamuscle request.UAE Wishlist 8 31 January 2007 12:41
What do you know about Amiga SDL? Tolismlf Amiga scene 6 15 November 2004 19:54

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:54.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.10027 seconds with 16 queries