[Buildroot] [PATCH 2/3] package/libopenssl: add -latomic to libcrypto.pc when needed

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Jul 21 21:04:46 UTC 2023


Hello Bernd,

On Fri, 21 Jul 2023 20:06:37 +0200
Bernd Kuhls <bernd at kuhls.net> wrote:

> Without this patch openssl adds -latomic only to Libs.private in
> libcrypto.pc.

But this is exactly what's needed. If you add -latomic to Libs: it
means that libraries linking against openssl will also be linked with
libatomic, which is not needed. Libs.private ensures this will only
happen if we're static linking, which is what we want.

Let me sum up:

- With dynamic linking, we want libcrypto.so to be linked against
  libatomic.so. Anything linking against libcrypto.so has nothing to do.

- With static linking, anyone linking against libcrypto.a will need to
  link against libatomic.a as well, which is why it's important for
  libcrypto.pc to carry a Libs.private: -latomic.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com



More information about the buildroot mailing list