Difficulty linking library on Mac and Linux platforms

I’m having issues with creating a native extension, namely around setting a minimum mac version and undefined symbols using a statically build library. It is worth mentioning this is a rust based library, so building from source is not really an option.

Currently, the major problems are these errors:
OSX:

ld: warning: object file was built for newer OSX version (10.10) than being linked (10.7)
duplicate symbol ___muloti4

Linux:

undefined reference to `__syscall_error’

I stripped out the path names as they are mostly irrelevant. Any help with this would be greatly appreciated. I tried setting the flag -mmacosx-version-min=10.10 but the build server seems to reject it as an invalid flag for some reason?

https://github.com/asterick/extensions-wasmer

That is the source-code for the extension. It currently runs fine on win64 platforms.

It’s it a private repo? I’m unable to access it.

I’m not familiar with this function. What library would it be in?

Also, on OSX: a warning is not an error.
It’s telling you you should recompile the library with the correct min version.

Sorry, did not realize it wasn’t public. That problem is fixed.

@Mathias_Westerdahl That function is part of the standard libc in linux (it’s what signals the OS that there is a system error)

Hmm, doing a search for ‘man “syscall_error”’ doesn’t turn up any references to libc?

We currently link towards these libraries:

        dynamicLibs: ["openal","Xext","X11","Xi","GL","GLU","pthread","m","dl"]
1 Like

I know it’s defined in glibc, but I don’t know if it’s something that people are normally supposed to call. I suspect that wasmer is staticly linking some library but not others.

Is there a way to get the full build log of an extension, rather than just the filtered errors list?

Just wanted to let you both know it all works now, by using a couple hacks which are probably not a long term solution.

I found out that it is a glibc internal macro, and rather than pollute everything by including a GPL library, I just created a stub function, according to everything I’ve read about it this is fine, it just means I won’t be able to recover the error number in the future. I’m not actually quite sure what the long term implications are for this.

As far as my linking error for OSX, I just manually modified the archive and removed the duplicate symbol. I just have to hope that they library and the compiler built in for ___muloti4 have the same calling convention.

Thanks for the help!

The complete log.txt can be found in your build folders.