Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] Config.in: -fstack-protector-all needs PIE
Date: Tue, 29 Oct 2019 10:57:36 +0100	[thread overview]
Message-ID: <20191029095736.16586-1-fontaine.fabrice@gmail.com> (raw)

jpeg-turbo fails to build with BR2_SSP_ALL on:

/data/buildroot/buildroot-test/instance-0/output/host/opt/ext-toolchain/bin/../lib/gcc/aarch64_be-linux-gnu/7.3.1/../../../../aarch64_be-linux-gnu/bin/ld: ../CMakeFiles/simd.dir/jsimd_none.c.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC

Fix this issue by selecting BR2_PIC_PIE (if possible) with BR2_SSP_ALL

Fixes:
 - http://autobuild.buildroot.net/results/51459f3f26aa2e2a038ee717548266aaec05bafc

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 Config.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Config.in b/Config.in
index 010b0774e3..3efa171405 100644
--- a/Config.in
+++ b/Config.in
@@ -751,11 +751,18 @@ config BR2_SSP_STRONG
 
 config BR2_SSP_ALL
 	bool "-fstack-protector-all"
+	depends on BR2_SHARED_LIBS
+	depends on BR2_TOOLCHAIN_SUPPORTS_PIE
+	select BR2_PIC_PIE
 	help
 	  Like -fstack-protector except that all functions are
 	  protected. This option might have a significant performance
 	  impact on the compiled binaries.
 
+comment "-fstack-protector-all needs a toolchain w/ PIE"
+	depends on BR2_SHARED_LIBS
+	depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
+
 endchoice
 
 config BR2_SSP_OPTION
-- 
2.23.0

             reply	other threads:[~2019-10-29  9:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29  9:57 Fabrice Fontaine [this message]
2019-10-29 10:45 ` [Buildroot] [PATCH 1/1] Config.in: -fstack-protector-all needs PIE Matthew Weber
2019-10-29 11:12   ` Fabrice Fontaine
2020-09-05 20:18 ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191029095736.16586-1-fontaine.fabrice@gmail.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox