build: support modern toolchains (GCC 14, Boost 1.78+, C++14)#1395
Open
gburd wants to merge 1 commit into
Open
build: support modern toolchains (GCC 14, Boost 1.78+, C++14)#1395gburd wants to merge 1 commit into
gburd wants to merge 1 commit into
Conversation
OSv's master does not build on current toolchains. Two independent
breakages compound:
- Boost 1.78+ made boost::system header-only, so libboost_system.a
is no longer produced. The build hard-errored requiring it, and
Boost 1.87's lockfree headers use std::conditional_t, which needs
C++14.
- GCC 14 is stricter: core/mmu.cc's four-argument std::lower_bound
needs an explicit <algorithm> include, and Boost.Asio dropped the
long-deprecated io_service, resolver::query, mutable_buffers_1, and
address_v4::from_string APIs.
Changes:
- Default conf_cxx_level to gnu++14 (conf/base.mk, modules/common.gmk).
- Detect libboost_system only if present; never require it. Support
both nixpkgs (include/) and FHS (usr/include/) Boost layouts.
- Add <algorithm> to core/mmu.cc and core/pagecache.cc.
- Port Boost.Asio call sites to io_context, the range-returning
resolver::resolve, mutable_buffer, and make_address_v4
(loader.cc, core/dhcp.cc, tools/cpiod, modules/httpserver-api,
modules/cloud-init, modules/monitoring-agent, tests/*tcp*).
- Replace boost::math::isinf/isnan with std::isinf/isnan.
- Detect OpenSSL 3.x (libssl.so.3) in addition to 1.1, and fall back
to LD_LIBRARY_PATH when ldconfig is unavailable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OSv's master branch does not build on current toolchains. Two independent
breakages compound:
boost::systemheader-only, solibboost_system.aisno longer produced. The build hard-errors requiring it. Boost 1.87's
lockfree headers additionally use
std::conditional_t, which needs C++14.core/mmu.cc's four-argumentstd::lower_boundneedsan explicit
<algorithm>include, and Boost.Asio has removed thelong-deprecated
io_service,resolver::query,mutable_buffers_1, andaddress_v4::from_stringAPIs.I verified that master (8d2d4c8) fails to compile in both C++ modes on
GCC 14.3 / Boost 1.87:
gnu++11dies on Boost'sstd::conditional_t,gnu++14dies oncore/mmu.cclower_bound.Changes
conf_cxx_leveltognu++14(conf/base.mk,modules/common.gmk).libboost_systemonly if present; never require it. Support bothnixpkgs (
include/) and FHS (usr/include/) Boost layouts.<algorithm>tocore/mmu.ccandcore/pagecache.cc.io_context, range-returningresolver::resolve,mutable_buffer, andmake_address_v4(
loader.cc,core/dhcp.cc,tools/cpiod,modules/httpserver-api,modules/cloud-init,modules/monitoring-agent,tests/*tcp*).boost::math::isinf/isnanwithstd::isinf/isnan.libssl.so.3) in addition to 1.1, and fall back toLD_LIBRARY_PATHwhenldconfigis unavailable.Notes
musl 1.2.1, virtio-blk multi-queue, and OpenZFS 2.4.2. It is a prerequisite
for the musl PR (musl 1.2.1 cannot build on GCC 14 without these fixes).
Nix-specific (the Nix dev-env lives outside this PR).