Work around link ordering issue on illumos
The most recent releases of dconf fail on illumos (and likely on Solaris too), due to link ordering issues with dependencies between gdbus
and engine
.
The actual failures are:
FAILED: gsettings/libdconfsettings.so
gcc -o gsettings/libdconfsettings.so 'gsettings/gsettings@@dconfsettings@sha/dconfsettingsbackend.c.o' -I/opt/local/include -I/opt/local/include/glib/glib-2.0 -I/opt/local/include/glib/gio-unix-2.0 -I/opt/local/lib/glib-2.0/include -I/usr/include -I/opt/local/include/freetype2 -I/opt/local/include/python3.7 -L/opt/local/gcc7/lib/gcc/x86_64-sun-solaris2.11/7.3.0 -L/opt/local/lib -L/usr/lib/amd64 -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,-soname,libdconfsettings.so -pipe -O2 -msave-args -mindirect-branch=thunk-inline -mfunction-return=thunk-inline -mindirect-branch-register -D_FORTIFY_SOURCE=2 -Wl,-R/opt/local/gcc7/lib/gcc/x86_64-sun-solaris2.11/7.3.0 -Wl,-R/opt/local/lib -Wl,-R/usr/lib/amd64 common/libdconf-common-hidden.a gdbus/libdconf-gdbus-thread.a engine/libdconf-engine.a gvdb/libgvdb.a shm/libdconf-shm.a common/libdconf-common.a /opt/local/lib/libgio-2.0.so /opt/local/lib/libgobject-2.0.so -Wl,-R/opt/local/lib /opt/local/lib/libglib-2.0.so /opt/local/lib/libintl.so -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib
Undefined first referenced
symbol in file
dconf_engine_dbus_call_sync_func engine/libdconf-engine.a(dconf-engine.c.o) (symbol scope specifies local binding)
dconf_engine_dbus_call_async_func engine/libdconf-engine.a(dconf-engine.c.o) (symbol scope specifies local binding)
ld: fatal: symbol referencing errors. No output written to gsettings/libdconfsettings.so
collect2: error: ld returned 1 exit status
[41/53] Linking target client/libdconf.so.1.0.0.
FAILED: client/libdconf.so.1.0.0
gcc -o client/libdconf.so.1.0.0 'client/client@@dconf@sha/dconf-client.c.o' -I/opt/local/include -I/opt/local/include/glib/glib-2.0 -I/opt/local/include/glib/gio-unix-2.0 -I/opt/local/lib/glib-2.0/include -I/usr/include -I/opt/local/include/freetype2 -I/opt/local/include/python3.7 -L/opt/local/gcc7/lib/gcc/x86_64-sun-solaris2.11/7.3.0 -L/opt/local/lib -L/usr/lib/amd64 -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,-soname,libdconf.so.1 -Wl,--whole-archive common/libdconf-common.a -Wl,--no-whole-archive -pipe -O2 -msave-args -mindirect-branch=thunk-inline -mfunction-return=thunk-inline -mindirect-branch-register -D_FORTIFY_SOURCE=2 -Wl,-R/opt/local/gcc7/lib/gcc/x86_64-sun-solaris2.11/7.3.0 -Wl,-R/opt/local/lib -Wl,-R/usr/lib/amd64 common/libdconf-common-hidden.a gdbus/libdconf-gdbus-thread.a engine/libdconf-engine.a gvdb/libgvdb.a shm/libdconf-shm.a -Wl,-R/opt/local/lib /opt/local/lib/libglib-2.0.so /opt/local/lib/libintl.so -Wl,-R/opt/local/lib /opt/local/lib/libgio-2.0.so /opt/local/lib/libgobject-2.0.so -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib -Wl,-R/opt/local/lib
Undefined first referenced
symbol in file
dconf_engine_dbus_call_sync_func engine/libdconf-engine.a(dconf-engine.c.o) (symbol scope specifies local binding)
dconf_engine_dbus_call_async_func engine/libdconf-engine.a(dconf-engine.c.o) (symbol scope specifies local binding)
ld: fatal: symbol referencing errors. No output written to client/libdconf.so.1.0.0
collect2: error: ld returned 1 exit status
The ordering here is the issue. gdbus/libdconf-gdbus-thread.a
appears before engine/libdconf-engine.a
, but it needs to come afterwards so that the unresolved symbols in libdconf-engine
can be resolved.
This is somewhat tricky to resolve, as there are recursive dependencies at play. gdbus
declares engine
as a dependency, and thus comes after it in the subdir ordering. Thus we cannot add engine
as a dependency for gdbus
and resolve it that way.
For now I have fixed the issue using the following patches:
--- client/meson.build.orig 2018-10-22 21:53:04.000000000 +0000
+++ client/meson.build
@@ -38,6 +38,7 @@ libdconf = shared_library(
soversion: soversion,
include_directories: top_inc,
dependencies: deps,
+ link_with: libdconf_engine,
c_args: dconf_c_args,
install: true,
)
--- gsettings/meson.build.orig 2018-10-22 21:53:04.000000000 +0000
+++ gsettings/meson.build
@@ -3,6 +3,7 @@
# symbols other than g_io_module_*
backend_deps = [
libdconf_common_hidden,
+ libdconf_engine,
libdconf_gdbus_thread,
]
With these patches I am able to get a successful build again on SmartOS. I'm very new to meson though, so it's possible there's a better way to achieve this.