Closed RetroRevivalGames closed 1 year ago
the assembler already aligns everything at 4 byte boundaries:
START:
rts
->
00000000 00000000 START:
0: 4e75 rts
2: 0000 .short 0x0000
and it's hard coded atm:
newsect->alignment_power = 2;
And last but not least: the Amiga hunk file format supports only multiples of 4. => this won't work using Amiga hunks.
workarounds:
Makes sense. I figured hunk would have that alignment limitation.
As far as using a different target, this toolchain only supports hunk correct? I remember trying to compile amiga-gcc with TARGET=m68k-elf
and it failed.
Makes sense. I figured hunk would have that alignment limitation.
As far as using a different target, this toolchain only supports hunk correct? I remember trying to compile amiga-gcc with
TARGET=m68k-elf
and it failed.
a) why aren't you using a stock m68k-elf?
b) make TARGET=m68k-elf gcc
should work, but other stuff fails...
a) why aren't you using a stock m68k-elf?
Stack heavy / slower assembly generated
b) make TARGET=m68k-elf gcc should work, but other stuff fails...
Unfortunately this is failing at binutils gas. Looks like some functions aren't getting proper parameters.
try again in 30 mins
make binutils -j30 TARGET=m68k-elf make binutils bfd... make binutils bfd...done make binutils gas... make binutils gas...done make binutils binutils... make binutils binutils...done make binutils ld... make binutils ld...done install binutils... install binutils...done
OK. Building only binutils does work. I was building all of gcc using make gcc TARGET=m68k-elf
gcc should compile too, but not newlib
Tried it again. Yes, looks like it built correctly. Tried it out and it works perfectly. Exactly what I was looking for, the high efficiency of your assembly generation with the elf binary format. I even got lto plugins to work with small modifications to the Makefile in amiga-gcc. Just remove --disable-plugins
from binutils configuration.
Thank you Bebbo.
Tried it again. Yes, looks like it built correctly. Tried it out and it works perfectly. Exactly what I was looking for, the high efficiency of your assembly generation with the elf binary format. I even got lto plugins to work with small modifications to the Makefile in amiga-gcc. Just remove
--disable-plugins
from binutils configuration.Thank you Bebbo.
I will omit --disable-plugins
if target is m68k-elf
.
Hi Bebbo. Since #29 I've gotten a ROM image for the SEGA Mega Drive to build and run successfully.
I've come across one more minor issue. I'm using -ffunction-sections and -fdata-sections along with --gc-sections to reduce ROM size. It works nicely but the linker seems to force a 4-byte alignment between each input section. In other words, each function/variable now has a few 0 bytes to align the next function/variable on a 4-byte boundary, which can chew up some space for larger programs. I'm trying to align on a 2-byte boundary.
Same lds. I've tried different values for the .text section's SUBALIGN command (0, 1, 2, 3, 4) and each time it aligns on a 4-byte boundary.
Not sure how much it would take to remedy this but if it's not too much of a hassle it'd be awesome if this was implemented.
I've done a little research into it. Looks like
asection
struct has align_power variable. Not sure if that could be used to allow users to configure the input section alignments via SUBALIGN?