Skip to content

Conversation

xtremekforever
Copy link
Contributor

I re-read the doc and realized some things weren't fully accurate and that some more could be added to help others working with Zephyr and Swift.

  • Fixed the target architecture compatibility to list the correct target triples against Cortex M- cores and ARM architectures.
  • Fixed flags that need to be added to CMakeLists.txt, since what was there was not quite accurate.
  • Added section on customizing the linker to strip out unused sections (such as .swift_modhash) and link extra libraries such as swiftUnicodeDataTables.

Please have a look @ebariaux if you don't mind and see if you spot any issues!


When this is built, depending on the target architecture, warnings may then be printed about 32-bit enums, like this:

```console
Copy link
Member

Choose a reason for hiding this comment

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

does this imply you should be using -fshort-enums?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well even if you use -fshort-enums in your main Xcc flags, these warnings get printed as soon as you pull in swiftUnicodeDataTables. Could be that somehow the tables are compiled different (like without -fshort-enums) or some other reason.

Copy link
Member

Choose a reason for hiding this comment

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

Oh interesting. Regardless, this is a great improvement and we should look into the enum thing independently.

Copy link
Member

Choose a reason for hiding this comment

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

Do you mind rebasing and ill run ci?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think we should open a ticket on swiftlang/swift for this enum mismatch for armv7em? Or just let it be...

Yes I'll rebase in a bit

Copy link
Member

Choose a reason for hiding this comment

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

IMO we should just build unicode support as part of the SwiftPM/CMake build graph and avoid prebuilts

@rauhul rauhul merged commit 2b37be6 into swiftlang:main Jun 21, 2025
21 checks passed
trundlebits pushed a commit to trundlebits/swift-embedded-examples that referenced this pull request Jul 18, 2025
- Update architectures and flags for Zephyr guide
- Added back picolibc include dir, added more info
- Add more information on linking customizations
- Change title of IntegrateWithZephyr doc
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.

2 participants