The libreoffice port revision 7.0.1.2 fails to link canvasdemo [...] [build LNK] Executable/canvasdemo S=/usr/obj/ports/usr/ports/editors/libreoffice/work/libreoffice-7.0.1.2 && I=$S/instdir && W=$S/workdir && c++ -pthread -Wl,-z,origin '-Wl,-rpath,$ORIGIN/../Library' -Wl,-rpath-link,$I/program -fstack-protector-strong -Wl,-rpath-link,/lib:/usr/lib -Wl,-z,combreloc -Wl,--hash-style=gnu -Wl,-Bsymbolic-functions -L$W/LinkTarget/StaticLibrary -L$I/sdk/lib -L$I/program -L$I/program -L$W/LinkTarget/Library -L/usr/local/lib -Wl,-rpath,/usr/local/lib -fstack-protector-strong -L/usr/local/lib $W/CxxObject/canvas/workben/canvasdemo.o -Wl,--start-group $W/LinkTarget/StaticLibrary/libvclmain.a $W/LinkTarget/StaticLibrary/libglxtest.a -lm -lX11 -Wl,--end-group -Wl,--no-as-needed -lbasegfxlo -lcomphelper -luno_cppu -luno_cppuhelpergcc3 -ltllo -luno_sal -luno_salhelpergcc3 -lvcllo -o $W/LinkTarget/Executable/canvasdemo /usr/obj/ports/usr/ports/editors/libreoffice/work/libreoffice-7.0.1.2/instdir/program/libskialo.so: undefined reference to `XGetXCBConnection' c++: error: linker command failed with exit code 1 (use -v to see invocation) [...] Shouldn't -lX11-xcb be used instead of -lX11?
Just wanted to make sure, do you use the default options or there are some customized settings?
Created attachment 217980 [details] Ports configuration tree of the affected host (A)
Created attachment 217981 [details] Ports configuration tree of the unaffected host (B)
I attempted two installations of lo on two different hosts with two different outcomes: one for which the failure is reported above (host A); one on which the port was successfully installed (host B). For both hosts I attached the full ports configuration tree. Host A runs 11-STABLE (rev 365447), host B runs 12-STABLE (rev 360207).
Bumped into something like this when building LibreOffice master: Failed to load /home/arr/libreoffice_build/instdir/program/libsofficeapp.so: /usr/home/arr/libreoffice_build/instdir/program/libskialo.so: Undefined symbol "XGetXCBConnection" % ldd /usr/home/arr/libreoffice_build/instdir/program/libskialo.so /usr/home/arr/libreoffice_build/instdir/program/libskialo.so: libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x800674000) libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1 (0x80073e000) libz.so.6 => /lib/libz.so.6 (0x80078c000) libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x8016fa000) libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x8007a8000) libuno_sal.so.3 => /usr/home/arr/libreoffice_build/instdir/program/libuno_sal.so.3 (0x8017a4000) libc++.so.1 => /usr/lib/libc++.so.1 (0x801861000) libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x801933000) libm.so.5 => /lib/libm.so.5 (0x801956000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x8007e7000) libthr.so.3 => /lib/libthr.so.3 (0x801989000) libc.so.7 => /lib/libc.so.7 (0x800263000) libbz2.so.4 => /usr/lib/libbz2.so.4 (0x8019b6000) libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x8019cc000) I guess, this library should be linked to libxcb.so or something.
This needs patching: ./external/skia/Library_skia.mk:98 ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_libs,skia,\ -lm \ -ldl \ -lX11-xcb \ -lX11 \ )) endif How does one express or in GNU Make?
(In reply to Gleb Popov from comment #6) There is not explicit or operator but, for the same effect, you can use something like this: ifneq ($(filter OS1 OS2 OSn, $(OS)),) ... endif
(In reply to Bertrand Petit from comment #7) Thanks, that indeed fixed the problem with my build. However, our Ports tree already carries such patch: https://github.com/freebsd/freebsd-ports/blob/main/editors/libreoffice/files/patch-external_skia_Library__skia.mk The problem should be fixed by now. Can we close this?
This issue is obviously fixed and closable.