Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Raspberry Pi support #316

Merged
merged 2 commits into from
Jul 24, 2021
Merged

Conversation

ObsidianX
Copy link
Contributor

@ObsidianX ObsidianX commented Jul 23, 2021

Initial support for the linuxArm32Hfp (Raspberry Pi) build target. The entire target is behind the new enableKotlinRaspberryPi flag in gradle.properties which is disabled by default.

A few of the linuxX64 source files were usable without modification but I haven't found a way to share the source between the two versions yet. Building the Pi version does require a local sysroot (/tmp/rpi-sysroot) folder to properly link with the ARM binaries. The cinterop target doesn't support setting linker options in Gradle however binary does which would help remove the hard-coded path to the sysroot, but that would be a larger change.

mimalloc causes segfaults on the Raspberry Pi and the useMimalloc flag is ignored for the linuxArm32Hfp target.

@ObsidianX ObsidianX force-pushed the raspberry-pi-support branch from cb73398 to 4b8381a Compare July 24, 2021 02:07
@@ -3,7 +3,7 @@ version=2.0.0.999
#kotlinVersion=1.5.20
kotlinVersion=1.5.30-M1
kotlinSerializationVersion=1.2.1
coroutinesVersion=1.5.0
coroutinesVersion=1.5.1-SNAPSHOT
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 just remembered this relies on a custom build of kotlinx.coroutines with Arm32Hfp enabled. Probably can't merge this unless that gets enabled upstream.

Copy link
Member

@soywiz soywiz Jul 24, 2021

Choose a reason for hiding this comment

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

I'm going to merge it and disable it with a flag or something, so the code is already here and we can enable it when this situation changes. you did it already

Did you do something special to compile kotlinx.coroutines & atomicfu on the PI? Maybe we can make a couple of PRs adding support to it. I already did a atomicfu PR here: Kotlin/kotlinx-atomicfu#193 and commented here Kotlin/kotlinx.coroutines#855 not sure if you did something different or I missed something. Maybe we can ping them to see if we can unlock this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For kotlinx.coroutines I needed to disable tests on the arm target: https://gist.github.com/ObsidianX/dcfb862a6f41fad598053eef50679374

Copy link
Member

Choose a reason for hiding this comment

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

Because some of the tests failed, or something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Posted a PR with a better solution: Kotlin/kotlinx.coroutines#2841

@soywiz soywiz merged commit 6430edc into soywiz-archive:master Jul 24, 2021
@soywiz
Copy link
Member

soywiz commented Jul 24, 2021

pi-korge

Thank you very much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants