apple / swift-crypto

Open-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on Linux platforms.
https://apple.github.io/swift-crypto
Apache License 2.0
1.47k stars 165 forks source link

Android build fixes (build with -fPIC) #293

Closed lhoward closed 2 weeks ago

lhoward commented 2 weeks ago

Build with -fPIC on Android as it is not the default, and is necessary if swift-crypto is to be embedded into a shared library.

lhoward commented 2 weeks ago

Ah, yes, right you are.

@finagolfin is there a way to ensure the Android SDK is always compiling PIC even when not building shared libraries?

lhoward commented 2 weeks ago

I'm going to close this because it needs to be fixed in the Android SDK.

finagolfin commented 2 weeks ago

is there a way to ensure the Android SDK is always compiling PIC even when not building shared libraries?

We used to set it in the destination config until Swift 6, but I thought it was made the default now, so I didn't bother setting it in the new Swift 6 SDK bundle.

If that's not the case, you can always pass in -Xcc -fPIC on the command-line, or we can change the default for the Android SDK bundle.

lhoward commented 2 weeks ago

Thanks. Actually I just removed the swift-crypto dependency from my app, was the simplest solution for now :)