xgo icon indicating copy to clipboard operation
xgo copied to clipboard

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

Open pandurangpatil opened this issue 2 years ago • 2 comments

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 avatar Jun 12 '23 09:06 pandurangpatil

I think issue #208 and this ticket is related

pandurangpatil avatar Jun 12 '23 10:06 pandurangpatil

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

woshiqiandui avatar Jun 25 '23 07:06 woshiqiandui