Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] toolchain/external: copy libssp.so if SSP is enabled
@ 2019-09-02  6:37 Yann Droneaud
  2019-09-02  6:37 ` [Buildroot] [PATCH 2/2] packages/sox: disable stack protector if SSP is not enabled Yann Droneaud
  2019-09-07 13:18 ` [Buildroot] [PATCH 1/2] toolchain/external: copy libssp.so if SSP is enabled Romain Naour
  0 siblings, 2 replies; 10+ messages in thread
From: Yann Droneaud @ 2019-09-02  6:37 UTC (permalink / raw)
  To: buildroot

Unlike libgcc_s.so, libssp.so is not copied on the target file
system. As it's available at link time, allowing packages such
as sox to be linked against the library.

As it's not copied, running programs linked against libssp.so
lead to failure such as the following:

  $ sox
  sox: error while loading shared libraries: libssp.so.0: cannot open shared object file: No such file or directory

  $ rec
  rec: error while loading shared libraries: libssp.so.0: cannot open shared object file: No such file or directory

If BR2_SSP_REGULAR, BR2_SSP_STRONG, or BR2_SSP_ALL is set, as
libssp.so provides __stack_chk_fail, and *_chk symbols, the
library must be copied to the target filesystem, like libgcc_s.so.

If BR2_SSP_NONE is set, there should be no need to copy it.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index c3ddff263fe9..175a87756437 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -114,6 +114,10 @@ endif
 
 TOOLCHAIN_EXTERNAL_LIBS += ld*.so* libgcc_s.so.* libatomic.so.*
 
+ifneq ($(BR2_SSP_NONE),y)
+TOOLCHAIN_EXTERNAL_LIBS += libssp.so.*
+endif
+
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
 TOOLCHAIN_EXTERNAL_LIBS += libc.so.* libcrypt.so.* libdl.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.*
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-09-23  9:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02  6:37 [Buildroot] [PATCH 1/2] toolchain/external: copy libssp.so if SSP is enabled Yann Droneaud
2019-09-02  6:37 ` [Buildroot] [PATCH 2/2] packages/sox: disable stack protector if SSP is not enabled Yann Droneaud
2019-09-07 13:38   ` Romain Naour
2019-09-09 19:54     ` Yann Droneaud
2019-09-07 13:18 ` [Buildroot] [PATCH 1/2] toolchain/external: copy libssp.so if SSP is enabled Romain Naour
2019-09-07 19:23   ` Thomas Petazzoni
2019-09-09 19:56     ` Yann Droneaud
2019-09-09 20:11   ` Yann Droneaud
2019-09-09 21:23     ` Romain Naour
2019-09-23  9:36       ` Yann Droneaud

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox