Open bilaliscarioth opened 9 months ago
Does pkg-config (or the zig usage in the build system) not work for you use case? Why?
No.. it's not the pkg-config because it give the correct flags
iscarioth$ pkg-config --cflags --libs glib-2.0
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -L/usr/local/lib -lglib-2.0 -lintl -lpcre2-8
it's more the zig usage in the build system which is not specific to OpenBSD, i just remember LLD was patched for matching versioned shared library ( https://github.com/openbsd/ports/blob/master/devel/llvm/17/patches/patch-lld_ELF_DriverUtils_cpp )
at src/link/Elf.zig, he only check up the (somewhere in lib dir)`/libglib-2.0.so ( only) ( src/main.zig on accesLibPath)
distros/packages are supposed to symlink libfoo.so
to libfoo.so.X
etc
Zig Version
0.12.0-dev.2040+9a1608509
Steps to Reproduce and Observed Output
Hello Zig Developers !
I tried to follow the issues i caught every time on OpenBSD 7.3 (-current) when we use linkSystemLibrary("foo"). Compiler only check every dir with where file ended as
libfoo.so
but actually not... Shared library (in most of time) end by a major and a minor version. Which render to something like thatlibfoo.so.X.Y
(as in title).So we caught the famous:
Only solution is to use addObjectFile for every shared library used/called by the project or by dependencies. put the absolute file.
the only thing i know it that's probably come from at src/main.zig 3836. but no further. i'll investigate ^^
(edit i find it it's at src/link/Elf.zig at line 2077 (sorry) )
Expected Output
Building without specified the absolute path to shared library