Open abhi-m-simformsolutons opened 3 years ago
do you have a minimal reproducible example of a project that triggers this? are you using plugins (since you referred to the other issue)?
@seankhliao Thanks for your reply. Please find minimal reproducible example with this repository: https://github.com/abhi-m-simformsolutons/GoCheck Important: The actual error logs will only shows when run this repo in IOS device.
In this repo, you can see integration of WireGuard and DNSCrypt in single target. Because of this, runtime symbol table error occurs.
Thank you.
The actual error logs will only shows when run this repo in IOS device.
CC @cherrymui
I wonder if #30822 and/or #31485 are related as they can be found by searching for the same error message "function symbol table not sorted by program counter".
Could you share how you build the program? In particular, what build mode do you use to build the Go part, and how do you put pieces together? Do you use shared libraries? Thanks.
@cherrymui This example repository is a native application for IOS build in Swift language. We are using some SDK (DNSCrypt, WireGuard) which is build in GO language. To build this project, you need to use XCode and run it in a device.
Okay, https://github.com/abhi-m-simformsolutons/GoCheck/tree/master/WireGuardKitGo has Go code (the only Go source code in the repo). Its Makefile builds it as a c-archive. https://github.com/abhi-m-simformsolutons/GoCheck/blob/master/WireGuardCheck/Dnscryptproxy.framework/Versions/A/Dnscryptproxy is a binary blob, which is actually a Go c-archive. (For the future, don't include binary blobs, but the source code and how to build it. Thanks.)
So this is about including two Go c-archives in the same executable, and the _cgo_topofstack symbol in one module is somehow resolved to other module and causing the "symbol table not sorted" error.
I'm not sure including two Go c-archives in the same executable is supported (could be, I'd need to look into more). We might be able to make it work.
Could you try if you get the same failure with Go 1.16beta or Go tip? Could you try building the two Go parts into a c-archive? That should work.
I'm not sure including two Go c-archives in the same executable is supported (could be, I'd need to look into more). We might be able to make it work.
See previously https://github.com/golang/go/issues/30822#issuecomment-473730943.
Thanks @bcmills !
Okay, so this is not going to work. Please try building the two Go parts into a single c-archive? Thanks.
I wonder if this problem was solved, and how did you solve it. Is there any way to use 2 Go SDK that can run successfully in one iOS project? For example: one of it set -buildmode=c-shared? Hope for your answer! Thanks.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
In XCode, I am working with network related things. For that, I integrate DNSCrypt and WireGuard.This both are in GO Language. Individual integration of these SDK will works fine in XCode project. But, When I integrate these two SDK in the same project(Target) at a same time it throws an error. I also refered this issue: #18190
What did you expect to see?
Build and Run Xcode Project Successfully.
What did you see instead?
function symbol table not sorted by program counter