![]() |
![]() |
#1 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,224
|
GCC 6.2 toolchain for AmigaOS 3
https://github.com/bebbo has ported cross-compiler toolchains for Windows, Linux and Mac OS. I have not tried them yet but it's a very recent version of GCC.
|
![]() |
![]() |
#2 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Nice! Finally a more recent version of GCC. I'll give it a go!
![]() |
![]() |
![]() |
#3 |
Banned
Join Date: Sep 2016
Location: UK
Posts: 2,917
|
Excellent work
![]() I tend to use vbcc thesedays but this is good. |
![]() |
![]() |
#4 |
Amigan
![]() Join Date: Feb 2012
Location: London
Posts: 1,324
|
I tried to build this last week. Run into a couple of problems I couldn't solve.
I made some notes, which I was intending to post after I got everything working: 1. The page has: # git clone git://github.com/cahirwpz/amigaos-cross-toolchain.git But this should be: # git clone git://github.com/bebbo/amigaos-cross-toolchain.git otherwise you will build gcc 2.95 like me :-) 2. You are going to need 32bit gcc and libs (anyone know why?). Didn't keep all my notes but I needed at least these: sudo apt-get install libgmp-dev:i386 libmpfr-dev:i386 libmpc-dev:i386 gcc-multilib g++-multilib 3. Don't forget the "--gcc 6" parameter! It says it right at the top of the page but wasn't obvious to me. 4. You need a github account with a ssh key! I think this is because the scripts use ssh:// instead of https:// (which shouldn't be necessary for a RO checkout). You can add a key here: https://github.com/settings/ssh After all this I get 2 errors. Code:
/usr/bin/install: cannot create regular file '/home/paul/source/gcc6.2/amigaos-cross-toolchain/.build-m68k/host/man/man1/flex.1': No such file or directory Makefile:180: recipe for target 'install.man' failed GCC actually builds OK but libnix fails. submodules/libnix/sources/stubs/../nix/misc/__request.c Code:
toolchain/submodules/libnix/sources/stubs/../headers -O3 -fomit-frame-pointer -c /home/paul/source/gcc6.2/amigaos-cross-toolchain/submodules/libnix/sources/stubs/../nix/misc/__request.c -o ../nix/misc/__request.o In file included from /opt/m68k-amigaos/os-include/inline/intuition.h:16:0, from /opt/m68k-amigaos/os-include/proto/intuition.h:13, from /home/paul/source/gcc6.2/amigaos-cross-toolchain/submodules/libnix/sources/stubs/../nix/misc/__request.c:2: /home/paul/source/gcc6.2/amigaos-cross-toolchain/submodules/libnix/sources/stubs/../nix/misc/__request.c: In function ‘__request’: /home/paul/source/gcc6.2/amigaos-cross-toolchain/submodules/libnix/sources/stubs/../nix/misc/__request.c:13:26: error: invalid use of void expression if (((struct Process *)FindTask(NULL))->pr_WindowPtr != (APTR)-1L) { ^ /home/paul/source/gcc6.2/amigaos-cross-toolchain/submodules/libnix/sources/stubs/../nix/misc/__request.c:14:23: error: void value not ignored as it ought to be if ((IntuitionBase=OpenLibrary(__intuitionname,0))) { ^ Building under Debian Linux VM. Cahirwpz's GCC 2.95 builds correctly. Would love to know if anyone else has similar issues. Last edited by nogginthenog; 09 January 2017 at 17:20. |
![]() |
![]() |
#5 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
|
![]() |
![]() |
#6 |
Amigan
![]() Join Date: Feb 2012
Location: London
Posts: 1,324
|
Seems to be a problem with the inlines or protos:
Code:
#include <proto/dos.h> void test() { Open("",MODE_OLDFILE); } Code:
In file included from /opt/m68k-amigaos/os-include/inline/dos.h:16:0, from /opt/m68k-amigaos/os-include/proto/dos.h:13, from test.c:1: test.c: In function âtestâ: test.c:5:4: error: asm-specifier for variable â_Open_reâ conflicts with asm clobber list Open("",MODE_OLDFILE); ^ test.c:5:4: error: asm-specifier for variable â_n1â conflicts with asm clobber list Code:
void test() { ({ CONST_STRPTR _Open_v1 = ( "" );LONG _Open_v2 = (1005); { register BPTR _Open_re __asm("d0"); register struct Library * const _Open_bn __asm("a6") = (struct Library * )(DOSBase); register CONST_STRPTR _n1 __asm( "d1" ) = _Open_v1; register LONG _n2 __asm( "d2" ) = _Open_v2; __asm volatile("jsr a6@(-" "0x1e" ":W)": "=r" (_Open_re): "r" (_Open_bn), "rf" (_n1), "rf" (_n2): "d0", "d1", "a0", "a1", "fp0", "fp1", "cc", "memory"); _Open_re; } }); } Last edited by nogginthenog; 09 January 2017 at 17:22. |
![]() |
![]() |
#7 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 732
|
This is from gcc3.4.0
Code:
void test() { ({ CONST_STRPTR _Open_v1 = (""); LONG _Open_v2 = (1005); BPTR _Open_re2 = ({ register int _d1 __asm("d1"); register int _a0 __asm("a0"); register int _a1 __asm("a1"); register BPTR _Open_re __asm("d0"); register void *const _Open_bn __asm("a6") = (DOSBase); register CONST_STRPTR _n1 __asm("d1") = _Open_v1; register LONG _n2 __asm("d2") = _Open_v2; __asm volatile ("jsr a6@(-""0x1e"":W)" : "=r" (_Open_re), "=r" (_d1), "=r" (_a0), "=r" (_a1) : "r" (_Open_bn), "rf"(_n1), "rf"(_n2) : "fp0", "fp1", "cc", "memory"); _Open_re; }); _Open_re2; }); } Interestingly enough, the 6.x says that a0,a1 are clobbered and 3.x does not. Last edited by alkis; 09 January 2017 at 17:59. Reason: a0/a1 |
![]() |
![]() |
#8 |
Amigan
![]() Join Date: Feb 2012
Location: London
Posts: 1,324
|
Tested 2.95 vs 6.20 and they both produce identical code for the Open() wrapper.
I wonder if fd2sfd needs work? I don't think Debian is an issue but I will spin up a 32bit Ubuntu VM just in case. The compiler is working but OS support would be useful :-) |
![]() |
![]() |
#9 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Mac has the same issue, so I doubt it's the OS. Would be nice if we could get the author to this thread so he's aware.
|
![]() |
![]() |
#10 |
Amigan
![]() Join Date: Feb 2012
Location: London
Posts: 1,324
|
I've emailed Steffan and invited him to this thread.
|
![]() |
![]() |
#11 | ||||
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 696
|
Quote:
Quote:
Quote:
Quote:
... committed it without testing 2.93. Then the libnix will build partially. Relative code is not yet working. Last edited by bebbo; 10 January 2017 at 00:35. |
||||
![]() |
![]() |
#12 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 696
|
I also enabled the "github issues" ticket tracking.
|
![]() |
![]() |
#13 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
|
![]() |
![]() |
#14 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
The latest commits made it go much further for me on Debian!
EDIT: I do get a lot of these: Code:
m68k-amigaos-gcc: error: ../nix/stdio/vsscanf.S: No such file or directory m68k-amigaos-gcc: fatal error: no input files Code:
m68k-amigaos-gcc: error: extra/dirent.S: No such file or directory m68k-amigaos-gcc: fatal error: no input files Code:
m68k-amigaos-gcc: error: socket/__initsock.S: No such file or directory m68k-amigaos-gcc: fatal error: no input files Code:
m68k-amigaos-gcc: error: unrecognized command line option '-fbaserel'; did you mean '-fassert'? Last edited by Marlon_; 10 January 2017 at 00:58. |
![]() |
![]() |
#15 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 696
|
Quote:
As long you are not using the -fbaserel option you should be able to compile and link Amiga executables now. |
|
![]() |
![]() |
#16 | |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
Quote:
![]() I don't feel like the whole toolchain has successfully been compiled though, and I get funky stuff like this when trying to compile the example files that did compile with gcc-2 Code:
amigaos-cross-toolchain/examples$ make m68k-amigaos-gcc -g -Os -Wall -fomit-frame-pointer hello-ks13.c -o hello-ks13 hello-ks13.c: In function ‘main’: hello-ks13.c:12:40: warning: pointer targets in initialization differ in signedness [-Wpointer-sign] if ((DOSBase = (struct DosLibrary *) OpenLibrary("dos.library", 34))) { ^~~~~~~~~~~ hello-ks13.c:17:1: internal compiler error: in default_no_named_section, at varasm.c:6230 } ^ 0x8781926 default_no_named_section(char const*, unsigned int, tree_node*) /home/marlon/amigaos-cross-toolchain/submodules/gcc-6/gcc/varasm.c:6230 0x878322f switch_to_section(section*) /home/marlon/amigaos-cross-toolchain/submodules/gcc-6/gcc/varasm.c:7148 0x8787f13 assemble_start_function(tree_node*, char const*) /home/marlon/amigaos-cross-toolchain/submodules/gcc-6/gcc/varasm.c:1761 0x8320d41 rest_of_handle_final /home/marlon/amigaos-cross-toolchain/submodules/gcc-6/gcc/final.c:4439 0x8320d41 execute /home/marlon/amigaos-cross-toolchain/submodules/gcc-6/gcc/final.c:4516 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. <builtin>: recipe for target 'hello-ks13' failed make: *** [hello-ks13] Error 1 Last edited by Marlon_; 10 January 2017 at 13:10. |
|
![]() |
![]() |
#17 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 696
|
No one said it's a release version.
If I have time I'll continue working on building libnix without errors. |
![]() |
![]() |
#18 |
Amigan
![]() Join Date: Feb 2012
Location: London
Posts: 1,324
|
Thanks Bebbo :-) I didn't realise you are on this board. I will have a play.
|
![]() |
![]() |
#19 |
AmigaDev.com
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
|
|
![]() |
![]() |
#20 |
Amigan
![]() Join Date: Feb 2012
Location: London
Posts: 1,324
|
Late home today due to a train drivers strike in Southern England. 2 hours to get home from work :-(
This seems to be the cause of the problems. Error: Unknown pseudo-op: `.section' Confirmed that m68k-amigaos-as does not support .section Example: Code:
paul@debian:cd ~/source/gcc6.2/amigaos-cross-toolchain/submodules/libnix/sources/stubs/stubs /opt/m68k-amigaos/bin/m68k-amigaos-gcc __dtor_list__.c /tmp/cctMPpYM.s: Assembler messages: /tmp/cctMPpYM.s:3: Error: Unknown pseudo-op: `.section' /opt/m68k-amigaos/bin/m68k-amigaos-gcc -S __dtor_list__.c cat __dtor_list__.s #NO_APP .globl ___DTOR_LIST__ .section .bss .align 2 ___DTOR_LIST__: .skip 8 Thanks for the great work Bebbo, we appreciate it :-) |
![]() |
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests) | |
Thread Tools | |
![]() |
||||
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 |
|
|