goplus / llgo

A Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python
Apache License 2.0
365 stars 26 forks source link

llcppsymg:linux compatibility #830

Closed luoliwoshang closed 1 month ago

luoliwoshang commented 1 month ago

nm tool

dynamic symbol

using the nm tool to examine dynamic libraries, have discovered significant differences between macOS and Linux: On Linux:

symbol version

On Linux, symbols may appear with version declarations separated by @@ https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

dynamic lib search

pkg-config

On Linux systems, the pkg-config --libs command does not output the -L path for dynamic libraries installed in the system's default search paths

For example: root@be00d9b1c2c9:/usr/lib/aarch64-linux-gnu# pkg-config --libs lua5.4 -llua5.4

This output only includes the -l flag to specify the library name, but does not include the -L flag to specify the library path. This is because the library is located in the system's default search path.

will search valid path from below conf /etc/ld.so.conf.d/*.conf /etc/ld.so.conf

so & dylib

On Linux, dynamic library names end with .so

Related Bugs & Patch