English Amiga Board


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

 
 
Thread Tools
Old 23 March 2017, 17:40   #121
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
sorry, no matter..

Last edited by wawa; 23 March 2017 at 17:49.
wawa is offline  
Old 23 March 2017, 20:36   #122
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by sbergmann View Post
You could limit the amount of history pulled using "git clone" using "--depth" and/or "--single-branch": https://git-scm.com/docs/git-clone#g...depthltdepthgt
To be more precise:

Code:
  git clone https://github.com/bebbo/amigaos-cross-toolchain.git
  cd amigaos-cross-toolchain/submodules
  git clone https://github.com/bebbo/gcc --depth 1 -b gcc-6-branch gcc-6
  cd ..
  ./toolchain-m68k build
This reduces the gcc-6 download size to ~124MB.

Bebbo
bebbo is offline  
Old 23 March 2017, 23:07   #123
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,414
Very cool to see you guys working on bringing a newer version of gcc to 68K....well done

I was always stuck with gcc 3.4 back in the day which made it hard to port newer games.

How long before people can download the (pre-built) files need to get gcc 6.2 building using something like AmiDevCpp?

Is gcc 6.2 now producing more efficient 68K assembler than gcc 3.4 overall (not just for isolated methods)?
NovaCoder is offline  
Old 24 March 2017, 03:33   #124
LuigiThirty
Registered User
 
Join Date: Dec 2016
Location: USA
Posts: 101
I'm trying to build this on the Windows 10 Ubuntu shell. I get this when running toolchain-m68k --prefix=/opt/m68k-amigaos build:

Code:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... m68k-unknown-amigaos
checking for i686-linux-gnu-gcc... (cached) /usr/bin/gcc -m32 -std=gnu11
checking for C compiler default output... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make: *** [configure-opcodes] Error 1
ERROR: command "make -j1" failed with 2
LuigiThirty is offline  
Old 24 March 2017, 16:06   #125
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by NovaCoder View Post
Is gcc 6.2 now producing more efficient 68K assembler than gcc 3.4 overall (not just for isolated methods)?
It looks like the GCC 6.2 68k backend had improved noticeably before bebbo started to make changes. His changes need more testing and benchmarking but the results so far are very impressive. With them, GCC 6.2 very likely generates the best code quality for the 68k of any Amiga compiler ever .

Quote:
Originally Posted by NovaCoder View Post
How long before people can download the (pre-built) files need to get gcc 6.2 building using something like AmiDevCpp?
This also raises 2 other important questions.

1) What are the chances of bebbo's changes being accepted into the official GCC 68k backend?

2) Will NovaCoder return to the Amiga with a new improved GCC compiler for the 68k available?
matthey is offline  
Old 24 March 2017, 17:37   #126
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by bebbo View Post
To be more precise:

Code:
  git clone https://github.com/bebbo/amigaos-cross-toolchain.git
  cd amigaos-cross-toolchain/submodules
  git clone https://github.com/bebbo/gcc --depth 1 -b gcc-6-branch gcc-6
  cd ..
  ./toolchain-m68k build
This reduces the gcc-6 download size to ~124MB.

Bebbo
git clone with --depth 1 is now used for all submodules to reduce download size.

Bebbo
bebbo is offline  
Old 24 March 2017, 17:54   #127
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by LuigiThirty View Post
I'm trying to build this on the Windows 10 Ubuntu shell. I get this when running toolchain-m68k --prefix=/opt/m68k-amigaos build:

Code:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... m68k-unknown-amigaos
checking for i686-linux-gnu-gcc... (cached) /usr/bin/gcc -m32 -std=gnu11
checking for C compiler default output... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make: *** [configure-opcodes] Error 1
ERROR: command "make -j1" failed with 2
Is the compiler able to create 32 bit programs?
Maybe you have the compiler but not the libs?

Try this:
Code:
apt-get install gcc-multilib g++-multilib
Bebbo
bebbo is offline  
Old 24 March 2017, 18:51   #128
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,203
Quote:
Originally Posted by bebbo View Post
Is the compiler able to create 32 bit programs?
Maybe you have the compiler but not the libs?

Try this:
Code:
apt-get install gcc-multilib g++-multilib
Bebbo
When I tried a few weeks ago it wasn't possible to *run* 32-bit programs on x64 win10 bash.

@LuigiThirty: Try looking at the mentioned config.log, in my case it was pretty short.
paraj is offline  
Old 24 March 2017, 19:01   #129
LuigiThirty
Registered User
 
Join Date: Dec 2016
Location: USA
Posts: 101
Okay yeah, it only supports amd64 binaries. I'll try it in an actual Ubuntu VM instead.
LuigiThirty is offline  
Old 24 March 2017, 23:33   #130
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by LuigiThirty View Post
Okay yeah, it only supports amd64 binaries. I'll try it in an actual Ubuntu VM instead.
I am using cygwin 32bit on Windows.

Bebbo
bebbo is offline  
Old 25 March 2017, 00:27   #131
LuigiThirty
Registered User
 
Join Date: Dec 2016
Location: USA
Posts: 101
Okay cool, I got it compiling Amiga executables in Cygwin 32-bit, but the standard C library seems to be missing? I'm trying to compile this hello world application using stdio as well as the Amiga libraries.

Code:
#include <stdio.h>

#include <proto/dos.h>
#include <proto/exec.h>

struct DosLibrary *DOSBase = NULL;

int main(){
	if ((DOSBase = (struct DosLibrary *) OpenLibrary("dos.library", 34))) {
		char msg[] = "Hello world, this is GCC 6.3.1!";
		int length = strlen(msg);
		
		Write(Output(), msg, length);
		CloseLibrary((struct Library *)DOSBase);
	}
	
	return 0;
}
Code:
$ make
m68k-amigaos-gcc -g -noixemul -fbaserel -m68000 -msmall-code -Os -Wall -fomit-frame-pointer -o hello-ks13 hello-ks13.c
hello-ks13.c: In function ‘main’:
hello-ks13.c:9:39: warning: pointer targets in initialization differ in signedness [-Wpointer-sign]
  if ((DOSBase = (struct DosLibrary *) OpenLibrary("dos.library", 34))) {
                                       ^~~~~~~~~~~
hello-ks13.c:11:16: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
   int length = strlen(msg);
                ^~~~~~
LuigiThirty is offline  
Old 25 March 2017, 01:08   #132
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,414
Quote:
Originally Posted by matthey View Post
It looks like the GCC 6.2 68k backend had improved noticeably before bebbo started to make changes. His changes need more testing and benchmarking but the results so far are very impressive. With them, GCC 6.2 very likely generates the best code quality for the 68k of any Amiga compiler ever .



This also raises 2 other important questions.

1) What are the chances of bebbo's changes being accepted into the official GCC 68k backend?

2) Will NovaCoder return to the Amiga with a new improved GCC compiler for the 68k available?
Let's see what happens with gcc 68K
NovaCoder is offline  
Old 25 March 2017, 02:22   #133
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
i have some problems running amiga gcc6.2 generated code under aros68k which im trying to research, but while at that i have let the compilers output asm of a simple helloworld for comparison:

Code:
 #include <stdio.h>
 int main(void)
{
    printf("Hallo Welt!");
}
aros-gcc-4.6.4:
Code:
 #NO_APP
 .file "hw.c"
 .section .rodata
.LC0:
 .string "Hallo Welt!"
 .text
 .align 2
 .globl main
 .type main, @function
main:
 link.w %a5,#0
 pea .LC0
 jsr printf
 addq.l #4,%sp
 unlk %a5
 rts
 .size main, .-main
 .ident "GCC: (GNU) 4.6.4"
aros-gcc-6.3.0:
Code:
 #NO_APP
 .file "hw.c"
 .section .rodata
.LC0:
 .string "Hallo Welt!"
 .text
 .align 2
 .globl main
 .type main, @function
main:
 link.w %a5,#0
 pea .LC0
 jsr printf
 addq.l #4,%sp
 moveq #0,%d0
 unlk %a5
 rts
 .size main, .-main
 .ident "GCC: (GNU) 6.3.0"
amiga-gcc-6.2.0:
Code:
 #NO_APP
 .text
.LC0:
 .ascii "Hallo Welt!\0"
 .align 2
 .globl _main
_main:
 link.w fp,#0
 pea .LC0
 jsr _printf
 addq.l #4,sp
 moveq #0,d0
 unlk fp
 rts
no optimization turned on. im not really familiar with it bit looks like 4.6.4 still generates shorter code?
wawa is offline  
Old 25 March 2017, 02:49   #134
LuigiThirty
Registered User
 
Join Date: Dec 2016
Location: USA
Posts: 101
I tried building the examples in the example folder with the makefile there and I got the same error, printf not being defined. Hm. I'll try rebuilding, maybe there was a problem setting up configurations or something.
LuigiThirty is offline  
Old 25 March 2017, 03:18   #135
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
Quote:
Originally Posted by LuigiThirty View Post
I tried building the examples in the example folder with the makefile there and I got the same error, printf not being defined. Hm. I'll try rebuilding, maybe there was a problem setting up configurations or something.
undefined referrence? did you use -noixemul option when invoking the gcc?
wawa is offline  
Old 25 March 2017, 03:22   #136
LuigiThirty
Registered User
 
Join Date: Dec 2016
Location: USA
Posts: 101
Yeah, just using the makefile.

Code:
Luigi@Luigi-PC ~/amigaos-cross-toolchain/examples
$ make
m68k-amigaos-gcc -g -noixemul -m68020 -Os -Wall -fomit-frame-pointer -o hello-stdio hello-stdio.c
/tmp/ccDfnSy0.o(.text+0x16): In function `':
/home/Luigi/amigaos-cross-toolchain/examples/hello-stdio.c:5: undefined reference to `printf'
collect2: error: ld returned 1 exit status
make: *** [Makefile:24: hello-stdio] Error 1
edit: I don't have a m68k-amigaos-g++ either... maybe there was a build problem, I didn't get any errors at the end of it. I whipped up a quick GadTools program and it compiled and ran fine, so the C compiler itself is working.

Last edited by LuigiThirty; 25 March 2017 at 06:44.
LuigiThirty is offline  
Old 25 March 2017, 11:47   #137
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 681
Quote:
Originally Posted by LuigiThirty View Post
Yeah, just using the makefile.

Code:
Luigi@Luigi-PC ~/amigaos-cross-toolchain/examples
$ make
m68k-amigaos-gcc -g -noixemul -m68020 -Os -Wall -fomit-frame-pointer -o hello-stdio hello-stdio.c
/tmp/ccDfnSy0.o(.text+0x16): In function `':
/home/Luigi/amigaos-cross-toolchain/examples/hello-stdio.c:5: undefined reference to `printf'
collect2: error: ld returned 1 exit status
make: *** [Makefile:24: hello-stdio] Error 1
edit: I don't have a m68k-amigaos-g++ either... maybe there was a build problem, I didn't get any errors at the end of it. I whipped up a quick GadTools program and it compiled and ran fine, so the C compiler itself is working.
Try again. C++ was disabled till today.

I also fixed the handling of inline functions in libnix which caused linking issues.

Bebbo
bebbo is offline  
Old 25 March 2017, 14:16   #138
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
thx, have just build it again, this time in the user space to be able to simply add headers and libs. no problem found.
wawa is offline  
Old 25 March 2017, 17:17   #139
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,200
Is the compiler using an up-to-date version of libStdC++?
Samurai_Crow is online now  
Old 25 March 2017, 17:51   #140
LuigiThirty
Registered User
 
Join Date: Dec 2016
Location: USA
Posts: 101
Yep, I can use stdlib functions again. Thanks! Pulling the latest git and rebuilding GCC didn't give me a m68k-amigaos-g++ though.
LuigiThirty 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
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

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 20:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12375 seconds with 14 queries