Hello, I have been working on building a development toolchain for the Xbox 360, and as part of this I have been modifying GCC to match the system's stack frame layout. I have just been modifying the PowerPC SV4 ABI to achieve this. I got the layout mostly correct, however the stack arguments were only being promoted to 32 bits, which lead me to realise that I had not built a 64-bit GCC, despite the powerpc64-fcx-xenon target triplet I have been using. I got some help on IRC to set the compiler to 64-bit mode (by setting TARGET_DEFAULT manually in my gcc/config/rs6000/xenon.h), however now it generates junk assembly (the assembler complains about duplicate symbols for EVERY function, and I can confirm this is true) - see the attached test.c and test.s files. I have tried playing around with these flags, along with options in config.gcc, but to no avail. Would anyone be able to give me help/pointers on how to fix whatever the issue is causing invalid assembly to be generated, while keeping the current ABI and 64-bit GCC intact? Any help would be much appreciated. The relevant git repositories are as follows: - https://git.sr.ht/~aidenisik/gcc (Modified GCC) - https://git.sr.ht/~aidenisik/FCX-Installer (Build script) My modifications are in the commits under my name. Regards, - Aiden Isik
int addNums(int one, int two, int three, int four, int five, int six, int seven, int eight, int nine) { return one + two + three + four + five + six + seven + eight + nine; } int test() { return addNums(1, 2, 3, 4, 5, 6, 7, 8, 9); } void main() { int integer = test(); }
Attachment:
test.s
Description: Binary data