Skip to content

mcpp misdetects Fedora GCC 16.2.1 as GCC 3 with an explicit local toolchain #989

Closed

Description

@UsmanTariq2

On Fedora 45 x86_64, mcpp 2026.11.20.1 detects the system GCC as version 3 when I explicitly configure /usr as a local GCC toolchain. A generated hello_world project then fails because mcpp thinks the compiler is too old for import std;.
Steps to reproduce

  1. Run mcpp new hello_world on Fedora 45 with gcc-c++-16.2.1-3.fc45.x86_64 installed.
  2. Add the following to hello_world/mcpp.toml:
    [toolchain]
    default = { path = "/usr", family = "gcc" }
  3. From the project directory, run:
    MCPP_SYSROOT=glibc@system mcpp build --offline --cache=off --no-color
    Actual behavior
    Using toolchain gcc 3 ← /usr
    error: gcc 3 (x86_64-redhat-linux) has no C++ modules, which GCC provides from 14: src/main.cpp imports std.
    The system compiler reports:
    $ /usr/bin/g++ --version
    g++ (GCC) 16.2.1 20261029 (Red Hat 16.2.1-3)

$ /usr/bin/g++ -dumpfullversion
16.2.1

$ /usr/bin/g++ -dumpmachine
x86_64-redhat-linux
Expected behavior
mcpp should identify the explicitly selected Fedora compiler as GCC 16.2.1 and proceed with its normal import std checks. Querying GCC with -dumpfullversion may avoid misreading the distribution-specific version banner.
Workaround tested
In a scratch copy, a project-local wrapper returned a short version banner and normalized Fedora’s target name from x86_64-redhat-linux to x86_64-linux-gnu so mcpp would apply the native GNU/Linux sysroot settings. The wrapper forwarded all actual compile and link commands to /usr/bin/g++. With glibc@system and cxx_runtime = "host-coupled", hello_world compiled and ran using Fedora’s compiler and runtime.

Activity

  1. self-assigned this
    on Nov 21, 2026
  2. Sunrisepeak commented on Nov 21, 2026

    @Sunrisepeak
    Member

    I will fix it

  3. Sunrisepeak commented on Nov 21, 2026

    @Sunrisepeak
    Member

    try use "xlings update mcpp -y" update to latest version. then

    mcpp.toml

    [toolchain]
    default = "gcc@16.2"                    # the newest 16.2.x release
    # default = "xim:gcc@17.0.0-20261108"   # GCC's trunk of 2026-11-08 (experimental)
  4. UsmanTariq2 commented on Nov 22, 2026

    @UsmanTariq2
    Author

    Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions