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
ARM back-end generating GNU EABI div/mod library calls in EABI mode #18561
Comments
assigned to @rengolin |
It seems that this only happens when you chose a triple that has both ELF and EABI, since both are considered "environments". The "arm-elf-eabi" triple is normalized to "armv4t---elf-eabi", since "elf" is a valid environment, it completely ignores the EABI portion. Since I could have ELF files with any ABI in it, making ELF an environment doesn't make much sense, though I can see it's there, to differentiate between ELF and MachO. Supposing that people do write triples like "arm-elf-eabi", we should fix the behaviour. If not, we should just forbid such cases, as they will create confusion and we're not making a good default choice on them. There are two obvious ways to solve this:
I'm open to ideas. |
I did do this a while back. Triple has an ObjectFormat field that indicates what the format is. This is a worthy concern IMO, and is really available. getObjectFormat and getEnvironment should return the necessary information. Am I misunderstanding something and something else is needed in order to support that?
|
Hi Saleem, I believe this is only a concern to FreeBSD, which uses elf, rather than Linux, which doesn't. If you want to have a go at this, using the infrastructure you created, please do. I believe the hardest part will be to make sure all the unknown corner cases are dealt with, since I don't believe we have tests for all of them. I suggest you create a single patch that does the job, plus tests, and let everyone know in the list, so that if they start seeing weird behaviour in their platforms, they know what broke and it'll be easy to revert. cheers, |
This is a non-issue, since triples are not meant to mean anything. If/when we have a real issue with this odd behaviour, we can re-open the bug. |
Extended Description
$ cat mod.c
int f(int a, int b) { return a % b; }
unsigned int g(unsigned int a, unsigned int b) { return a % b; }
$ clang -target arm-elf-eabi -S mod.c -o - | grep mod
.file "mod.c"
bl __modsi3
bl __umodsi3
$ clang -target arm-none-eabi -S mod.c -o - | grep mod
.file "mod.c"
bl __aeabi_idivmod
bl __aeabi_uidivmod
For conformance reasons, both should output the EABI calls.
The text was updated successfully, but these errors were encountered: