Skip to content

Commit c3e0c69

Browse files
committed
fix: use add_shflags to force-link libinfiniops.so on shared library targets
The `infiniop` target is `set_kind("shared")`, so xmake ignores `add_ldflags` during linking. Switch to `add_shflags` with `--no-as-needed` so the GNU linker keeps `libinfiniops.so` in the `NEEDED` list even when no direct symbol references exist in `infiniop`'s own object files.
1 parent 5e9e0a2 commit c3e0c69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ target("infiniop")
394394
add_includedirs(get_config("infiniops") .. "/src")
395395
add_includedirs(get_config("infiniops") .. "/generated/include")
396396
add_linkdirs(get_config("infiniops") .. "/build/src")
397-
add_links("infiniops")
397+
add_shflags("-Wl,--no-as-needed,-linfiniops,--as-needed", {force = true})
398398
add_rpathdirs(get_config("infiniops") .. "/build/src")
399399
end
400400
add_files("src/infiniop/devices/handle.cc")

0 commit comments

Comments
 (0)