Skip to content

Commit 2c387f5

Browse files
Use -z undefs instead of --unresolved-symbols=ignore-in-shared-libs
The previous flag tells ld to be lenient about undefined symbols in *sibling .so files* we link against — but oannetutils links no other .so, so the flag did nothing and the missing NetworkMapper symbol still failed the build. -z undefs (the Linux equivalent of Mac's -undefined,dynamic_lookup) allows undefined symbols *in this output .so*, deferring them to load-time resolution.
1 parent f0c5701 commit 2c387f5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎netutils/CMakeLists.txt‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ if(APPLE)
4141
target_link_options(oannetutils PRIVATE LINKER:-undefined,dynamic_lookup)
4242
elseif(UNIX)
4343
# LowLatSocket calls NetworkMapper::get_mac_by_uid, which lives in
44-
# oancommon — and oancommon already links oannetutils, so we can't
45-
# close the cycle at the CMake level. macOS' dynamic_lookup option
46-
# papers over this; on Linux we tell ld to defer the symbol to load
47-
# time. The engine binary always loads both .so's so the symbol
48-
# resolves there.
49-
target_link_options(oannetutils PRIVATE LINKER:--unresolved-symbols=ignore-in-shared-libs)
44+
# oancommon — and oancommon already PUBLIC-links oannetutils, so we
45+
# can't close the cycle by linking the other way at CMake level.
46+
# Mac papers over this with -undefined,dynamic_lookup; the Linux
47+
# equivalent is -z undefs (allow undefined symbols in this .so;
48+
# they'll resolve at load time when the engine pulls in both .so's).
49+
target_link_options(oannetutils PRIVATE LINKER:-z,undefs)
5050
endif()

0 commit comments

Comments
 (0)