02 February 2019, 15:11 | #1061 | |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Quote:
Thanks Alkis! Seems I don't have m68k-amigaos-gprof or the required libs in my pre-packaged toolchain. So am checking out bebbo's and building from scratch.. It's taking forever and a day in Cygwin/Windows. If these are not in the toolchain could you tell me where they are? |
|
02 February 2019, 16:08 | #1062 | ||
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 724
|
Quote:
Quote:
gprof is in the toolchain. |
||
03 February 2019, 10:57 | #1063 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
|
|
03 February 2019, 14:51 | #1064 |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Hi Alkis, that's awesome, all working now. Now if I could figure out how to build the assembly with - not - C linkage I would be set to go. Your help was awesome.
|
03 February 2019, 14:57 | #1065 | |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Quote:
|
|
03 February 2019, 16:03 | #1066 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 724
|
|
03 February 2019, 16:24 | #1067 | |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Quote:
Snoopdos shows the system loads mathieeedoubletrans and then opens my application. First line of application is cout << and its at least not getting to the point where it can flush that first to shell. visually launch and crash. I am not set up with a debugger at this point so I cant step.. More testing before post.... I was using -O3 and -m68040 tried removing these but still no joy. I went ahead and tested same executable on real hardware (060) and get a terminate like this "terminate called after throwing an instance of 'std::_iosfailure' what(): basic_ios::clear Program aborted Looks like iostream errors, so I narrowed main() down to the below and still have same terminate on real hardware Code:
int main (int argc, char *argv[]) { // cout << "1 :" << myfunction(1) << endl; // cout << "2 :" << myfunction(2) << endl; cout << "Launching..." << endl; // gameMain(); cout << "Exited. Press ENTER to continue..." << endl; cin.get(); return 0; } I'm OK to stick with older version, or not even use iostream tbh... But for your info the above seems active on the package you linked. |
|
03 February 2019, 16:27 | #1068 |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
I am using C++ so default C++ linkage everywhere, the asm is compiled with "C" linkage, so I need to forward declare with extern "C" int function(); rather than just int function(); The last as default is C++ linkage right.
Not a big deal really I can work around it with some macros in the headers. |
03 February 2019, 19:20 | #1069 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,574
|
Attach binary, thanks. (But it sounds like different config/WB/or too small stack, the usual)
|
04 February 2019, 01:41 | #1070 | |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Quote:
This ver built using the latest toolchain that bebbo linked me here http://franke.ms/download/setup-amiga-gcc.exe. Using to compile- Code:
m68k-amigaos-c++ hello.cpp -o hello.exe -Os -noixemul I checked it booting from WB3.1 FDD as well as my HDD image. Remember this application is also terminated without executing fully on real Amiga as well. Just different termination behaviour. Guru vs terminate. |
|
04 February 2019, 08:02 | #1071 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
it's rather my broken toolchain, the usual... ... the merge with 6.5.0 created this issue: no code for CTORS* is created => no CTOR is invoked. => cout is uninitialized => boom EDIT: * no code to register CTOR/DTOR for startup/exit Last edited by bebbo; 04 February 2019 at 08:15. |
|
04 February 2019, 08:14 | #1072 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 678
|
I can confirm that the simple example is crashing. I don't think its a problem with WinUAE, most likely with the gcc toolchain and its C++ standard library.
|
04 February 2019, 09:13 | #1073 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
I just pushed the fix. new setup-amiga-gcc.exe is available...
EDIT: now :-) Last edited by bebbo; 04 February 2019 at 11:34. |
04 February 2019, 14:13 | #1074 |
Registered User
Join Date: Jan 2019
Location: Brisbane
Posts: 99
|
Hey bebbo, awesome!
Do we always grab the latest from the same link - http://franke.ms/download/setup-amiga-gcc.exe ? Grabbed from that link, confirmed working great! Cheers! Last edited by Auscoder; 04 February 2019 at 14:34. |
04 February 2019, 14:30 | #1075 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
|
|
04 February 2019, 16:18 | #1076 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,574
|
It reads from non-existing RAM which can return "random" data that can also depend on used hardware. UAE returned zero and code used returned value as destination pointer for some copy or clear operation. Result was execbase and interrupt vector overwrite..
|
18 February 2019, 14:59 | #1077 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 195
|
Hi,
I have a question regarding the scope when using this toolchain. I have a class which is kind of a wrapper around some dos.library functions. Here is the Open() method as an example: Code:
#include <proto/dos.h> ... bool AmigaFile::Open(const SimpleString& p_FileName, int p_amigaDosAccessMode) { // Opening the file m_pFile = ::Open(p_FileName.C_str(), p_amigaDosAccessMode); if(m_pFile == NULL) { // Opening failed return false; } return true; } This compiles without errors in StormC4 / gcc mode. But with the toolchain there is a naming conflict. I just come around it by renaming the method e.g. to OpenF() and by calling simply Open() instead of ::Open(). But especially the method renaming seems no good solution. Is there a better way? |
18 February 2019, 15:32 | #1078 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
If you'd use 'clib/dos_protos.h' protos instead, you get real functions - provided by libamiga - but you'll use stubs to call the libraries. EDIT: you might use lowercase for your functions as for verbs in real world languages... |
|
18 February 2019, 18:37 | #1079 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 195
|
Thank you, bebbo!
So I'll try using #include <clib/dos_protos.h> I usually write the public methods uppercase to distinguish them from private and protected methods. But I really might rethink this for future projects as today it admittedly seems a bit archaic:-) |
19 February 2019, 16:53 | #1080 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 195
|
Makefile creation
If this is off topic, please ignore this post.
I've now changed my example to compile without problems using the command line Code:
/opt/amiga/bin/m68k-amigaos-g++ AmigaFile.cpp SimpleString.cpp main.cpp The I wanted to create a simple makefile: Code:
CC=/opt/amiga/bin/m68k-amigaos-c++ CPPFLAGS=-I. -I/opt/amiga/m68k-amigaos/ndk-include/ Application: AmigaFile.o SimpleString.o main.o $(CC) -o Application AmigaFile.o SimpleString.o main.o -I. Code:
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:47:0, from /usr/include/x86_64-linux-gnu/sys/types.h:219, from /usr/include/stdlib.h:275, from /usr/include/c++/6/cstdlib:75, from /usr/include/c++/6/stdlib.h:36, from Array.h:4, from AmigaFile.h:6, from AmigaFile.cpp:3: /usr/include/x86_64-linux-gnu/bits/time.h:30:8: error: redefinition of ‘struct timeval’ struct timeval ^~~~~~~ In file included from /opt/amiga/m68k-amigaos/ndk-include/dos/dosextens.h:26:0, from /opt/amiga/m68k-amigaos/ndk-include/clib/dos_protos.h:21, from AmigaFile.cpp:1: /opt/amiga/m68k-amigaos/ndk-include/devices/timer.h:30:8: error: previous definition of ‘struct timeval’ struct timeval { |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
New GCC based dev toolchain for AmigaOS 3.x | cla | Coders. Releases | 8 | 24 December 2017 10:18 |
Issue with photon/xxxx WinUAE Toolchain | arpz | Coders. Asm / Hardware | 2 | 26 September 2015 22:33 |
New 68k gcc toolchain | arti | Coders. C/C++ | 17 | 31 July 2015 03:59 |
Hannibal's WinUAE Demo Toolchain 5 | Bobic | Amiga scene | 1 | 23 July 2015 21:04 |
From gcc to vbcc. | Cowcat | Coders. General | 9 | 06 June 2014 14:45 |
|
|