Page MenuHomePhabricator

build: add and use C_STANDARD and CXX_STANDARD in depends
ClosedPublic

Authored by Fabien on Wed, Nov 27, 13:48.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCda8e9b682d65: 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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR22380
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31343
Build 62184: Build Diff
Build 62183: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Wed, Nov 27, 13:48

Not sure why we don't have the -flto flags related changes, but I see that these lines are removed anyway in core#29185

This revision is now accepted and ready to land.Wed, Nov 27, 14:18