Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

druntime: Include core.stdcpp.* modules #3158

Merged
merged 3 commits into from
May 24, 2020
Merged

Conversation

kinke
Copy link
Member

@kinke kinke commented Sep 8, 2019

Fixes #3103.

@kinke
Copy link
Member Author

kinke commented Sep 9, 2019

How do you feel about the lib[std]c++ dependency? The upstream PR is dlang/druntime#2788.

@kinke
Copy link
Member Author

kinke commented May 6, 2020

Got back to this and reworked it to avoid C++ runtime dependencies. A few non-virtual functions are still declared only, but the D vtable should now be populatable (no more linker errors for the druntime test runners) and the D implementations (extern(D) mangling) shouldn't conflict with the C++ ones anymore.

Note that populating the D vtable with non-conflicting extern(D) implementations only works here because the virtual function signatures are trivial and should be ABI-compatible across C++ and D (edit: probably not for 32-bit x86, this passed in different registers IIRC...). An extern(D) virtual function with 2 params would already suffice to break this, as D callers would call the C++ implementation (if the vptr points to the C++ vtable, i.e., if the instance has been created on the C++ side) with reversed args.

@kinke
Copy link
Member Author

kinke commented May 17, 2020

Reworked with @weak extern(C++) for the 2 problematic core.stdcpp.{exception,typeinfo} modules, seems to work fine.

I've also ported druntime's stdcpp integration tests on Windows from DigitalMars make to GNU make, so that they are tested with LDC too. They take about 37 seconds on my box (not parallelized) and cover more modules than Posix hosts (e.g., core.stdcpp.vector is currently only supported for MSVC targets) and also test all 4 MSVC runtime flavors (static/dynamic, release/debug).

@kinke kinke changed the title [WIP] druntime: Include core.stdcpp.* modules druntime: Include core.stdcpp.* modules May 17, 2020
@kinke kinke merged commit c272c8b into ldc-developers:master May 24, 2020
@kinke kinke deleted the stdcpp branch May 24, 2020 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't exclude core.stdcpp.* from druntime library
1 participant