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

C-shared library generated with xgo build not working for mac ARM (M1)machine #207

Open
pandurangpatil opened this issue Jun 12, 2023 · 2 comments

Comments

@pandurangpatil
Copy link

pandurangpatil commented Jun 12, 2023

Repository - https://github.com/Privado-Inc/goastgen/tree/xgo-build-trial (Sharing a branch where I tried the build, as the main branch, we are now taking a different approach without using c-shared binary).

I tried generating the c-shared binary on my mac machine
image

It worked well sample working Java code is here - https://github.com/Privado-Inc/goastgen/blob/xgo-build-trial/sample-client/Sample.java

However when I tried with binary generated from the build through GirHub release actions we tried. With above sample replacing the .dylib didn't work it just killed the process. (I did tried making the build using xgo installed over separate AWS Ubuntu machine and making the build for mac M1 chip (arm64). With the same result)

I tried look at what other system dependencies these libraries have using otool. Following are the details for lib generated on my machine and the one generated from the GitHub action build.

Lib generated on my machine.

lib-goastgen_darwin_arm64.dylib:
	lib-goastgen_darwin_arm64.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1858.112.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

Lib generated from the GitHub build

lib-goastgen-darwin-10.12-arm64.dylib:
	lib-goastgen-darwin-10.12-arm64.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
	/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)

The error I am getting with the build generated using xgo

image
@pandurangpatil
Copy link
Author

I think issue #208 and this ticket is related

@woshiqiandui
Copy link

I have encountered a problem similar to yours.
sqlite3 could't run normally

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