diff mbox series

[v3,1/1] package/bitcoin: unset the NDEBUG flag

Message ID ZbTvPhursXFsHDblON1mtNTQnG937Il2N0wYa3ReI@cp4-web-037.plabs.ch
State Accepted
Headers show
Series [v3,1/1] package/bitcoin: unset the NDEBUG flag | expand

Commit Message

D. Olsson June 13, 2021, 6:45 p.m. UTC
Since https://git.buildroot.net/buildroot/commit/?id=5a8c50fe05afacc3cbe8e7347e238da9f242fab0
all packages are now built with NDEBUG, which broke Bitcoin builds.

Bitcoin is using assert(...) extensively with the assumption of it
never being a noop at runtime. So we cannot build with NDEBUG.
See: https://github.com/bitcoin/bitcoin/blob/0.21/src/compat/assumptions.h

Signed-off-by: Dick Olsson <hi@senzilla.io>

---

Revision 2:

- Fixed review item by Yann
- Properly include all target flags

Revision 3:

- Fixed tab indentation
---
 package/bitcoin/bitcoin.mk | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Yann E. MORIN June 13, 2021, 7:58 p.m. UTC | #1
Dick, All,

On 2021-06-13 18:45 +0000, Dick Olsson via buildroot spake thusly:
> Since https://git.buildroot.net/buildroot/commit/?id=5a8c50fe05afacc3cbe8e7347e238da9f242fab0
> all packages are now built with NDEBUG, which broke Bitcoin builds.
> 
> Bitcoin is using assert(...) extensively with the assumption of it
> never being a noop at runtime. So we cannot build with NDEBUG.
> See: https://github.com/bitcoin/bitcoin/blob/0.21/src/compat/assumptions.h
> 
> Signed-off-by: Dick Olsson <hi@senzilla.io>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
> 
> Revision 2:
> 
> - Fixed review item by Yann
> - Properly include all target flags
> 
> Revision 3:
> 
> - Fixed tab indentation
> ---
>  package/bitcoin/bitcoin.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/bitcoin/bitcoin.mk b/package/bitcoin/bitcoin.mk
> index 5f1684879c..409c9a61c9 100644
> --- a/package/bitcoin/bitcoin.mk
> +++ b/package/bitcoin/bitcoin.mk
> @@ -13,6 +13,12 @@ BITCOIN_CPE_ID_VENDOR = bitcoin
>  BITCOIN_CPE_ID_PRODUCT = bitcoin_core
>  BITCOIN_DEPENDENCIES = host-pkgconf boost libevent
>  BITCOIN_MAKE_ENV = BITCOIN_GENBUILD_NO_GIT=1
> +# Bitcoin is using assert(...) extensively with the assumption of it
> +# never being a noop at runtime. So we cannot build with NDEBUG.
> +BITCOIN_CONF_ENV = \
> +	CPPFLAGS="$(TARGET_CPPFLAGS) -UNDEBUG" \
> +	CFLAGS="$(TARGET_CFLAGS) -UNDEBUG" \
> +	CXXFLAGS="$(TARGET_CXXFLAGS) -UNDEBUG"
>  BITCOIN_CONF_OPTS = \
>  	--disable-bench \
>  	--disable-wallet \
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
D. Olsson June 14, 2021, 10:06 a.m. UTC | #2
Hi Yann,

On Sunday, June 13th, 2021 at 9:58 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:

>> Signed-off-by: Dick Olsson hi@senzilla.io
> Applied to master, thanks.
>
> Regards,
> Yann E. MORIN.

Should we apply this to the 'next' branch as well?
The bitcoin build is currently broken there.
But I'm not sure exactly how the 'master' and 'next'
branches are managed?

Cheers,
D. Olsson
Yann E. MORIN June 14, 2021, 4:21 p.m. UTC | #3
Dick, All,

On 2021-06-14 10:06 +0000, D. Olsson spake thusly:
> On Sunday, June 13th, 2021 at 9:58 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >> Signed-off-by: Dick Olsson hi@senzilla.io
> > Applied to master, thanks.
> Should we apply this to the 'next' branch as well?
> The bitcoin build is currently broken there.

Branch 'next' is closed; it has been merged back into master with commit
8d07baab43, dated 2021-06-07.

> But I'm not sure exactly how the 'master' and 'next'
> branches are managed?

https://buildroot.org/downloads/manual/manual.html#RELENG

Regards,
Yann E. MORIN.
diff mbox series

Patch

diff --git a/package/bitcoin/bitcoin.mk b/package/bitcoin/bitcoin.mk
index 5f1684879c..409c9a61c9 100644
--- a/package/bitcoin/bitcoin.mk
+++ b/package/bitcoin/bitcoin.mk
@@ -13,6 +13,12 @@  BITCOIN_CPE_ID_VENDOR = bitcoin
 BITCOIN_CPE_ID_PRODUCT = bitcoin_core
 BITCOIN_DEPENDENCIES = host-pkgconf boost libevent
 BITCOIN_MAKE_ENV = BITCOIN_GENBUILD_NO_GIT=1
+# Bitcoin is using assert(...) extensively with the assumption of it
+# never being a noop at runtime. So we cannot build with NDEBUG.
+BITCOIN_CONF_ENV = \
+	CPPFLAGS="$(TARGET_CPPFLAGS) -UNDEBUG" \
+	CFLAGS="$(TARGET_CFLAGS) -UNDEBUG" \
+	CXXFLAGS="$(TARGET_CXXFLAGS) -UNDEBUG"
 BITCOIN_CONF_OPTS = \
 	--disable-bench \
 	--disable-wallet \