Skip to content
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

[COMPILER REQUEST]: Update arm-none-eabi-gcc #5545

Closed
LunarLambda opened this issue Oct 2, 2023 · 18 comments · Fixed by #5554
Closed

[COMPILER REQUEST]: Update arm-none-eabi-gcc #5545

LunarLambda opened this issue Oct 2, 2023 · 18 comments · Fixed by #5554
Assignees
Labels
new-compilers request Request for something

Comments

@LunarLambda
Copy link

Compiler name

arm-none-eabi GCC

Compiler version

13.2.0

Compiler language

C++, C

Compiler homepage

https://gcc.gnu.org/gcc-13/

Motivation

The GBA homebrew development community makes extensive use of compiler explorer for testing code and bisecting problems. Of particular interest is the arm-none-eabi target, which is lagging behind the arm-linux-[gnu]eabi[hf] targets by several versions.

It would be nice if it could be updated, as testing code against a slightly different ARM target leads to issues with compiler flags and optimisation passes being different.

@LunarLambda LunarLambda added new-compilers request Request for something labels Oct 2, 2023
@dkm
Copy link
Member

dkm commented Oct 2, 2023

It's true we usually only provide on GCC version for each tarrget arch. In particular, we don't provide systematically every target OS possible.

But we can change that of course. Out of interest, could you provide an example of such difference?

@dkm dkm self-assigned this Oct 2, 2023
@LunarLambda
Copy link
Author

the linux target compilers require -mfloat-abi=soft otherwise refuses to compile code for the CPU we target (arm7tdmi). While they can be used, the generated code is usually slightly different, probably due to some tuning options being different(?) (or due to version differences)

Don't have a concrete example right now, sadly. It's just something that comes up every now and then in our community. But the compiler is already there, it just needs updating.

@dkm
Copy link
Member

dkm commented Oct 2, 2023

Ok, thanks for the details. I'll have a look later then and let you know. Adding another compiler is the simplest approach but I would like to investigate other alternative first before that.

@partouf
Copy link
Member

partouf commented Oct 2, 2023

We have gotten these compilers from arm.com before, but their website has become even more of a maze since then. We'll need to do some digging.

@partouf
Copy link
Member

partouf commented Oct 2, 2023

It's probably one of these https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
But they go up to 12.3

@LunarLambda
Copy link
Author

Yeah, arm.com lags behind by a version usually. The download link is the right one.

@partouf
Copy link
Member

partouf commented Oct 2, 2023

The last our installs has been 11.2 it seems https://github.com/compiler-explorer/infra/blob/main/bin/yaml/cpp.yaml#L180

So we could at least install the v12 ones

@dkm
Copy link
Member

dkm commented Oct 2, 2023

the linux target compilers require -mfloat-abi=soft otherwise refuses to compile code for the CPU we target (arm7tdmi). While they can be used, the generated code is usually slightly different, probably due to some tuning options being different(?) (or due to version differences)

Don't have a concrete example right now, sadly. It's just something that comes up every now and then in our community. But the compiler is already there, it just needs updating.

Is this the kind of error you get?
https://c.godbolt.org/z/bGT8TW5M3

<source>:2:1: sorry, unimplemented: Thumb-1 'hard-float' VFP ABI

@LunarLambda
Copy link
Author

yeah. I know the flag fixed it but it causes some confusion for people "why do I need this flag here but not in my project, why does it give slightly different code"

@dkm
Copy link
Member

dkm commented Oct 2, 2023

Ok, even if -marm, it gives different code in some cases? Is this because the compiler is configured to target something different or because the libc is different?

@LunarLambda
Copy link
Author

yes. I'm not really sure why. The main difference I've seen is in stack usage/register allocations, and sometimes loop structure. Again I think the linux-eabi compilers might have different defaults for tuning options. I couldn't entirely figure out the reason.

@dkm
Copy link
Member

dkm commented Oct 2, 2023

I can also add arm-none-eabi to the list of cross compiler we build, unless you need a specific version from ARM.

@LunarLambda
Copy link
Author

If possible that would be ideal I think

@dkm
Copy link
Member

dkm commented Oct 2, 2023

Tried a local build and it builds directly. I'll add this. Is it ok if I simply build 13.2.0 now and only update for later releases? Or do you need an older version?

@LunarLambda
Copy link
Author

nope that would be perfect for us. Maybe the 12.3 from arm.com could still be included since some people in our community use it as an alternative but it's not super pressing. thank you very much for this

dkm added a commit to compiler-explorer/gcc-cross-builder that referenced this issue Oct 2, 2023
Add a GCC 13.2 config for baremetal 32bits ARM.

Also adjust the script used to update the config to handle this new
target (it is still part of the arm group, but it must not conflict with
arm-linux compiler).

refs compiler-explorer/compiler-explorer#5545

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
dkm added a commit that referenced this issue Oct 2, 2023
Add an arm-unknown-eabi GCC 13.2 as asked by GBA community.

fix #5545

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
dkm added a commit to compiler-explorer/gcc-cross-builder that referenced this issue Oct 2, 2023
Add a GCC 13.2 config for baremetal 32bits ARM.

Also adjust the script used to update the config to handle this new
target (it is still part of the arm group, but it must not conflict with
arm-linux compiler).

refs compiler-explorer/compiler-explorer#5545

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
dkm added a commit to compiler-explorer/infra that referenced this issue Oct 3, 2023
Add a GCC 13.2 config for baremetal 32bits ARM.

refs compiler-explorer/compiler-explorer#5545

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
dkm added a commit that referenced this issue Oct 3, 2023
Add an arm-unknown-eabi GCC 13.2 as asked by GBA community.

fix #5545

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
dkm added a commit to compiler-explorer/infra that referenced this issue Oct 3, 2023
Add a GCC 13.2 config for baremetal 32bits ARM.

refs compiler-explorer/compiler-explorer#5545

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
dkm added a commit to compiler-explorer/infra that referenced this issue Oct 3, 2023
Add a GCC 13.2 config for baremetal 32bits ARM.

refs compiler-explorer/compiler-explorer#5545

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
@dkm
Copy link
Member

dkm commented Oct 3, 2023

the compiler should be installed tonight, I'll merge the corresponding config tomorrow.
@partouf is adding the ARM compilers in #5551

I'll keep this new target in the list of cross-compiler we build on each new gcc release.

@LunarLambda
Copy link
Author

sweet! thank you

@dkm
Copy link
Member

dkm commented Oct 4, 2023

Everything is ready, but I'll wait until cppcon is over to merge anything that touches the live site, so most probably early next week :)

@dkm dkm closed this as completed in #5554 Oct 6, 2023
dkm added a commit that referenced this issue Oct 6, 2023
Add an arm-unknown-eabi GCC 13.2 as asked by GBA community.

fix #5545

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-compilers request Request for something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants