kasimok / wgShowcase-public

showcase of integrating wireguardkit
2 stars 3 forks source link

Is it possible to build `libwg-go.a` for both iOS and Simulator? #1

Closed rakuyoMo closed 2 years ago

rakuyoMo commented 2 years ago

The libwg-go.a in the repository is compiled for iOS, and when I run the Makefile in WireGuard on my M1 Mac, it reports an architecture incompatibility error.

kasimok commented 2 years ago

Hi RaykuyoMo, pretty simple, check the Makefile: default value is: ARCHS ?= x86_64 PLATFORM_NAME ?= macosx which is set to build for macos

set ARCHS to arm64 and PLATFORM_NAME to iphoneos to build for iOS devices.

Finally, you can use lipo -create to merge this two output static lib into a fat universal lib Anyway, I replaced the lib with a fat universal lib

kasimok commented 2 years ago

@rakuyoMo Nonsense at all, Network Extension Framework is currently not simulated on iOS simulators.

rakuyoMo commented 1 year ago

@kasimok I'm sorry that so much time has passed and I don't seem to have made much progress. Do you know how to modify the Makefile file to generate a .a library that supports the Mac Catalyst platform?

kasimok commented 1 year ago

in a trip to Shanghai, it has been a longtime, for catalyst, need to investigate, since it’s not a pure UI framework, networking with iOS code on Mac is highly not supported. I’ll be back at Sunday, if I got time I’ll take a look.sent from iPhone在 2023年3月29日,下午6:48,Rakuyo @.***> 写道: @kasimok I'm sorry that so much time has passed and I don't seem to have made much progress. Do you know how to modify the Makefile file to generate a .a library that supports the Mac Catalyst platform?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

rakuyoMo commented 1 year ago

in a trip to Shanghai, it has been a longtime, for catalyst, need to investigate, since it’s not a pure UI framework, networking with iOS code on Mac is highly not supported. I’ll be back at Sunday, if I got time I’ll take a look.

Thanks a lot, I'm working on the Makefile file now, I can build some .a files, but I don't know how to modify it to add parameters to support Mac Catalyst. I don't feel like it needs to be complicated in theory, I just don't know where to change...

rakuyoMo commented 1 year ago

I was able to successfully build the x86_64 static library with Mac Catalyst support by adding -target x86_64-apple-ios16.0-macabi after CFLAGS_PREFIX. However, I was not able to build the Mac Catalyst static library for the arm64 architecture, so I was unable to use .... on my M1 MacBook air.


Is it possible to instead use go-mobile to build WireguardKit, 🤔

e.g.

gomobile bind -v -a -target=ios,iossimulator,maccatalyst,macos -iosversion=13
kasimok commented 1 year ago

I was able to successfully build the x86_64 static library with Mac Catalyst support by adding -target x86_64-apple-ios16.0-macabi after CFLAGS_PREFIX. However, I was not able to build the Mac Catalyst static library for the arm64 architecture, so I was unable to use .... on my M1 MacBook air.

Is it possible to instead use go-mobile to build WireguardKit, 🤔

e.g.

gomobile bind -v -a -target=ios,iossimulator,maccatalyst,macos -iosversion=13

Time has changed, there are many alternative all In one library for VPN protocols, did you look at https://github.com/passepartoutvpn/tunnelkit?

rakuyoMo commented 1 year ago

Time has changed, there are many alternative all In one library for VPN protocols, did you look at https://github.com/passepartoutvpn/tunnelkit?

I know about this, but haven't tried it yet. Do you mean I can try to use this library instead of WireGuardKit?

kasimok commented 1 year ago

Sure, OpenVPN/IPsec/ wireguard all supported 在 2023年4月2日,下午6:00,Rakuyo @.***> 写道:

Time has changed, there are many alternative all In one library for VPN protocols, did you look at https://github.com/passepartoutvpn/tunnelkit?

I know about this, but haven't tried it yet. Do you mean I can try to use this library instead of WireGuardKit?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>