View Single Post
Old 14 February 2022, 22:46   #1339
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by girv View Post
I'm exploring using this toolchain (and vasm) for a game. I've skimmed this epic thread and done a lot of poking around, and I have a few questions still.
oh no

Quote:
Originally Posted by girv View Post


What code is run at startup? I'd like to use -nostartfiles (and -nostdlib) to minimise the code size, but I'm also curious what this leaves out. Are these the relevant sources?
https://github.com/bebbo/libnix/tree...ources/startup
if you are using -noixemul aka -mcrt=nix20 or -mcrt=nix13, then libnix is used.
The default is newlib, which I wouldn't use, it's a place holder for ixemul in the far future
And there -mcrt=clib2, which I also don't use.

Quote:
Originally Posted by girv View Post
-nostartfiles only seems to drop a few hundred bytes though and I guess I can live with that.
-noixemul provides library auto init, a memory allocater and some more posix stuff... it's like a religion

Quote:
Originally Posted by girv View Post
Do -nostartfiles and -nostdlib interact? Does -nostdlib imply -nostartfiles? edit: found the manual for these flags https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
using stdlib requires some startup which initializes the stuff like stdio, etc.p.p. so you'd have to create some proper startup code yourself.

Quote:
Originally Posted by girv View Post

Are -flto and/or -fwhole-program supported?
I was experimenting with my own vasm startup code and got "undefined reference to 'SysBase'" when linking with -flto, but it linked sucessfully without that flag.
edit: resolved the error, I was actually using -flto and -fwhole-program together which is not correct, but the question stands.

With -fbaserel, are messages like this errors or warnings?
"reloc for _state_game_copper0 is out of range: 00000000"
state_game_copper0 is an XDEF label in a vasm .obj and ideally in a separate section (but see next question!) - do I need to declare "state_game_copper0" as __far in the C code?
if it's a variable and not referenced via A4: yes
Quote:
Originally Posted by girv View Post

Is it possible to have a .obj file assembled by vasm produce an Amiga HUNKF_CHIP hunk? I see the amiga.x linker script has "datachip" and "bsschip" sections - are these special names recognised by your ld?
the m68k-amigaos-ld uses the names to set the flags for chip or fast memory. you can use theses section names with vasm too.
Quote:
Originally Posted by girv View Post
Though ld seems to use amiga_bss.x instead anyway which lacks these sections.
this still should work

Quote:
Originally Posted by girv View Post
Thanks

Last edited by bebbo; 15 February 2022 at 06:45.
bebbo is offline  
 
Page generated in 0.04829 seconds with 11 queries