c-shared library for Aix

126 views
Skip to first unread message

Anshuman Mor

unread,
Mar 2, 2024, 12:42:56 PM3/2/24
to golang-nuts
I have written multiple c-shared libraries code in golang for Windows, Linux, MacOS . I am using GCC cross compiler for the same. This code is running fine in production without any issue since last 3 years.

But, we have recently got a requirement to compile the same thing for AIX/PowerPC but I am afraid that go compiler doesn't support this out of the box, I tried many approaches but none worked like - 

1. Using gccgo compiler but this errors out with "Thread Local Storage" error.
2. Using c-archive and then convert to shared using gcc compiler, this also errors out with something or other.

Has anyone done similar type of work for Aix? Any help would be greatly appreciated.

TheDiveO

unread,
Mar 3, 2024, 9:59:12 AM3/3/24
to golang-nuts
llvm/clang? I've ditched gcc because of its many unfixable problems. After loosing quite some time, trying to cross-compile Go using gcc, I've switched to clang IIRC and this works beautifully, especially cross-building for Alpine/musl. However my AIX time with RS6000 was decades ago, and I was the one constantly turning up new kernel bugs from user space.

Anshuman Mor

unread,
Mar 5, 2024, 4:16:25 AM3/5/24
to golang-nuts
I tried with clang also but not luck, tried different approaches like using gccgo to directly build c-shared vs building c-archive using golang and then converting it to c-shared by linking using gcc/clang. No luck at all.
Reply all
Reply to author
Forward
0 new messages