Skip to content

[Embedded] Add armv4t to list of recognized architectures #73005

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

Conversation

harlanhaskins
Copy link
Contributor

This adds armv4t as a recognized embedded architecture and builds a stdlib module for it.
Since LLVM natively supports armv4t, this is all that's needed to write Swift for the Game Boy Advance, if you combine it with the GBA LLVM toolkit from https://github.com/stuij/gba-llvm-devkit.

@harlanhaskins
Copy link
Contributor Author

@swift-ci please build toolchain

@harlanhaskins harlanhaskins changed the title [DNM] [Just for testing] [Embedded] Add armv4t to list of recognized architectures [Embedded] Add armv4t to list of recognized architectures Apr 13, 2024
@harlanhaskins harlanhaskins marked this pull request as ready for review April 13, 2024 00:06
@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@phausler phausler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally this looks fine to me; @kubamracek is there any other spots that need to be changed such that we ship a armv4 stdlib?

@@ -60,6 +60,8 @@ static std::string adjustClangTriple(StringRef TripleStr) {
OS << "armv5"; break;
case llvm::Triple::SubArchType::ARMSubArch_v5te:
OS << "armv5te"; break;
case llvm::Triple::SubArchType::ARMSubArch_v4t:
OS << "armv4t"; break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work more generally for armv4? are there other embedded cpus that would be good examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose I could add armv4, but I don’t have any readily available armv4 hardware that I can test against. It probably works just fine though.

@@ -183,6 +183,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
# the following are all ELF targets
if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD)
list(APPEND EMBEDDED_STDLIB_TARGET_TRIPLES
"armv4t armv4t-none-none-eabi armv4t-none-none-eabi"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the GBA llvm toolchain elf based?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, GBA ROMs are ELF

@kubamracek
Copy link
Contributor

Very nice! 😊

Copy link
Member

@rauhul rauhul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I have a similar patch locally!

@harlanhaskins harlanhaskins merged commit 1b36983 into swiftlang:main Apr 14, 2024
@harlanhaskins harlanhaskins deleted the harlan/you-put-your-right-arm-in-you-put-your-left-arm-in branch April 14, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants