English Amiga Board


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

 
 
Thread Tools
Old 21 March 2017, 18:55   #101
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by alkis View Post
A tad better than gcc-3.4.0
GCC 3.4.0 and 2.95.3 (depends on source code which is better) probably had the best 68k compiler backends ever.
matthey is offline  
Old 21 March 2017, 19:13   #102
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by alkis View Post
A tad better than gcc-3.4.0
Code:
#NO_APP
        .text
        .even
        .globl  _strcpy
_strcpy:
        movel a0,d1
        .even
L2:
        moveb a1@+,d0
        moveb d0,a0@+
        jne L2
        movel d1,d0
        rts
Well, this is the code from my experimental version:

Code:
_strcpy:
        move.l a0,d0
.L2:
        move.b (a1)+,(a0)+
        jne .L2
        rts
Bebbo
bebbo is offline  
Old 21 March 2017, 19:24   #103
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
Quote:
Originally Posted by bebbo View Post
Well, this is the code from my experimental version:

Code:
_strcpy:
        move.l a0,d0
.L2:
        move.b (a1)+,(a0)+
        jne .L2
        rts
Bebbo
Wow....Again, great work!
alkis is offline  
Old 22 March 2017, 16:11   #104
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Pushed the new combine optimization:

These are the old tscp benchmark results.
Code:
tscpsc:   18920ms
tscpgcc:  14120ms 
tscpvbcc: 14120ms
tscpgcc6: 12280ms
Now with
Code:
 m68k-amigaos-gcc -m68020 -O3 -fomit-frame-pointer -noixemul -o tscpgcc6 *.c -Xlinker --allow-multiple-definition
tscpgcc6: 12180ms

And with
Code:
 m68k-amigaos-gcc -m68020 -Ofast -fomit-frame-pointer -noixemul -o tscpgcc6 *.c -Xlinker --allow-multiple-definition
tscpgcc6: 12120ms

Have fun.

Bebbo
bebbo is offline  
Old 22 March 2017, 18:28   #105
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
I am trying to build on (vm) mint-18.1 64-bit, host compiler
Code:
gcc --version
gcc (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I get consistent errors (have tried 'clean' and 'build' several times) on m68k-amigaos-ar

for example
Code:
m68k-amigaos-ar -q libstubs.a libbases/amigaguide.o libbases/asl.o libbases/bullet.o libbases/commodities.o libbases/datatypes.o libbases/diskfont.o libbases/dos.o libbases/expansion.o libbases/gadtools.o libbases/graphics.o libbases/icon.o libbases/iffparse.o libbases/intuition.o libbases/keymap.o libbases/layers.o libbases/locale.o libbases/lowlevel.o libbases/mathffp.o libbases/mathieeedoubbas.o libbases/mathieeedoubtrans.o libbases/mathieeesingbas.o libbases/mathieeesingtrans.o libbases/mathtrans.o libbases/nonvolatile.o libbases/realtime.o libbases/rexxsyslib.o libbases/translator.o libbases/utility.o libbases/workbench.o misc/__DOSBase.o misc/__MathIeeeDoubBasBase.o misc/__MathIeeeDoubTransBase.o misc/__MathIeeeSingBasBase.o misc/__MathIeeeSingTransBase.o misc/__UtilityBase.o misc/__cpucheck.o misc/__flush_cache.o misc/__initcpp.o misc/__initlibraries.o libnames/amigaguide.o libnames/asl.o libnames/bullet.o libnames/commodities.o libnames/datatypes.o libnames/diskfont.o libnames/dos.o libnames/expansion.o libnames/gadtools.o libnames/graphics.o libnames/icon.o libnames/iffparse.o libnames/intuition.o libnames/keymap.o libnames/layers.o libnames/locale.o libnames/lowlevel.o libnames/mathffp.o libnames/mathieeedoubbas.o libnames/mathieeedoubtrans.o libnames/mathieeesingbas.o libnames/mathieeesingtrans.o libnames/mathtrans.o libnames/nonvolatile.o libnames/realtime.o libnames/rexxsyslib.o libnames/translator.o libnames/utility.o libnames/workbench.o stubs/__ctor_list__.o stubs/__dtor_list__.o stubs/__exit_list__.o stubs/__init_list__.o stubs/__lib_list__.o stubs/__oslibversion.o stubs/__priority.o stubs/__procname.o stubs/__stack.o  ../nix/misc/__request.o
*** buffer overflow detected ***: m68k-amigaos-ar terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x67377)[0xf75d4377]
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x68)[0xf7664548]
/lib/i386-linux-gnu/libc.so.6(+0xf5738)[0xf7662738]
/lib/i386-linux-gnu/libc.so.6(+0xf4d2f)[0xf7661d2f]
m68k-amigaos-ar[0x804ef46]
m68k-amigaos-ar[0x80519c5]
m68k-amigaos-ar[0x804b79e]
m68k-amigaos-ar[0x8049e01]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0xf7585637]
m68k-amigaos-ar[0x8049e27]
======= Memory map: ========
08048000-08077000 r-xp 00000000 08:21 410616                             /home/alex/amiga/gcc6/bin/m68k-amigaos-ar
08077000-08078000 r--p 0002e000 08:21 410616                             /home/alex/amiga/gcc6/bin/m68k-amigaos-ar
08078000-08079000 rw-p 0002f000 08:21 410616                             /home/alex/amiga/gcc6/bin/m68k-amigaos-ar
08079000-0807b000 rw-p 00000000 00:00 0 
089ea000-08ab0000 rw-p 00000000 00:00 0                                  [heap]
f756d000-f771c000 r-xp 00000000 08:01 393928                             /lib/i386-linux-gnu/libc-2.23.so
f771c000-f771d000 ---p 001af000 08:01 393928                             /lib/i386-linux-gnu/libc-2.23.so
f771d000-f771f000 r--p 001af000 08:01 393928                             /lib/i386-linux-gnu/libc-2.23.so
f771f000-f7720000 rw-p 001b1000 08:01 393928                             /lib/i386-linux-gnu/libc-2.23.so
f7720000-f7723000 rw-p 00000000 00:00 0 
f7731000-f774d000 r-xp 00000000 08:01 393396                             /lib/i386-linux-gnu/libgcc_s.so.1
f774d000-f774e000 r--p 0001b000 08:01 393396                             /lib/i386-linux-gnu/libgcc_s.so.1
f774e000-f774f000 rw-p 0001c000 08:01 393396                             /lib/i386-linux-gnu/libgcc_s.so.1
f774f000-f7752000 rw-p 00000000 00:00 0 
f7752000-f7754000 r--p 00000000 00:00 0                                  [vvar]
f7754000-f7755000 r-xp 00000000 00:00 0                                  [vdso]
f7755000-f7777000 r-xp 00000000 08:01 393929                             /lib/i386-linux-gnu/ld-2.23.so
f7777000-f7778000 rw-p 00000000 00:00 0 
f7778000-f7779000 r--p 00022000 08:01 393929                             /lib/i386-linux-gnu/ld-2.23.so
f7779000-f777a000 rw-p 00023000 08:01 393929                             /lib/i386-linux-gnu/ld-2.23.so
ffe99000-ffeba000 rw-p 00000000 00:00 0                                  [stack]
../../sources/stubs/Makefile:47: recipe for target 'libstubs.a' failed
make[2]: *** [libstubs.a] Aborted
make[2]: *** Deleting file 'libstubs.a'
make[2]: Leaving directory '/home/alex/amiga/amigaos-cross-toolchain/.build-m68k/build/libnix/lib/stubs'
/home/alex/amiga/amigaos-cross-toolchain/.build-m68k/build/libnix/sources/Makefile:33: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/alex/amiga/amigaos-cross-toolchain/.build-m68k/build/libnix/lib'
Makefile:44: recipe for target 'all' failed
make: *** [all] Error 2
ERROR: command "make LD=m68k-amigaos-ld CC=m68k-amigaos-gcc RANLIB=m68k-amigaos-ranlib AS=m68k-amigaos-as AR=m68k-amigaos-ar CPP=m68k-amigaos-gcc -E -j1" failed with 2
the funny thing is if I enter the last directory and from the shell issue the command that bombs-out
Code:
m68k-amigaos-ar -q libstubs.a libbases/amigaguide.o libbases/asl.o lib
bases/bullet.o libbases/commodities.o libbases/datatypes.o libbases/diskfont.o libbases/dos.o libbases/expansion.o libbases/gadtools.o libbases/graphics.o libbases/icon.o libbases/iffparse.o libbases/intuition.o libbases/keymap.o libbases/layers.o libbases/locale.o libbases/lowlevel.o libbases/mathffp.o libbases/mathieeedoubbas.o libbases/mathieeedoubtrans.o libbases/mathieeesingbas.o libbases/mathieeesingtrans.o libbases/mathtrans.o libbases/nonvolatile.o libbases/realtime.o libbases/rexxsyslib.o libbases/translator.o libbases/utility.o libbases/workbench.o misc/__DOSBase.o misc/__MathIeeeDoubBasBase.o misc/__MathIeeeDoubTransBase.o misc/__MathIeeeSingBasBase.o misc/__MathIeeeSingTransBase.o misc/__UtilityBase.o misc/__cpucheck.o misc/__flush_cache.o misc/__initcpp.o misc/__initlibraries.o libnames/amigaguide.o libnames/asl.o libnames/bullet.o libnames/commodities.o libnames/datatypes.o libnames/diskfont.o libnames/dos.o libnames/expansion.o libnames/gadtools.o libnames/graphics.o libnames/icon.o libnames/iffparse.o libnames/intuition.o libnames/keymap.o libnames/layers.o libnames/locale.o libnames/lowlevel.o libnames/mathffp.o libnames/mathieeedoubbas.o libnames/mathieeedoubtrans.o libnames/mathieeesingbas.o libnames/mathieeesingtrans.o libnames/mathtrans.o libnames/nonvolatile.o libnames/realtime.o libnames/rexxsyslib.o libnames/translator.o libnames/utility.o libnames/workbench.o stubs/__ctor_list__.o stubs/__dtor_list__.o stubs/__exit_list__.o stubs/__init_list__.o stubs/__lib_list__.o stubs/__oslibversion.o stubs/__priority.o stubs/__procname.o stubs/__stack.o  ../nix/misc/__request.o
it builds libstubs.a without any errors.

Puzzling, huh? Maybe the 64bit host is to blame? Is this developed on 32 or 64 bits?
alkis is offline  
Old 22 March 2017, 18:43   #106
sbergmann
Registered User
 
sbergmann's Avatar
 
Join Date: Mar 2015
Location: Germany
Age: 46
Posts: 23
Quote:
Originally Posted by alkis View Post
I get consistent errors (have tried 'clean' and 'build' several times) on m68k-amigaos-ar
Looks like you are affected by the issue I described in https://github.com/bebbo/amigaos-cro...hain/issues/12

If you are not afraid of Docker and software containers then you may want to have a look at https://amiga.sebastian-bergmann.de/...ross-compiler/ and https://github.com/sebastianbergmann...ross-toolchain. The current state of that Docker image works, at least for me.
sbergmann is offline  
Old 22 March 2017, 19:43   #107
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,309
Quote:
Originally Posted by alkis View Post
Maybe the 64bit host is to blame? Is this developed on 32 or 64 bits?
64bit host is fine but you need to use a 32 bit GCC & associated libraries. I made a comment on this early in the thread along with some example apt-gets.

Mint is based on Debian right? I'm building on a Debian system.
nogginthenog is offline  
Old 22 March 2017, 21:52   #108
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Just pushed the fix.

I had to fix another location in the archiver, to support long file names correctly. (A strcpy without length limit -> strncpy).

Bebbo
bebbo is offline  
Old 22 March 2017, 22:21   #109
alpine9000
Registered User
 
Join Date: Mar 2016
Location: Australia
Posts: 881
Quote:
Originally Posted by bebbo View Post
Pushed the new combine optimization:

These are the old tscp benchmark results.
Code:
tscpsc:   18920ms
tscpgcc:  14120ms 
tscpvbcc: 14120ms
tscpgcc6: 12280ms
Now with
Code:
 m68k-amigaos-gcc -m68020 -O3 -fomit-frame-pointer -noixemul -o tscpgcc6 *.c -Xlinker --allow-multiple-definition
tscpgcc6: 12180ms

And with
Code:
 m68k-amigaos-gcc -m68020 -Ofast -fomit-frame-pointer -noixemul -o tscpgcc6 *.c -Xlinker --allow-multiple-definition
tscpgcc6: 12120ms

Have fun.

Bebbo
Nice work!

I haven't merged all of your recent changes into my gcc fork yet (having problems with the regrename stuff), but in the game I am working on I get a measurable speed bump with -Ofast with these changes.

I hadn't tried -Ofast recently and it is quite a bit faster for my game than -O3.

Keep up the great work!!
alpine9000 is offline  
Old 22 March 2017, 23:34   #110
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
Quote:
Originally Posted by bebbo View Post
Just pushed the fix.

I had to fix another location in the archiver, to support long file names correctly. (A strcpy without length limit -> strncpy).

Bebbo
Fix works!

I had to change line 547 in toolchain-m68k to fully complete the build
Code:
  #unpack('vdam68k', top_dir='vda/M68k', work_dir='{build}')
  unpack('vdam68k', top_dir='.', work_dir='{build}') #alkis
after that, a simple hello world program gave me an executable that works in a1200

Code:
gcc6/bin/m68k-amigaos-gcc-6.3.1b -noixemul -m68020 -o hello hello.c -Xlinker --allow-multiple-definition
cc1: warning: /home/alex/amiga/gcc6/m68k-amigaos/libnix/include: not a directory
alkis is offline  
Old 23 March 2017, 10:23   #111
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by alkis View Post
Fix works!

I had to change line 547 in toolchain-m68k to fully complete the build
Code:
  #unpack('vdam68k', top_dir='vda/M68k', work_dir='{build}')
  unpack('vdam68k', top_dir='.', work_dir='{build}') #alkis
after that, a simple hello world program gave me an executable that works in a1200
Thanks for the info. Fixed this plus a tad more. Chain is building again after merge from upstream.

Bebbo
bebbo is offline  
Old 23 March 2017, 13:56   #112
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
is there a way to fetch the gcc-6 source in one piece?
it takes almost forever fetching 2m files of the gcc-6 source code.
from gnu ftp, it's only 90-120mb, extracting localy afterwards.

Code:
Cloning into '/cygdrive/d/amigaos-cross-toolchain/submodules/gcc-6'...
remote: Counting objects: 2120661, done.
remote: Compressing objects: 100% (20/20), done.
Receiving objects:  79% (1677272/2120661), 1.36 GiB | 432.00 KiB/s
thats far more than the extracted gcc-6.2 src code. what does it fetch here?

Last edited by emufan; 23 March 2017 at 14:16.
emufan is offline  
Old 23 March 2017, 14:29   #113
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
i wondered same thing, my 6.3 source archive fetched to build aros is 100mb.
wawa is offline  
Old 23 March 2017, 14:36   #114
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by wawa View Post
i wondered same thing, my 6.3 source archive fetched to build aros is 100mb.
after 90+ minutes:
Code:
Cloning into '/cygdrive/d/amigaos-cross-toolchain/submodules/gcc-6'...
remote: Counting objects: 2120661, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 2120661 (delta 17), reused 10 (delta 10), pack-reused 2120631
Receiving objects: 100% (2120661/2120661), 2.10 GiB | 430.00 KiB/s, done.
Resolving deltas:   2% (35153/1733931) 0 KiB/s
extracted 6.2 src from gnu ftp is about 500MB /120000 files - took 2 mins only.

#1) great - now 1.7m deltas - wtf.

#2) seems to be one big tmp file only, which gets processed in:
/amigaos-cross-toolchain/.git/modules/submodules/gcc-6/objects/pack:
2.1GB --> tmp_pack_bnWulb: Git pack, version 2, 2120661 objects

will there be a solutiuon?

Last edited by emufan; 23 March 2017 at 15:06.
emufan is offline  
Old 23 March 2017, 15:13   #115
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by emufan View Post
after 90+ minutes:
Code:
Cloning into '/cygdrive/d/amigaos-cross-toolchain/submodules/gcc-6'...
remote: Counting objects: 2120661, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 2120661 (delta 17), reused 10 (delta 10), pack-reused 2120631
Receiving objects: 100% (2120661/2120661), 2.10 GiB | 430.00 KiB/s, done.
Resolving deltas:   2% (35153/1733931) 0 KiB/s
extracted 6.2 src from gnu ftp is about 500MB /120000 files - took 2 mins only.

#1) great - now 1.7m deltas - wtf.

#2) seems to be one big tmp file only, which gets processed in:
/amigaos-cross-toolchain/.git/modules/submodules/gcc-6/objects/pack:
2.1GB --> tmp_pack_bnWulb: Git pack, version 2, 2120661 objects

will there be a solutiuon?
git is downloading ALL branches with FULL history.

The huge size is the drawback of git. Maybe I can provide a download link with packaged current sources.

For now you can download ZIP file from github for each submodule and unzip it at the right location. Notice that you'll need my gcc-6-branch of gcc.

Once everything in place, use 'xbuild' instead of 'build'

Bebbo
bebbo is offline  
Old 23 March 2017, 15:15   #116
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
after 120 minutes i have now gcc-6 with 96000 files and arround 500MB .
skip this, this is not only a pain - this is a pita.
grab the tar.gz and let it extract localy. everthing else is a waste of time.

#1) wget or whatever to the gcc6.2 from the gnu ftp, extract it and next package will be processed.
takes 2 minutes for the enduser. compared to 2 hours of wasted time .
emufan is offline  
Old 23 March 2017, 15:22   #117
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by emufan View Post
after 120 minutes i have now gcc-6 with 96000 files and arround 500MB .
skip this, this is not only a pain - this is a pita.
grab the tar.gz and let it extract localy. everthing else is a waste of time.

#1) wget or whatever to the gcc6.2 from the gnu ftp, extract it and next package will be processed.
takes 2 minutes for the enduser. compared to 2 hours of wasted time .
1. The gcc archive from the gnu ftp server is not the same and won't work.
2. There is no need to sit in front of hte computer monitoring a download. Do something else, then it's no wasted time.

Bebbo
bebbo is offline  
Old 23 March 2017, 15:25   #118
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
it's alos not worth to take the endeavour to get 10% more speed from build executables.
all erased. done here.
emufan is offline  
Old 23 March 2017, 15:49   #119
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by emufan View Post
it's alos not worth to take the endeavour to get 10% more speed from build executables.
all erased. done here.
Why so impatient?

Quote:
Maybe I can provide a download link with packaged current sources.
Takes its time to provide this.

Bebbo
bebbo is offline  
Old 23 March 2017, 16:33   #120
sbergmann
Registered User
 
sbergmann's Avatar
 
Join Date: Mar 2015
Location: Germany
Age: 46
Posts: 23
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
sbergmann 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 15:41.

Top

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