Issue 24623 - Rename version CppRuntime_Clang/Gcc to CppRuntime_libcxx/libstdcxx.
Summary: Rename version CppRuntime_Clang/Gcc to CppRuntime_libcxx/libstdcxx.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2024-06-22 09:40 UTC by johanengelen
Modified: 2024-06-30 11:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description johanengelen 2024-06-22 09:40:59 UTC
There is unfortunately an error in druntime CppRuntime version naming.

I think this arises from the wrong assumption that libstdc++ is bound to GCC and libc++ to clang. This is not the case. For those in the know, it is actually very confusing to read CppRuntime_Clang in the code. "What is that?!" Clang works with both libstdc++ and libc++ and it very much depends on the OS/installation/user which library is actually used.

I had to find this bit in d_do_test.d to learn what it stands for:

    version (CppRuntime_Gcc)
        envData.cxxCompatFlags = " -L-lstdc++ -L--no-demangle";
    else version (CppRuntime_Clang)
        envData.cxxCompatFlags = " -L-lc++ -L--no-demangle";
Ah, ok, so CppRuntime_Clang stands for libc++.

Please, please rename
CppRuntime_Gcc => CppRuntime_libstdcpp
CppRuntime_Clang => CppRuntime_libcpp

The -target option should be fixed similarly.
Comment 1 Dlang Bot 2024-06-22 09:45:03 UTC
@JohanEngelen updated dlang/dmd pull request #16610 "Rename CppRuntime_Clang/Gcc to CppRuntime_libcpp/libstdcpp https://issues.dlang.org/show_bug.cgi?id=24546 ." fixing this issue:

- Rename CppRuntime_Clang/Gcc to CppRuntime_libcpp/libstdcpp.
  Add libcpp and libstdcpp -target= option recognition.
  
  Fix bugzilla 24623 https://issues.dlang.org/show_bug.cgi?id=24623

https://github.com/dlang/dmd/pull/16610
Comment 2 Dlang Bot 2024-06-22 12:42:31 UTC
dlang/dmd pull request #16610 "Rename CppRuntime_Clang/Gcc to CppRuntime_libcpp/libstdcpp." was merged into master:

- 349b493810d9fe6f1997df93d23194589f170584 by Johan Engelen:
  Fix bugzilla issue 24623: Rename CppRuntime_Clang/Gcc to CppRuntime_libcpp/libstdcpp. Add libcpp and libstdcpp -target= option recognition.

https://github.com/dlang/dmd/pull/16610
Comment 3 johanengelen 2024-06-22 17:04:13 UTC
libcpp is the GCC C PreProcessing library).

libstdc++v3 refers to itself as (lib)stdcxx in code.
libc++ similarly.

Changed title of bug report: cpp --> cxx
Comment 4 Dlang Bot 2024-06-30 11:45:38 UTC
dlang/dmd pull request #16613 "Fix bugzilla issue 24623 followup." was merged into master:

- 988f31a2767417c4ccb595fce493835baa121e10 by Johan Engelen:
  Fix bugzilla issue 24623 followup.
  Rename CppRuntime to _LLVM and _GNU
  Also accept c++ for cxx in target string.

https://github.com/dlang/dmd/pull/16613