Build fails on a clang/lld based system: ld.lld: error: undefined symbol: gtk_sensorstacho_new(GtkOrientation, unsigned int, SensorsTachoStyle)
In Gentoo Linux it's possible to use the clang/lld as system compiler instead of gcc/binutils.
Current stable 1.4.4 builds fine in Gentoo as long as gcc/binutils is used but fails to build with clang/lld:
[...]
clang++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../lib -DNDEBUG -DPACKAGE_LOCALE_DIR=\"/usr/share/locale\" -I/usr/include -I/usr/include/xfce4/libxfce4ui-2 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/json-c -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -I/usr/include/xfce4 -I/usr/include/xfce4/libxfce4panel-2.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/json-c -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -I/usr/include/xfce4 -O2 -march=bdver2 -mtune=bdver2 -pipe -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wmissing-declarations -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wformat -Wformat-security -Wformat-y2k -Winit-self -Wmissing-include-dirs -Wundef -Wredundant-decls -Wshadow -c -o xfce4_sensors-main.o `test -f 'main.cc' || echo './'`main.cc
LC_ALL=C /usr/bin/intltool-merge -d -u -c ../po/.intltool-merge-cache ../po xfce4-sensors.desktop.in xfce4-sensors.desktop
Found cached translation database
Merging translations into xfce4-sensors.desktop.
interface.cc:110:30: warning: 'xfce_titled_dialog_new_with_buttons' is
deprecated: Use xfce_titled_dialog_new_with_mixed_buttons() instead
[-Wdeprecated-declarations]
GtkWidget *xfce_dialog = xfce_titled_dialog_new_with_buttons(
^
/usr/include/xfce4/libxfce4ui-2/libxfce4ui/xfce-titled-dialog.h:76:15: note:
'xfce_titled_dialog_new_with_buttons' has been explicitly marked deprecated here
G_GNUC_MALLOC G_GNUC_DEPRECATED_FOR (xfce_titled_dialog_new_with_mixed_buttons());
^
/usr/include/glib-2.0/glib/gmacros.h:738:18: note: expanded from macro
'G_GNUC_DEPRECATED_FOR'
__attribute__((deprecated("Use " #f " instead"))) \
^
1 warning generated.
/bin/sh ../libtool --tag=CXX --mode=link clang++ -DPACKAGE_LOCALE_DIR=\"/usr/share/locale\" -I/usr/include -I/usr/include/xfce4/libxfce4ui-2 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/json-c -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -I/usr/include/xfce4 -I/usr/include/xfce4/libxfce4panel-2.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/json-c -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -I/usr/include/xfce4 -O2 -march=bdver2 -mtune=bdver2 -pipe -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wmissing-declarations -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wformat -Wformat-security -Wformat-y2k -Winit-self -Wmissing-include-dirs -Wundef -Wredundant-decls -Wshadow -Wl,-O1 -Wl,--as-needed -Wl,--as-needed -Wl,-z,pack-relative-relocs -o xfce4-sensors xfce4_sensors-actions.o xfce4_sensors-callbacks.o xfce4_sensors-interface.o xfce4_sensors-main.o ../lib/libxfce4sensors.la ../xfce4++/util/libxfce4util_pp.la -lsensors -lxfce4ui-2 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lxfce4util -lglib-2.0 -lm -lsensors
libtool: link: clang++ "-DPACKAGE_LOCALE_DIR=\"/usr/share/locale\"" -I/usr/include -I/usr/include/xfce4/libxfce4ui-2 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/json-c -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -I/usr/include/xfce4 -I/usr/include/xfce4/libxfce4panel-2.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/json-c -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -I/usr/include/xfce4 -O2 -march=bdver2 -mtune=bdver2 -pipe -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wmissing-declarations -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wformat -Wformat-security -Wformat-y2k -Winit-self -Wmissing-include-dirs -Wundef -Wredundant-decls -Wshadow -Wl,-O1 -Wl,--as-needed -Wl,--as-needed -Wl,-z -Wl,pack-relative-relocs -o .libs/xfce4-sensors xfce4_sensors-actions.o xfce4_sensors-callbacks.o xfce4_sensors-interface.o xfce4_sensors-main.o ../lib/.libs/libxfce4sensors.so ../xfce4++/util/.libs/libxfce4util_pp.a -lxfce4panel-2.0 -lgmodule-2.0 -lxfce4ui-2 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lxfce4util -lglib-2.0 -lm -lsensors -pthread -Wl,-rpath -Wl,/usr/lib/xfce4/modules
ld.lld: error: undefined symbol: gtk_sensorstacho_new(GtkOrientation, unsigned int, SensorsTachoStyle)
>>> referenced by actions.cc
>>> xfce4_sensors-actions.o:(refresh_tacho_view(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: gtk_sensorstacho_set_color(_GtkSensorsTacho*, char const*)
>>> referenced by actions.cc
>>> xfce4_sensors-actions.o:(refresh_tacho_view(xfce4::Ptr<t_sensors_dialog> const&))
>>> referenced by callbacks.cc
>>> xfce4_sensors-callbacks.o:(list_cell_color_edited_(_GtkCellRendererText*, char const*, char const*, xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: gtk_sensorstacho_set_text(_GtkSensorsTacho*, char const*)
>>> referenced by actions.cc
>>> xfce4_sensors-actions.o:(refresh_tacho_view(xfce4::Ptr<t_sensors_dialog> const&))
>>> referenced by callbacks.cc
>>> xfce4_sensors-callbacks.o:(list_cell_text_edited_(_GtkCellRendererText*, char*, char*, xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: gtk_sensorstacho_set_value(_GtkSensorsTacho*, double)
>>> referenced by actions.cc
>>> xfce4_sensors-actions.o:(refresh_tacho_view(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: init_widgets(xfce4::Ptr<t_sensors_dialog> const&)
>>> referenced by interface.cc
>>> xfce4_sensors-interface.o:(create_main_window(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: add_type_box(_GtkWidget*, xfce4::Ptr<t_sensors_dialog> const&)
>>> referenced by interface.cc
>>> xfce4_sensors-interface.o:(create_main_window(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: sensors_new(_XfcePanelPlugin*, char const*)
>>> referenced by main.cc
>>> xfce4_sensors-main.o:(main)
ld.lld: error: undefined symbol: sensor_get_value(xfce4::Ptr<t_chip> const&, unsigned long, bool*)
>>> referenced by actions.cc
>>> xfce4_sensors-actions.o:(refresh_view(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: format_sensor_value(t_tempscale, xfce4::Ptr<t_chipfeature> const&, double)
>>> referenced by actions.cc
>>> xfce4_sensors-actions.o:(refresh_view(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: reload_listbox(xfce4::Ptr<t_sensors_dialog> const&)
>>> referenced by actions.cc
>>> xfce4_sensors-actions.o:(refresh_view(xfce4::Ptr<t_sensors_dialog> const&))
>>> referenced by callbacks.cc
>>> xfce4_sensors-callbacks.o:(temperature_unit_change_(_GtkToggleButton*, xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: add_sensor_settings_box(_GtkWidget*, xfce4::Ptr<t_sensors_dialog> const&)
>>> referenced by interface.cc
>>> xfce4_sensors-interface.o:(create_main_window(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: gtk_sensorstacho_unset_color(_GtkSensorsTacho*)
>>> referenced by callbacks.cc
>>> xfce4_sensors-callbacks.o:(list_cell_color_edited_(_GtkCellRendererText*, char const*, char const*, xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: add_temperature_unit_box(_GtkWidget*, xfce4::Ptr<t_sensors_dialog> const&)
>>> referenced by interface.cc
>>> xfce4_sensors-interface.o:(create_main_window(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: add_update_time_box(_GtkWidget*, xfce4::Ptr<t_sensors_dialog> const&)
>>> referenced by interface.cc
>>> xfce4_sensors-interface.o:(create_main_window(xfce4::Ptr<t_sensors_dialog> const&))
ld.lld: error: undefined symbol: t_sensors_dialog::t_sensors_dialog(xfce4::Ptr<t_sensors> const&)
>>> referenced by main.cc
>>> xfce4_sensors-main.o:(main)
ld.lld: error: undefined symbol: free_widgets(xfce4::Ptr<t_sensors_dialog> const&)
>>> referenced by main.cc
>>> xfce4_sensors-main.o:(main)
ld.lld: error: undefined symbol: t_sensors_dialog::~t_sensors_dialog()
>>> referenced by main.cc
>>> xfce4_sensors-main.o:(std::__1::__shared_ptr_emplace<t_sensors_dialog, std::__1::allocator<t_sensors_dialog>>::__on_zero_shared())
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
Full build log attached. This is Gentoo downstream issue #832478.