Skip to content

Conversation

@MartinNowak
Copy link
Member

@MartinNowak MartinNowak commented Oct 11, 2018

This blocks the upcoming 2.083 beta/release

  • mangling D's long/ulong as C++'s int64_t/uint64_t was reverted with 2.082
    due to breaking interop of C++'s and D's size_t/ptrdiff_t
  • this revert unveiled a mismatch in dmd's backend where the C++ side
    uses int64_t/uint64_t as targ_ptrdiff_t/targ_size_t while the D side
    uses long/ulong, thus 2.082 cannot compile dmd on OSX-64
  • fixed by using int64_t/uint64_t everywhere
  • druntime's int64_t/uint64_t are correctly mangled as
    long long/unsigned long long since OSX-64 2.079

Related:
long/ulong as int64_t/uint64_t approach #7416
reverted with #8285
druntime cpp_longlong/cpp_ulonglong definitions dlang/druntime#2187

- mangling D's long/ulong as C++'s int64_t/uint64_t was reverted with 2.082
  due to breaking interop of C++'s and D's size_t/ptrdiff_t
- this revert unveiled a mismatch in dmd's backend where the C++ side
  uses int64_t/uint64_t as targ_ptrdiff_t/targ_size_t while the D side
  uses long/ulong, thus 2.082 cannot compile dmd on OSX-64
- fixed by using int64_t/uint64_t everywhere
- druntime's int64_t/uint64_t are correctly mangled as
  long long/unsigned long long since on OSX-64 2.079
- due to relying on magic enums (cpp_ulonglong on OSX), plain
  comparison between targ_ullong and targ_llong is an error
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @MartinNowak!

Bugzilla references

Auto-close Bugzilla Severity Description
19300 major cpp_(u)long(long) types trigger enum comparison error

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#8823"

Copy link
Contributor

@jacob-carlborg jacob-carlborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please add a test for this?

@MartinNowak
Copy link
Member Author

MartinNowak commented Oct 11, 2018

Could we please add a test for this?

We don't have a self-hosting OSX test any longer, so no (#7721).
This PR is concerned with correctly using those interop types in dmd itself.
C++/D interop is already covered in existing tests.

@jacob-carlborg
Copy link
Contributor

This PR is concerned with correctly using those interop types in dmd itself.

Right.

@WalterBright WalterBright merged commit e533fff into dlang:master Oct 11, 2018
@MartinNowak MartinNowak deleted the fix_osx_cpp_interop branch August 30, 2022 06:02
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.

4 participants