-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EEGCC output's bad asm / asm alignment. #364
Comments
This issue does not occur on the normal GCC compiler. |
thanks for the report @weirdbeardgame - can you link a repro branch? |
https://github.com/weirdbeardgame/Fatal-Frame-2 - Uncomment Gphase.c and the file right below it then try and run it |
This behavior is expected due to how the The processed asm ends up looking something like this:
Notice how the symbol is defined twice. This usually doesn't matter, because in normal circumstances there's nothing that may change the alignment of the symbol between the first and second declaration, but here there's an alignment directive that (in the eyes of the assembler) may change the address of the symbol, then the assembler decides to bark at you. You can rewrite the #define INCLUDE_ASM(FOLDER, NAME) \
__asm__( \
".section .text\n" \
" .set noat\n" \
" .set noreorder\n" \
" .include \""FOLDER"/"#NAME".s\"\n" \
" .set reorder\n" \
" .set at\n" \
" .globl " #NAME ".NON_MATCHING\n" \
" " #NAME ".NON_MATCHING" " = " #NAME "\n" \
) The important part is the macro is not defining the symbol again, it is letting the asm file to do that instead. btw, why is your |
That seemed to fix this issue. Thanks! |
When running through Fatal Frame 2 with splat's EEGCC compiler option enabled, I noticed I started to get function already defined errors.
In the ASM of these functions, the align is set to 3
Which causes the issue. Manually removing the .align statements in these files will fix the compiler issue.
The text was updated successfully, but these errors were encountered: