English Amiga Board


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

 
 
Thread Tools
Old 12 January 2018, 17:30   #581
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 30
Posts: 492
The repo is no longer archived and last commit is 18 hours ago.
Marlon_ is offline  
Old 12 January 2018, 21:16   #582
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,104
I finally tried to compile pfs3aio. It compiles but:

- How to disable startup code correctly? -nostartfiles seems to do something but is it correct way because it causes odd linker errors without manually defined SysBase (Why is libamiga included?)

Code:
m68k-amigaos-gcc -O2 -m68000 -noixemul -fbaserel -fomit-frame-pointer -nostartfiles -fno-exceptions -s -DMIN_LIB_VERSION=33 -DKSWRAPPER=1 -DSCSIDIRECT=1 -DNSD=1 -DTD64=1 -DTRACKDISK=1 -DLARGE_FILE_SIZE=0 -DEXTRAPACKETS=1 -DSIZEFIELD -DDELDIR=1 -DMAX_BUFFERS=600 -DMIN_BUFFERS=20 -DMULTIUSER=0 -DPROTECTION=0 -DVERSION23=1 -DROLLOVER=1 -I. -c -o assroutines.o assroutines.c
m68k-amigaos-gcc -o pfs3aio assroutines.o messages.o boot.o directory.o dostohandlerinterface.o disk.o init.o diskchange.o resethandler.o volume.o allocation.o lock.o anodes.o format.o lru.o update.o CheckAccess.o kswrapper.o -O2 -m68000 -noixemul -fbaserel -fomit-frame-pointer -nostartfiles -fno-exceptions -s -DMIN_LIB_VERSION=33 -DKSWRAPPER=1 -DSCSIDIRECT=1 -DNSD=1 -DTD64=1 -DTRACKDISK=1 -DLARGE_FILE_SIZE=0 -DEXTRAPACKETS=1 -DSIZEFIELD -DDELDIR=1 -DMAX_BUFFERS=600 -DMIN_BUFFERS=20 -DMULTIUSER=0 -DPROTECTION=0 -DVERSION23=1 -DROLLOVER=1 -lgcc -s
/cygdrive/c/utils/m68k-amigaos/m68k-amigaos/libnix/lib/libb/libamiga.a(putmsg.o)(.text+0x4):putmsg.o: undefined reference to `SysBase'
/cygdrive/c/utils/m68k-amigaos/m68k-amigaos/libnix/lib/libb/libamiga.a(wait.o)(.text+0x4):wait.o: undefined reference to `SysBase'
/cygdrive/c/utils/m68k-amigaos/m68k-amigaos/libnix/lib/libb/libamiga.a(openlibrary.o)(.text+0x4):openlibrary.o: undefined reference to `SysBase'
/cygdrive/c/utils/m68k-amigaos/m68k-amigaos/libnix/lib/libb/libamiga.a(findtask.o)(.text+0x4):findtask.o: undefined reference to `SysBase'
/cygdrive/c/utils/m68k-amigaos/m68k-amigaos/libnix/lib/libb/libamiga.a(waitport.o)(.text+0x4):waitport.o: undefined reference to `SysBase'
/cygdrive/c/utils/m68k-amigaos/m68k-amigaos/libnix/lib/libb/libamiga.a(forbid.o)(.text+0x4):forbid.o: more undefined references to `SysBase' follow
collect2: error: ld returned 1 exit status
make: *** [makefile:16: all] Error 1
- File size is larger than AROS version (85k with symbols stripped vs 75k. SAS-C creates about 60k file). So obviously something not needed was included.

- It still creates huge amount of RELOC32's (about 1650 relocations! AROS GCC does the same) vs SAS-C (179).

- -Os results in internal compiler error:

Code:
m68k-amigaos-gcc -Os -m68000 -noixemul -fbaserel -fomit-frame-pointer -nostartfiles -fno-exceptions -DMIN_LIB_VERSION=33 -DKSWRAPPER=1 -DSCSIDIRECT=1 -DNSD=1 -DTD64=1 -DTRACKDISK=1 -DLARGE_FILE_SIZE=0 -DEXTRAPACKETS=1 -DSIZEFIELD -DDELDIR=1 -DMAX_BUFFERS=600 -DMIN_BUFFERS=20 -DMULTIUSER=0 -DPROTECTION=0 -DVERSION23=1 -DROLLOVER=1 -I. -c -o directory.o directory.c
directory.c: In function 'FillDelfileFib':
directory.c:3986:1: internal compiler error: Segmentation fault
 }
Toni Wilen is online now  
Old 12 January 2018, 22:09   #583
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 30
Posts: 492
Thanks for reporting this! Without reports, I'd think it would be very hard to know this. The more people that is motivated in this, the better the outcome!
Marlon_ is offline  
Old 13 January 2018, 09:23   #584
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 449
Quote:
Originally Posted by Toni Wilen View Post
- How to disable startup code correctly? -nostartfiles seems to do something but is it correct way because it causes odd linker errors without manually defined SysBase (Why is libamiga included?)
Try "-nostdlib -nostartfiles"
alkis is offline  
Old 13 January 2018, 11:48   #585
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,104
Quote:
Originally Posted by alkis View Post
Try "-nostdlib -nostartfiles"
Code:
m68k-amigaos-gcc -o pfs3aio assroutines.o messages.o boot.o directory.o dostohandlerinterface.o disk.o init.o diskchange.o resethandler.o volume.o allocation.o lock.o anodes.o format.o lru.o update.o CheckAccess.o kswrapper.o -O2 -m68000 -noixemul -fbaserel -fomit-frame-pointer -nostartfiles -nostdlib -fno-exceptions -s -DMIN_LIB_VERSION=33 -DKSWRAPPER=1 -DSCSIDIRECT=1 -DNSD=1 -DTD64=1 -DTRACKDISK=1 -DLARGE_FILE_SIZE=0 -DEXTRAPACKETS=1 -DSIZEFIELD -DDELDIR=1 -DMAX_BUFFERS=600 -DMIN_BUFFERS=20 -DMULTIUSER=0 -DPROTECTION=0 -DVERSION23=1 -DROLLOVER=1 -lgcc -s
assroutines.o(.text+0x18): undefined reference to `__udivsi3'
assroutines.o(.text+0x90): undefined reference to `__udivsi3'
assroutines.o(.text+0x88): undefined reference to `__umodsi3'
assroutines.o(.text+0x2e): undefined reference to `__umodsi3'
boot.o(.text+0x24): undefined reference to `PutMsg'
boot.o(.text+0x338): undefined reference to `PutMsg'
boot.o(.text+0x620): undefined reference to `PutMsg'
boot.o(.text+0x80): undefined reference to `Wait'
boot.o(.text+0x9e): undefined reference to `OpenLibrary'
boot.o(.text+0x102): undefined reference to `FindTask'
boot.o(.text+0x124): undefined reference to `WaitPort'
boot.o(.text+0x668): undefined reference to `WaitPort'
boot.o(.text+0x374): undefined reference to `Forbid'
boot.o(.text+0x38a): undefined reference to `CheckIO'
boot.o(.text+0x3a2): undefined reference to `WaitIO'
boot.o(.text+0x8ba): undefined reference to `WaitIO'
boot.o(.text+0x454): undefined reference to `FreeMem'
boot.o(.text+0x46c): undefined reference to `FreeMem'
boot.o(.text+0x476): undefined reference to `Permit'
boot.o(.text+0x49a): undefined reference to `CloseLibrary'
..
But more important problem is huge amount of absolute addresses that need relocations, it makes code slower and larger.
Toni Wilen is online now  
Old 13 January 2018, 12:12   #586
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 449
Quote:
Originally Posted by Toni Wilen View Post
Code:
m68k-amigaos-gcc -o pfs3aio assroutines.o messages.o boot.o directory.o dostohandlerinterface.o disk.o init.o diskchange.o resethandler.o volume.o allocation.o lock.o anodes.o format.o lru.o update.o CheckAccess.o kswrapper.o -O2 -m68000 -noixemul -fbaserel -fomit-frame-pointer -nostartfiles -nostdlib -fno-exceptions -s -DMIN_LIB_VERSION=33 -DKSWRAPPER=1 -DSCSIDIRECT=1 -DNSD=1 -DTD64=1 -DTRACKDISK=1 -DLARGE_FILE_SIZE=0 -DEXTRAPACKETS=1 -DSIZEFIELD -DDELDIR=1 -DMAX_BUFFERS=600 -DMIN_BUFFERS=20 -DMULTIUSER=0 -DPROTECTION=0 -DVERSION23=1 -DROLLOVER=1 -lgcc -s
assroutines.o(.text+0x18): undefined reference to `__udivsi3'
assroutines.o(.text+0x90): undefined reference to `__udivsi3'
assroutines.o(.text+0x88): undefined reference to `__umodsi3'
assroutines.o(.text+0x2e): undefined reference to `__umodsi3'
boot.o(.text+0x24): undefined reference to `PutMsg'
boot.o(.text+0x338): undefined reference to `PutMsg'
boot.o(.text+0x620): undefined reference to `PutMsg'
boot.o(.text+0x80): undefined reference to `Wait'
boot.o(.text+0x9e): undefined reference to `OpenLibrary'
boot.o(.text+0x102): undefined reference to `FindTask'
boot.o(.text+0x124): undefined reference to `WaitPort'
boot.o(.text+0x668): undefined reference to `WaitPort'
boot.o(.text+0x374): undefined reference to `Forbid'
boot.o(.text+0x38a): undefined reference to `CheckIO'
boot.o(.text+0x3a2): undefined reference to `WaitIO'
boot.o(.text+0x8ba): undefined reference to `WaitIO'
boot.o(.text+0x454): undefined reference to `FreeMem'
boot.o(.text+0x46c): undefined reference to `FreeMem'
boot.o(.text+0x476): undefined reference to `Permit'
boot.o(.text+0x49a): undefined reference to `CloseLibrary'
..
But more important problem is huge amount of absolute addresses that need relocations, it makes code slower and larger.
Hmmm, the first __ ones are for multiply/division cause 68000 can't do it natively (32 bits).

The rest...you are including <proto/exec.h> right?
alkis is offline  
Old 13 January 2018, 12:21   #587
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,104
Quote:
Originally Posted by alkis View Post
Hmmm, the first __ ones are for multiply/division cause 68000 can't do it natively (32 bits).
Yeah and they obviously need to be linked.

Quote:
The rest...you are including <proto/exec.h> right?
Yes.

Sources are here: http://www.winuae.net/files/b/PFS-experimental.zip if anyone wants to try.. (Note: If it compiles, don't try to use it, it won't work yet!) AOS39 includes needed.
Toni Wilen is online now  
Old 13 January 2018, 12:43   #588
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 449
versionhistory.doc is missing from archive. After I defined some missing defines (from versionhistory) in makefile, comment out "void *SysBase" in assroutines.c then I got to those linking errors

Code:
assroutines.o(.text+0x18): undefined reference to `__udivsi3'
assroutines.o(.text+0x90): undefined reference to `__udivsi3'
assroutines.o(.text+0x88): undefined reference to `__umodsi3'
assroutines.o(.text+0x2e): undefined reference to `__umodsi3'
directory.o(.text+0x18c): undefined reference to `__memset64'
directory.o(.text+0x1fe): undefined reference to `__memset64'
directory.o(.text+0x2d4): undefined reference to `__memset64'
directory.o(.text+0xe1e): undefined reference to `__memset64'
directory.o(.text+0xe52): undefined reference to `__memset64'
directory.o(.text+0x11f2): more undefined references to `__memset64' follow
directory.o(.text+0x4ea): undefined reference to `strncpy'
directory.o(.text+0x290e): undefined reference to `strncpy'
directory.o(.text+0x2cec): undefined reference to `strncpy'
directory.o(.text+0x2f4c): undefined reference to `strncpy'
directory.o(.text+0x3102): undefined reference to `strncpy'
directory.o(.text+0x32c8): more undefined references to `strncpy' follow
directory.o(.text+0x710): undefined reference to `__mulsi3'
directory.o(.text+0x9bc): undefined reference to `__umodsi3'
directory.o(.text+0x2c98): undefined reference to `__umodsi3'
directory.o(.text+0x91a): undefined reference to `__umodsi3'
directory.o(.text+0x4840): undefined reference to `__umodsi3'
directory.o(.text+0x48b6): undefined reference to `__umodsi3'
directory.o(.text+0x6fc): more undefined references to `__umodsi3' follow
directory.o(.text+0x2882): undefined reference to `__divsi3'
directory.o(.text+0xa48): undefined reference to `__divsi3'
directory.o(.text+0x289c): undefined reference to `__modsi3'
directory.o(.text+0xa60): undefined reference to `__modsi3'
directory.o(.text+0x9ae): undefined reference to `__udivsi3'
directory.o(.text+0x2cb0): undefined reference to `__udivsi3'
directory.o(.text+0x4820): undefined reference to `__udivsi3'
directory.o(.text+0x48ce): undefined reference to `__udivsi3'
directory.o(.text+0x6f2): undefined reference to `__udivsi3'
directory.o(.text+0x8f6): more undefined references to `__udivsi3' follow
directory.o(.text+0x11a2): undefined reference to `bcopy'
directory.o(.text+0x14bc): undefined reference to `bcopy'
directory.o(.text+0x154c): undefined reference to `bcopy'
directory.o(.text+0x894): undefined reference to `strrchr'
directory.o(.text+0x2a20): undefined reference to `strcspn'
directory.o(.text+0xfe4): undefined reference to `stricmp'
directory.o(.text+0xb5c): undefined reference to `strcat'
dostohandlerinterface.o(.text+0xb26): undefined reference to `strchr'
dostohandlerinterface.o(.text+0xc08): undefined reference to `strchr'
dostohandlerinterface.o(.text+0x1caa): undefined reference to `strchr'
dostohandlerinterface.o(.text+0x6ee): undefined reference to `strchr'
dostohandlerinterface.o(.text+0x1f1c): undefined reference to `strchr'
dostohandlerinterface.o(.text+0x7c6): more undefined references to `strchr' follow
disk.o(.text+0x2248): undefined reference to `__memset64'
disk.o(.text+0x15a): undefined reference to `__memset64'
init.o(.text+0x1e6): undefined reference to `NewList'
init.o(.text+0x892): undefined reference to `NewList'
init.o(.text+0x90c): undefined reference to `NewList'
init.o(.text+0x250): undefined reference to `strcmp'
init.o(.text+0x2f8): undefined reference to `strcat'
volume.o(.text+0x19c): undefined reference to `__memset64'
volume.o(.text+0x602): undefined reference to `__memset64'
volume.o(.text+0x962): undefined reference to `__memset64'
volume.o(.text+0x422): undefined reference to `strncpy'
volume.o(.text+0x4d2): undefined reference to `NewList'
volume.o(.text+0xa40): undefined reference to `__mulsi3'
volume.o(.text+0xad4): undefined reference to `__mulsi3'
volume.o(.text+0xb7e): undefined reference to `__mulsi3'
allocation.o(.text+0xbc): undefined reference to `__udivsi3'
allocation.o(.text+0x4ca): undefined reference to `__udivsi3'
allocation.o(.text+0x630): undefined reference to `__udivsi3'
allocation.o(.text+0xaea): undefined reference to `__udivsi3'
allocation.o(.text+0x384): undefined reference to `__udivsi3'
allocation.o(.text+0xece): more undefined references to `__udivsi3' follow
allocation.o(.text+0x846): undefined reference to `__memset64'
allocation.o(.text+0xa32): undefined reference to `__memset64'
allocation.o(.text+0xe2): undefined reference to `__memset64'
allocation.o(.text+0x7ac): undefined reference to `__memset64'
allocation.o(.text+0x964): undefined reference to `__memset64'
allocation.o(.text+0x12a8): more undefined references to `__memset64' follow
allocation.o(.text+0xaf0): undefined reference to `__umodsi3'
allocation.o(.text+0xee0): undefined reference to `__umodsi3'
allocation.o(.text+0x1032): undefined reference to `__umodsi3'
allocation.o(.text+0x1158): undefined reference to `__umodsi3'
allocation.o(.text+0xe46): undefined reference to `__mulsi3'
allocation.o(.text+0xfa0): undefined reference to `__mulsi3'
allocation.o(.text+0xb4e): undefined reference to `__mulsi3'
allocation.o(.text+0x556): undefined reference to `__mulsi3'
anodes.o(.text+0x536): undefined reference to `__memset64'
anodes.o(.text+0x758): undefined reference to `__memset64'
anodes.o(.text+0x78c): undefined reference to `__memset64'
anodes.o(.text+0x4a0): undefined reference to `__memset64'
anodes.o(.text+0x962): undefined reference to `__memset64'
anodes.o(.text+0x996): more undefined references to `__memset64' follow
anodes.o(.text+0xaea): undefined reference to `__mulsi3'
anodes.o(.text+0xd0c): undefined reference to `__mulsi3'
anodes.o(.text+0x10b6): undefined reference to `__mulsi3'
anodes.o(.text+0x1108): undefined reference to `__mulsi3'
anodes.o(.text+0x11ba): undefined reference to `__mulsi3'
anodes.o(.text+0xcfe): undefined reference to `__udivsi3'
anodes.o(.text+0x108a): undefined reference to `__udivsi3'
anodes.o(.text+0x1282): undefined reference to `__udivsi3'
format.o(.text+0x9a): undefined reference to `__memset64'
format.o(.text+0x682): undefined reference to `__memset64'
format.o(.text+0x696): undefined reference to `__memset64'
format.o(.text+0x6aa): undefined reference to `__memset64'
format.o(.text+0x2e4): undefined reference to `__udivsi3'
format.o(.text+0x322): undefined reference to `__mulsi3'
format.o(.text+0x330): undefined reference to `__mulsi3'
lru.o(.text+0x4a): undefined reference to `NewList'
lru.o(.text+0xaa): undefined reference to `__mulsi3'
lru.o(.text+0x292): undefined reference to `__memset64'
update.o(.text+0x64a): undefined reference to `__memset64'
update.o(.text+0x950): undefined reference to `__memset64'
update.o(.text+0xb6e): undefined reference to `__memset64'
update.o(.text+0xc32): undefined reference to `__memset64'
update.o(.text+0x988): undefined reference to `__udivsi3'
update.o(.text+0x1bc): undefined reference to `__udivsi3'
update.o(.text+0x1ac): undefined reference to `__umodsi3'
update.o(.text+0x998): undefined reference to `__umodsi3'
kswrapper.o(.text+0x130): undefined reference to `NewList'
kswrapper.o(.text+0x636): undefined reference to `NewList'
collect2: error: ld returned 1 exit status
makefile:17: recipe for target 'all' failed
which are to be expected when you link without startup and stdlib. You have to provide (or copy) implementation for those.
alkis is offline  
Old 13 January 2018, 12:47   #589
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 449
hmmm, linking succeeds if you remove -nostdlib.
alkis is offline  
Old 13 January 2018, 12:48   #590
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 827
Aren't those __udivsi and such part of libgcc?
Hedeon is offline  
Old 13 January 2018, 12:51   #591
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 449
Quote:
Originally Posted by Hedeon View Post
Aren't those __udivsi and such part of libgcc?
Yes, I think so.
alkis is offline  
Old 13 January 2018, 12:59   #592
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 449
@Toni
Note you haven't defined the entry point for the thing. Gcc, at least in my experiments, say you have a single file.c with a single function foo() and you compile with -nostartupfiles -nostdlib, gcc doesn't place the code at start, but prefers variables at start. So you can't run the program. What I end up doing is having a mystartup.s with just "jmp _foo" and you _have_ to pass it _first_ to the linker.
alkis is offline  
Old 13 January 2018, 13:07   #593
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,104
Yes, it can be linked but it is still too big which means there is still something added that should not be added. (10k larger than aros gcc version, 25k larger than sas-c version!). And those reloc entries that add about 6.5k to file size.

I didn't bother with getting it to fully work until other issues are fixed.
Toni Wilen is online now  
Old 13 January 2018, 14:19   #594
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 449
Quote:
Originally Posted by Toni Wilen View Post
- -Os results in internal compiler error:

Code:
m68k-amigaos-gcc -Os -m68000 -noixemul -fbaserel -fomit-frame-pointer -nostartfiles -fno-exceptions -DMIN_LIB_VERSION=33 -DKSWRAPPER=1 -DSCSIDIRECT=1 -DNSD=1 -DTD64=1 -DTRACKDISK=1 -DLARGE_FILE_SIZE=0 -DEXTRAPACKETS=1 -DSIZEFIELD -DDELDIR=1 -DMAX_BUFFERS=600 -DMIN_BUFFERS=20 -DMULTIUSER=0 -DPROTECTION=0 -DVERSION23=1 -DROLLOVER=1 -I. -c -o directory.o directory.c
directory.c: In function 'FillDelfileFib':
directory.c:3986:1: internal compiler error: Segmentation fault
 }
-Os works here.
Produces
-rwxrwxr-x 1 alex alex 70100 Ιαν 13 14:17 pfs3aio
...so 70k exe
alkis is offline  
Old 13 January 2018, 15:41   #595
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,104
Quote:
Originally Posted by alkis View Post
-Os works here.
My version is built under 64-bit cygwin and it still crashes the same. (same file, same function)

Quote:
Produces
-rwxrwxr-x 1 alex alex 70100 Ιαν 13 14:17 pfs3aio
...so 70k exe
So about same as aros version with -Os. Only remaining problem is "smalldata" like feature not working/not supported(?) to get rid of those absolute addresses and relocations.
Toni Wilen is online now  
Old 13 January 2018, 18:36   #596
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 96
AFAIK -fbaserel only enables small data model. Try throwing -msmall-code in there to enable small code model.
pipper is offline  
Old 13 January 2018, 20:55   #597
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,104
Quote:
Originally Posted by pipper View Post
AFAIK -fbaserel only enables small data model. Try throwing -msmall-code in there to enable small code model.
Code:
assroutines.o(.text+0x18): relocation truncated to fit: RELRELOC16 __udivsi3
assroutines.o(.text+0xa0): relocation truncated to fit: RELRELOC16 __udivsi3
assroutines.o(.text+0x8c): relocation truncated to fit: RELRELOC16 __umodsi3
assroutines.o(.text+0x2c): relocation truncated to fit: RELRELOC16 __umodsi3
boot.o(.text+0x1e): relocation truncated to fit: RELRELOC16 PutMsg
boot.o(.text+0x436): relocation truncated to fit: RELRELOC16 PutMsg
boot.o(.text+0x516): relocation truncated to fit: RELRELOC16 PutMsg
boot.o(.text+0x98): relocation truncated to fit: RELRELOC16 OpenLibrary
boot.o(.text+0x1ec): relocation truncated to fit: RELRELOC16 OpenLibrary
boot.o(.text+0x88): relocation truncated to fit: RELRELOC16 OpenLibrary
...
Do I need to manually reorder modules to keep them inside +-32k limit?

Also can't it create in-place LVO calls (jsr -$xxx(a6)) instead of calling some library functions?

(Interestingly -Os with -msmall-code does not crash)
Toni Wilen is online now  
Old 13 January 2018, 21:00   #598
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 96
I didn’t have much luck with it either. This would be a great time for Bebbo to step in
pipper is offline  
Old 14 January 2018, 17:47   #599
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 307
Floppy disk

Feedback to many posts:

Quote:
sprintf (buffer, "%s:%06d:", name, size);
returns NULL
-> fixed.

Quote:
Code:
*((long *)b)++ = 0;
This is only a correct solution if the type of b points to an object with sizeof(long):
Code:
*((long *)b++) = 0;
Better split it into 2 statements.
[CODE]*(long*)b = 0;
b = ...; // depends on type of b how to calculate the + sizeof(long).

Quote:
... donations...
There's a paypal button: https://github.com/bebbo/amigaos-cross-toolchain

Quote:
internal compiler error
Please open a bug report (issue) at https://github.com/bebbo/gcc/issues and provide the precompiled source (-E) plus the commandline to reproduce.

Code:
void *SysBase;
Won't compile...
Code:
struct ExecBase *SysBase;
compiles.

To link it: do not omit the libraries.
But omit the startup code and provide your own:
Code:
Start:
    lea	___a4_init,a4 ; only needed with -fbaserel
    jmp	_Initialize
Quote:
-msmall-code
Maybe object reordering might help, but IMHO it's too large

Quote:
LVO...
The library calls are inlined into the code

My code size with -Os -fbaserel: ~70k

And with similar options as in SCOPTIONS I am down to 63k using -m68020 -mregparm=4

BTW: I am using now https://github.com/bebbo/amiga-gcc to build the compiler, tools and libraries. Makefile based and way faster.

Last edited by bebbo; 14 January 2018 at 18:21.
bebbo is offline  
Old 14 January 2018, 18:20   #600
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,104
Quote:
Originally Posted by bebbo View Post
The library calls are inlined into the code
But if thats true, where those PutMsg() (and other library call) truncated relocation messages come from? It makes no sense, there should be nothing to relocate.
Toni Wilen is online now  
 


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 11:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 23:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 04:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 22:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 15: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 21:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.12695 seconds with 16 queries