Skip to content
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

BoringSSL conflicting symbols for Armv7 #407

Open
colemancda opened this issue Oct 21, 2022 · 7 comments
Open

BoringSSL conflicting symbols for Armv7 #407

colemancda opened this issue Oct 21, 2022 · 7 comments

Comments

@colemancda
Copy link

colemancda commented Oct 21, 2022

I encountered an issue with integrating CryptoKit (nested dependency) and SwiftNIO in a single project cross compiled for Armv7, since its statically linked and both seem to vendor BoringSSL.

swift-nio-ssl/CNIOBoringSSL
swift-crypto/CCryptoBoringSSL

Swift-armv7-CryptoKit.log

@Lukasa
Copy link
Contributor

Lukasa commented Oct 22, 2022

We'll need to add support for armv7 builds to our cross-compile checks. Are you able to produce a x-compile toolchain for Linux armv7 we can use?

@colemancda
Copy link
Author

colemancda commented Oct 22, 2022

I was able to generate a toolchain, https://github.com/colemancda/swift-armv7/actions/runs/3304509240
Just clone https://github.com/colemancda/swift-armv7 and run

./generate-xcode-toolchain.sh
export SWIFT_PACKAGE_SRCDIR=/home/user/Developer/MySwiftPackage
export SWIFT_NATIVE_PATH=/tmp/cross-toolchain/debian-bullseye.sdk
./build-swift-package.sh

@Lukasa
Copy link
Contributor

Lukasa commented Oct 24, 2022

So I think that doesn't quite have the shape we're looking for. Ideally it should produce a toolchain that we can use with --destination as shown here:

swift build --product CNIOBoringSSL --destination "${cc_target}"
.

@colemancda
Copy link
Author

After running ./generate-xcode-toolchain.sh, you should have the destination file in ./build/armv7-unknown-linux-gnueabihf-toolchain.json

@Lukasa
Copy link
Contributor

Lukasa commented Oct 25, 2022

So as a piece of feedback, ideally the .json paths here wouldn't be absolute, and wouldn't be temporary (they point into /tmp). Instead, they'd be ready to be installed in the various directories under /Library/Developer.

@colemancda
Copy link
Author

I agree, but I adopted this from https://github.com/apple/swift-package-manager/blob/main/Utilities/build_ubuntu_cross_compilation_toolchain and wanted to make as few changes as possible

@colemancda
Copy link
Author

Also I wasn't aware that the destination.json format would work without absolute paths.

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

No branches or pull requests

2 participants