English Amiga Board Amiga Lore


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

 
 
Thread Tools
Old 16 October 2017, 17:29   #441
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 135
Quote:
Originally Posted by MartinW View Post
That's great to hear!

I don't wish to derail things, but what's the current state of play in regard to this on MacOS? I installed a Linux partition on my gaming PC pretty much specifically for this and that's fine, but I'd prefer to get back to my MacBook Air if I could.
AFAIK you should be able to build the toolchain on OSX.
bebbo is offline  
AdSense AdSense  
Old 16 October 2017, 17:54   #442
MartinW
Registered User

 
Join Date: Mar 2017
Location: United Kingdom
Posts: 129
Sorry, my bad. I thought at one point the repo said it didn't work on Mac or at least didn't specifically mention Mac. I may have dreamt that as it certainly does now
MartinW is offline  
Old 17 October 2017, 06:51   #443
alpine9000
Registered User

 
Join Date: Mar 2016
Location: Australia
Posts: 355
Quote:
Originally Posted by MartinW View Post
That's great to hear!

I don't wish to derail things, but what's the current state of play in regard to this on MacOS? I installed a Linux partition on my gaming PC pretty much specifically for this and that's fine, but I'd prefer to get back to my MacBook Air if I could.
It should work fine on MacOS. If you are having problems I can help you get it working.
alpine9000 is offline  
Old 17 October 2017, 23:10   #444
MartinW
Registered User

 
Join Date: Mar 2017
Location: United Kingdom
Posts: 129
Cheers! I'll have another go soon and let you know. IIRC the build environment should be all ready to just git pull and rebuild. Mostly. Ah, actually maybe not. I have a feeling that might have been on a hackintosh I don't have any more. Hmmm. Will check on the MBA.
MartinW is offline  
Old 18 October 2017, 14:49   #445
MartinW
Registered User

 
Join Date: Mar 2017
Location: United Kingdom
Posts: 129
I tried to build on MacOS Sierra 10.13 last night. It got a very long way through but ultimately failed:

Code:
In file included from /Users/mart/amigaos-cross-toolchain/submodules/gcc-6/gcc/bbb-opts.c:71:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/set:390:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:1398:2: error: no member named
      'fancy_abort' in namespace 'std::__1'; did you mean simply 'fancy_abort'?
        _VSTD::abort();
Ultimately ending in:
Code:
15 warnings and 11 errors generated.
make[1]: *** [bbb-opts.o] Error 1
make: *** [all-gcc] Error 2
ERROR: command "make all-gcc CFLAGS_FOR_TARGET=-noixemul -Os MAKEINFO=makeinfo -j1" failed with 2
DEBUG: restoring old value of environment variable "CC"
DEBUG: restoring old value of environment variable "CXX"
DEBUG: restoring old value of environment variable "CXXFLAGS"
DEBUG: restoring old value of environment variable "CFLAGS"
As far as I could see all of the errors were the same 'fancy_abort' error. I tried to search google for this and it was difficult to find anything specific but I did see in one conversation where it implied it might be related to the recent release of Xcode 9.

It's worth noting that I haven't specifically checked my dependencies. My way of doing that is a bit hit and miss. I tend to just run the build, if I get a failure it's usually obvious if it's missing a dep so I add it, re-run, repeat until there are no more missing errors. This doesn't look like one of those however.

Just to be sure I did do a clean and fresh build (with rm -if in the .build folder).
MartinW is offline  
Old 18 October 2017, 19:56   #446
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 135
Quote:
Originally Posted by Marlon_ View Post
Yeah...
Please build milkytracker with the recent version 20171018-194704.

With
Code:
-Os -fno-exceptions -fno-rtti
the size is down to 2295816.

And with the fixed bugs it's maybe working for you too now?
bebbo is offline  
Old Yesterday, 01:22   #447
alpine9000
Registered User

 
Join Date: Mar 2016
Location: Australia
Posts: 355
Quote:
Originally Posted by MartinW View Post
I tried to build on MacOS Sierra 10.13 last night. It got a very long way through but ultimately failed:

Code:
In file included from /Users/mart/amigaos-cross-toolchain/submodules/gcc-6/gcc/bbb-opts.c:71:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/set:390:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:1398:2: error: no member named
      'fancy_abort' in namespace 'std::__1'; did you mean simply 'fancy_abort'?
        _VSTD::abort();
Ultimately ending in:
Code:
15 warnings and 11 errors generated.
make[1]: *** [bbb-opts.o] Error 1
make: *** [all-gcc] Error 2
ERROR: command "make all-gcc CFLAGS_FOR_TARGET=-noixemul -Os MAKEINFO=makeinfo -j1" failed with 2
DEBUG: restoring old value of environment variable "CC"
DEBUG: restoring old value of environment variable "CXX"
DEBUG: restoring old value of environment variable "CXXFLAGS"
DEBUG: restoring old value of environment variable "CFLAGS"
As far as I could see all of the errors were the same 'fancy_abort' error. I tried to search google for this and it was difficult to find anything specific but I did see in one conversation where it implied it might be related to the recent release of Xcode 9.

It's worth noting that I haven't specifically checked my dependencies. My way of doing that is a bit hit and miss. I tend to just run the build, if I get a failure it's usually obvious if it's missing a dep so I add it, re-run, repeat until there are no more missing errors. This doesn't look like one of those however.

Just to be sure I did do a clean and fresh build (with rm -if in the .build folder).
I looked into this and it seems to be an issue since Xcode9 (I had the same problem since upgrading xcode).

I was able to fix it, and I have sent bebbo a patch. If you're up to patching the gcc source yourself, here is the patch:

Code:
diff --git a/gcc/bbb-opts.c b/gcc/bbb-opts.c
index 99785cf5d6a..162625a4362 100755
--- a/gcc/bbb-opts.c
+++ b/gcc/bbb-opts.c
@@ -53,6 +53,9 @@
  */

 #include "config.h"
+#define INCLUDE_VECTOR
+#define INCLUDE_SET
+#define INCLUDE_MAP
 #include "system.h"
 #include "coretypes.h"
 #include "backend.h"
@@ -67,9 +70,6 @@
 #include "tree-pass.h"
 #include "conditions.h"
 #include "langhooks.h"
-#include <vector>
-#include <set>
-#include <map>

 static int xx = 0;
alpine9000 is offline  
Old Yesterday, 08:10   #448
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 135
Quote:
Originally Posted by alpine9000 View Post
I looked into this and it seems to be an issue since Xcode9 (I had the same problem since upgrading xcode).

I was able to fix it, and I have sent bebbo a patch. If you're up to patching the gcc source yourself, here is the patch:

Code:
diff --git a/gcc/bbb-opts.c b/gcc/bbb-opts.c
index 99785cf5d6a..162625a4362 100755
--- a/gcc/bbb-opts.c
+++ b/gcc/bbb-opts.c
@@ -53,6 +53,9 @@
  */

 #include "config.h"
+#define INCLUDE_VECTOR
+#define INCLUDE_SET
+#define INCLUDE_MAP
 #include "system.h"
 #include "coretypes.h"
 #include "backend.h"
@@ -67,9 +70,6 @@
 #include "tree-pass.h"
 #include "conditions.h"
 #include "langhooks.h"
-#include <vector>
-#include <set>
-#include <map>

 static int xx = 0;
I understand that it's not working for you. But I don't understand what should be wrong with
Code:
#include <vector>
#include <set>
#include <map>
You could use a working compiler, no?

Last edited by bebbo; Yesterday at 08:28.
bebbo is offline  
Old Yesterday, 09:15   #449
alpine9000
Registered User

 
Join Date: Mar 2016
Location: Australia
Posts: 355
Quote:
Originally Posted by bebbo View Post
I understand that it's not working for you. But I don't understand what should be wrong with
Code:
#include <vector>
#include <set>
#include <map>
You could use a working compiler, no?
Haha yes, but to be fair I think itís because gcc redefines abort() and this is what causes the issue with the latest Xcode.
alpine9000 is offline  
Old Yesterday, 09:23   #450
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 12
Hi all,

First of all, awesome work, bringing a more modern C++ compiler to the Amiga :-)

I am currently toying around with it, trying to compile ADoom with it.
ADoom was made for SAS/C, so it has a few constructs like this:

Code:
void __regargs __asm indivision_core(register __a0 ULONG indivisioncpldbase,
                           register __d2 UWORD coreadd);

void __regargs __asm indivision_waitconfigdone(register __a0 ULONG indivisioncpldbase);

ULONG __regargs __asm indivision_checkcore(register __a0 ULONG indivisionfpgabase,
				register __d1 UWORD coreid);

void __regargs __asm indivision_initscreen(register __a0 ULONG indivisionfpgabase,
				 register __d0 UBYTE screenmode);

void __regargs __asm indivision_gfxcopy (register __a0 ULONG indivisionfpgabase,
                               register __a2 UBYTE *chunky_data,
                               register __a3 long *palette_data,
                               register __d0 ULONG gfxaddr,
                               register __d1 ULONG size);

What would be the best way to translate such function declarations to gcc (i.e. passing specific function parameters in specific registers).

Thanks a bunch!
pipper is offline  
Old Yesterday, 12:56   #451
MartinW
Registered User

 
Join Date: Mar 2017
Location: United Kingdom
Posts: 129
Quote:
Originally Posted by bebbo View Post
You could use a working compiler, no?
Genuine question - how would I do that? When I looked all bins for stuff like compilers were soft links to clang. It's pretty well embedded on MacOS.

I applied the patch and it got around that problem but I still have a problem further down. On one of the libraries (libm5.4 maybe? something like that) configure fails when it checks to see if the m68k version of gcc can compile and it dies and simply says no.

I didn't investigated further as it was 2:30AM and the battery was virtually out.
MartinW is offline  
Old Yesterday, 13:09   #452
alpine9000
Registered User

 
Join Date: Mar 2016
Location: Australia
Posts: 355
Quote:
Originally Posted by MartinW View Post
Genuine question - how would I do that? When I looked all bins for stuff like compilers were soft links to clang. It's pretty well embedded on MacOS.

I applied the patch and it got around that problem but I still have a problem further down. On one of the libraries (libm5.4 maybe? something like that) configure fails when it checks to see if the m68k version of gcc can compile and it dies and simply says no.

I didn't investigated further as it was 2:30AM and the battery was virtually out.
Iíll try and build the full tool chain with Xcode9 tomorrow, hopefully itís an easy fix.
alpine9000 is offline  
Old Yesterday, 13:18   #453
MartinW
Registered User

 
Join Date: Mar 2017
Location: United Kingdom
Posts: 129
Thank you - your help is appreciated. Don't overlook that I could be missing something or indeed doing something stupid.
MartinW is offline  
Old Yesterday, 21:56   #454
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 135
Quote:
Originally Posted by pipper View Post
Hi all,

First of all, awesome work, bringing a more modern C++ compiler to the Amiga :-)

I am currently toying around with it, trying to compile ADoom with it.
ADoom was made for SAS/C, so it has a few constructs like this:

Code:
void __regargs __asm indivision_core(register __a0 ULONG indivisioncpldbase,
                           register __d2 UWORD coreadd);

void __regargs __asm indivision_waitconfigdone(register __a0 ULONG indivisioncpldbase);

ULONG __regargs __asm indivision_checkcore(register __a0 ULONG indivisionfpgabase,
                register __d1 UWORD coreid);

void __regargs __asm indivision_initscreen(register __a0 ULONG indivisionfpgabase,
                 register __d0 UBYTE screenmode);

void __regargs __asm indivision_gfxcopy (register __a0 ULONG indivisionfpgabase,
                               register __a2 UBYTE *chunky_data,
                               register __a3 long *palette_data,
                               register __d0 ULONG gfxaddr,
                               register __d1 ULONG size);
What would be the best way to translate such function declarations to gcc (i.e. passing specific function parameters in specific registers).

Thanks a bunch!
Code:
int foo2(register int x asm("d0")) {
  return x + x;
}
yields
Code:
_foo2:
        add.l d0,d0
        rts
I'm using a set of macros:
Code:
#if defined(NOASM)
#define ASM
#define RD0(r) r
#define RD1(r) r
...
#elif defined(__GNUC__)
#define ASM
#define RD0(r) register r __asm("d0")
#define RD1(r) register r __asm("d1")
...
#elif defined(__VBCC__)
#define ASM
#define RD0(a) register __reg("d0") a
#define RD1(a) register __reg("d1") a
...
#else // SAS/C
#define ASM __asm
#define RD0(a) register __d0 a
#define RD1(a) register __d1 a
...
#endif

...

int ASM foo2(RD0(int x)) {
  return x+x;
}
bebbo is offline  
AdSense AdSense  
 


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 4 12 October 2016 22:28
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

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 18:29.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.15821 seconds with 14 queries