buildroot.buildroot.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Kuhls <bernd@kuhls.net>
To: buildroot@buildroot.org
Cc: Dick Olsson <hi@senzilla.io>, Fabio Urquiza <fabiorush@gmail.com>
Subject: [Buildroot] [PATCH 2/3] package/bitcoin: Fix build without SSP
Date: Sat, 18 Jul 2026 08:52:14 +0200	[thread overview]
Message-ID: <20260718065215.928877-2-bernd@kuhls.net> (raw)
In-Reply-To: <20260718065215.928877-1-bernd@kuhls.net>

Buildroot commit fabcd7c8cc44e7e03c68bfcd2b4e2d10331a93f6 bumped the
package from 28.0 to 30.0 which includes upstream commit
https://github.com/bitcoin/bitcoin/commit/a01cb6e63ff3940f0773b37e2fe1e148f17acad9
that was first included in version 29.0 and added among others
-fstack-protector-all to cxx_flags guarded with a new configure option
ENABLE_HARDENING which default to ON.

This commit causes build errors with toolchains with SSP support:

[ 44%] Linking CXX executable ../bin/bitcoin
/home/autobuild/autobuild/instance-40/output-1/host/lib/gcc/i686-buildroot-linux-musl/15.2.0/../../../../i686-buildroot-linux-musl/bin/ld:
 CMakeFiles/bitcoin.dir/bitcoin.cpp.o:
 in function `fs::PathToString(fs::path const&)':
bitcoin.cpp:(.text+0x4c):
 undefined reference to `__stack_chk_fail_local'

Upstream later removed the forementioned configure option with commit
https://github.com/bitcoin/bitcoin/commit/00ba3ba30341a9073049125334f176d6c05d1b54
that was first included in version 30.0 so we need to remove
-fstack-protector-all from CMakeLists.txt.

Fixes:
https://autobuild.buildroot.net/results/093/093253c79fed1c5b93decc3124e9ef4622168efe/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
Gitlab pipelines passed:
https://gitlab.com/bkuhls/buildroot/-/commits/8d17d8107a074b94d628061a3c18917987141483

 ...sts.txt-Don-t-force-fstack-protector.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/bitcoin/0002-CMakeLists.txt-Don-t-force-fstack-protector.patch

diff --git a/package/bitcoin/0002-CMakeLists.txt-Don-t-force-fstack-protector.patch b/package/bitcoin/0002-CMakeLists.txt-Don-t-force-fstack-protector.patch
new file mode 100644
index 0000000000..40370d1bf7
--- /dev/null
+++ b/package/bitcoin/0002-CMakeLists.txt-Don-t-force-fstack-protector.patch
@@ -0,0 +1,30 @@
+From 4d33b5bcc924c9271c40a19796f8316ba6aaa276 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd@kuhls.net>
+Date: Sat, 18 Jul 2026 08:10:21 +0200
+Subject: [PATCH] CMakeLists.txt: Don't force -fstack-protector
+
+This allows the environment to decide whether SSP should be used or
+not, for example to support toolchains that don't have SSP support.
+
+Upstream: N/A Buildroot specific
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 892f30d94b..93ccbf71ec 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -532,7 +532,6 @@ else()
+   unset(cxx_supports_fortify_source)
+ 
+   try_append_cxx_flags("-Wstack-protector" TARGET core_interface SKIP_LINK)
+-  try_append_cxx_flags("-fstack-protector-all" TARGET core_interface)
+   try_append_cxx_flags("-fcf-protection=full" TARGET core_interface)
+ 
+   if(MINGW)
+-- 
+2.47.3
+
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2026-07-18  6:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18  6:52 [Buildroot] [PATCH 1/3] package/bitcoin: Fix static link of libevent Bernd Kuhls
2026-07-18  6:52 ` Bernd Kuhls [this message]
2026-07-24 14:14   ` [Buildroot] [PATCH 2/3] package/bitcoin: Fix build without SSP Thomas Perale via buildroot
2026-07-18  6:52 ` [Buildroot] [PATCH 3/3] package/bitcoin: bump version to 31.1 Bernd Kuhls
2026-07-19 11:34 ` [Buildroot] [PATCH 1/3] package/bitcoin: Fix static link of libevent Julien Olivain via buildroot
2026-07-24 14:14 ` Thomas Perale via buildroot

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=20260718065215.928877-2-bernd@kuhls.net \
    --to=bernd@kuhls.net \
    --cc=buildroot@buildroot.org \
    --cc=fabiorush@gmail.com \
    --cc=hi@senzilla.io \
    /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;
as well as URLs for NNTP newsgroup(s).