Skip to content

[stdlib] Added Armv5 support #41686

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

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

colemancda
Copy link
Contributor

@colemancda colemancda commented Mar 5, 2022

Added support for cross compiling the Swift Stdlib for Armv5 processors.

Resolves SR-15944.

@colemancda

This comment was marked as resolved.

@colemancda

This comment was marked as resolved.

@finagolfin
Copy link
Member

Are you recompiling the Swift compiler with this pull? That's the only thing I can think of, that the unpatched compiler doesn't know this new arch.

@colemancda
Copy link
Contributor Author

Yes, I am recompiling the compiler, mainly since lib/IDE/Utils.cpp and lib/Basic/Platform.cpp are part of the compiler.

@finagolfin
Copy link
Member

I compared your failing command to a local trunk build on my Android AArch64 phone and I notice you're passing a target of -target armv5te-unknown-linux-gnueabi but your glibc.modulemap is in lib/swift/linux/armv5/. Are you sure the Swift compiler knows that the two arch names are used interchangeably?

Try running the failing command manually, but add these two flags -Xfrontend -dump-clang-diagnostics. That will tell you what path it's checking for the glibc.modulemap.

@colemancda

This comment was marked as resolved.

@colemancda
Copy link
Contributor Author

colemancda commented Mar 6, 2022

@buttaface I was able to get the Swift stdlib compiling successfully by changing the armv5te triple to armv5. Thanks!

@colemancda colemancda force-pushed the feature/armv5-trunk branch from 05cd418 to b85e673 Compare March 6, 2022 05:56
@colemancda
Copy link
Contributor Author

colemancda commented Mar 6, 2022

@CodaFi I have been able to successfully cross compile the Stdlib for armv5 (including libdispatch, Concurrency and Foundation module). Can we have the CI build this?

@colemancda
Copy link
Contributor Author

SwiftPM patches
swiftlang/swift-tools-support-core#296

@colemancda
Copy link
Contributor Author

I am able to build a Hello world program in Swift for Armv5

coleman@macbook-linux:~/Developer/buildroot$ readelf -A /home/coleman/Developer/buildroot/output/target/usr/bin/hello
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "5TE"
  Tag_CPU_arch: v5TE
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_rounding: Needed
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int

@artemcm
Copy link
Contributor

artemcm commented Mar 7, 2022

@swift-ci please test

@CodaFi
Copy link
Contributor

CodaFi commented Mar 7, 2022

@CodaFi CodaFi merged commit 7d9d798 into swiftlang:main Mar 7, 2022
@colemancda colemancda deleted the feature/armv5-trunk branch March 9, 2022 08:42
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