According to the GPL license, when a piece of software links to a GPLed library, the distributed binaries must be licensed under GPL.
The license says that derivative works need to be GPL-licensed.
Whether or not linking (and in which forms that happens) implies forming a derivative work is not really consistently answered by relevant court cases, even in the U.S., and let's not get started on the fact that there's more jurisdictions that the U.S.
I'd say that you'd be doing well playing it save, and assume the strictest interpretation (the FSF one), but if you have vested business interest in using a different interpretation, then you might be driven to other conclusions (which I don't necessarily share); there is more than one case of precedence for that working out well so far for the people doing it. I think the most prominent case might be Canonical (the Ubuntu company) shipping precompiled kernel modules of CDDL code (for ZFS support). So, because the GPL certainly isn't the best-written license out there, there's a lot of room for individual lawyers and judges to come to different conclusions.
There are some corner cases, for example when instead of linking directly, you use a system of plugins, as described here. https://www.gnu.org/licenses/gpl-faq.html#GPLPlugins
I personally do not share the opinion of the FSF here: if I write, say, a video editor program that has video effect plugins, then the video editor doesn't become a derivative work of the "replace video with blackness" GPL plugin that I might add. FSF's wording is pathologically vague; they argue through "complex data structures"; I'd call a Ethernet/IP/TCP/HTTP2/HTML5+JSON stream a "complex data structure", but it's the classical example for where it's OK to use a non-GPL program (a browser) with a GPL web server. "Complex" is an extremely relative term and has barely any normatively useful character.
There are also some loopholes that allow to use GPL software on cloud services, as the binaries are not distributed and they run on the cloud instance.
That's not a loop hole – that's intentional. The output of GPL programs were never meant to be mandatorily GPL-licensed.
What is the situation when distributing the software in two pieces? One piece (lets call it A) uses the GPL library, and therefore is licensed as GPL, and another piece (B) which is linked to the first using some kind of local network communication.
See the link I gave to the discussion what constitutes derivative works. I'd argue whether the method of linkage (static, dynamic linking, plugin derivative work, shared memory, network, printing-mailing-scanning…) has zero bearing on whether something constitutes a derivative work. Lawyers do argue the same way, but also the opposite way. It seems to be currently not court-settled in any relevant jurisdiction I'm aware of.