HomePhabricator

build: add and use C_STANDARD and CXX_STANDARD in depends

Description

build: add and use C_STANDARD and CXX_STANDARD in depends

Summary:

By explicitly setting a C standard version we avoid any potential for issues/differences in libraries that may come about due to C STD version, as well as avoid potentially being opted into newer code / features in libraries when compiler defaults change (i.e as of 11.0.0, Clang now defaults to gnu17 over gnu11).

This should be a no-op for our release builds, because it's just explicitly setting the default that is already being used. However this is relevant for anyone building depends with a newer compiler.

I found one broken __STDC_VERSION__ check in the miniupnpc header.

At the same time, add CXX_STANDARD for setting our C++ standard, and use that over setting -std=c++17 for cxx packages.

Backport of core#22380.

We use gnu11 as a C standard because OpenSSL needs it and we can't override it without adding lots of maintenance.

Depends on D17210.

Test Plan: Run the GUIX builds

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D17211

Details

Provenance
fanquake <fanquake@gmail.com>Authored on Aug 31 2021, 05:34
FabienCommitted on Wed, Nov 27, 20:10
FabienPushed on Wed, Nov 27, 20:10
Reviewer
Restricted Project
Differential Revision
D17211: build: add and use C_STANDARD and CXX_STANDARD in depends
Parents
rABC42cd8a9cef4c: depends: cctools 986, ld64 711 & libtapi 1300.0.6.5
Branches
Unknown
Tags
Unknown