Skip to content

Verilator 5.048 fails to link executables on UCRT64 with GCC 16.1.0 #30048

@God-D-Usopp

Description

@God-D-Usopp

Description / Steps to reproduce the issue

Environment:

  • Windows 10 (MSYS_NT-10.0-22621)
  • MSYS2 UCRT64
  • Verilator 5.048-1
  • GCC 16.1.0-5

Installed packages:

mingw-w64-ucrt-x86_64-verilator 5.048-1
mingw-w64-ucrt-x86_64-gcc 16.1.0-5
mingw-w64-ucrt-x86_64-gcc-libs 16.1.0-5

Steps to reproduce:

  1. Open a UCRT64 shell.
  2. Create a simple SystemVerilog design and testbench.
  3. Run:

verilator --binary mealy_0100.sv tbmealy_0100.sv

Observed behavior:

Verilator successfully parses the design, generates C++ sources, and compiles generated C++ files. The failure occurs only during the final executable link stage.

The final link command shown is similar to:

g++ verilated.o verilated_timing.o verilated_threads.o Vmealy_0100__ALL.a -pthread -lpthread -latomic -o Vmealy_0100

The linker then reports multiple undefined references to std::__cxx11::basic_string symbols and exits with an error.

Additional observations:

The following command succeeds:

verilator --cc mealy_0100.sv

This indicates that parsing, elaboration, and C++ generation are functioning correctly.

screenshots:
command: verilator --version
output:
Image
command : g++ --version
output:

Image

Expected behavior

The command

verilator --binary mealy_0100.sv tbmealy_0100.sv

should successfully compile, link, and generate a runnable executable.

Since GCC and the C++ standard library are installed and functioning correctly, Verilator should be able to complete the final linking stage without unresolved C++ standard library symbols.

Actual behavior

The build proceeds through generated C++ compilation but fails during the final executable link stage.

Representative linker errors:

undefined reference to

std::__cxx11::basic_string<char,
std::char_traits,
std::allocator >::basic_string(...)

Multiple similar undefined references are reported.

The build terminates with:

collect2.exe: error: ld returned 1 exit status

Verilator then exits with:

%Error: 'make -C obj_dir -f Vmealy_0100.mk -j 1' exited with 2

on running:

command: verilator --binary mealy_0100.sv tbmealy_0100.sv
output:

Image

Additional diagnosis:
command: pacman -Q mingw-w64-ucrt-x86_64-verilator mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs
output:

Image

command: echo $PATH
output:

Image

command: echo $MSYSTEM
uname -a

ouptut:
Image

Verification

Windows Version

MINGW64_NT-10.0-19045

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANGARM64

Are you willing to submit a PR?

not at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions