RE: built with gcc without gcc, can't get it!

From: Mark Millard <marklmi_at_yahoo.com>
Date: Tue, 27 Sep 2022 06:27:36 UTC
Nuno Teixeira <eduardo_at_freebsd.org> wrote on
Date: Tue, 27 Sep 2022 01:10:36 UTC :

> I've noticed something strange about deskutils/copyq that I can't
> understand and where is the problem so I can talk with upstream.
> It builds with clang, no gcc present and it links to libgcc_s.so.1.
> I've tested qt5 and qt6 flavors in 123{amd64,i386}, 131amd64 and 140amd64
> with same results.
> 
> (full log
> <https://people.freebsd.org/~eduardo/logs/copyq/131amd64_copyq-qt5-6.3.2.log>
> )
. . .
> The most strange is from where is "Shared library: [
> *libgcc_s.so.1*]" comes?

QUOTE
=>> Checking shared library dependencies
 0x0000000000000001 NEEDED               Shared library: [libICE.so.6]
 0x0000000000000001 NEEDED               Shared library: [libKF5Notifications.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5Core.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5DBus.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5Gui.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5Network.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5Qml.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5Svg.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5WaylandClient.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5Widgets.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5X11Extras.so.5]
 0x0000000000000001 NEEDED               Shared library: [libQt5Xml.so.5]
 0x0000000000000001 NEEDED               Shared library: [libSM.so.6]
 0x0000000000000001 NEEDED               Shared library: [libX11.so.6]
 0x0000000000000001 NEEDED               Shared library: [libXext.so.6]
 0x0000000000000001 NEEDED               Shared library: [libXfixes.so.3]
 0x0000000000000001 NEEDED               Shared library: [libXtst.so.6]
 0x0000000000000001 NEEDED               Shared library: [libc++.so.1]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x0000000000000001 NEEDED               Shared library: [libcxxrt.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgcc_s.so.1]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libwayland-client.so.0]
END QUOTE

So, two examples of needing libgcc_s.so.1 from the above
list are (not from a detailed match of your environment
but still suggestive):

# ldd /usr/lib/libc++.so.1
/usr/lib/libc++.so.1:
	libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x312e6618b000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x312e6575b000)
	libc.so.7 => /lib/libc.so.7 (0x312e61cf7000)

# ldd /lib/libcxxrt.so.1
/lib/libcxxrt.so.1:
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2a835b629000)
	libc.so.7 => /lib/libc.so.7 (0x2a8358f46000)

FreeBSD has its own libgcc_s.so.1 that is used sometimes,
even when no lang/gcc* port nor a system-gcc/g++ is involved.
This is normal for FreeBSD. The lang/gcc* ports provide their
own libgcc_s.so.1 instances but it takes -Wl,-rpath=. . .
use to cause bindings to the appropriate port's file instead
of using the FreeBSD one. On at least aarch64, FreeBSD's
libgcc_s.so.1 need not be sufficient for use by code generated
by a lang/gcc* compiler (C  or C++). The file from the port
may be required.

===
Mark Millard
marklmi at yahoo.com