LibRegex: Link libregex_rust before LibUnicode

Unicode Rust FFI methods have been moved to LibUnicode. When the system
linker uses --as-needed by default, linking of liblagom-regex.so fails
because of undefined references to unicode_*. They are undefined as
liblagom-unicode.so, which has the symbols, is processed before
liblibregex_rust.a, which has references to them. Move LibUnicode after
libregex_rust to ensure the symbols are available.
This commit is contained in:
Hwang Joonhyung 2026-05-18 23:03:41 +09:00 committed by Ali Mohammad Pur
parent 437c8b1d19
commit 6a2e50bf50

View file

@ -4,10 +4,9 @@ set(SOURCES
)
ladybird_lib(LibRegex regex EXPLICIT_SYMBOL_EXPORT)
target_link_libraries(LibRegex PRIVATE LibUnicode)
import_rust_crate(MANIFEST_PATH Rust/Cargo.toml CRATE_NAME libregex_rust FFI_HEADER RustFFI.h)
target_link_libraries(LibRegex PRIVATE libregex_rust)
target_link_libraries(LibRegex PRIVATE libregex_rust LibUnicode)
if ((LINUX OR BSD) AND NOT BUILD_SHARED_LIBS)
target_link_options(LibRegex INTERFACE LINKER:--allow-multiple-definition)
endif()