Weird linking problem on Windows

Sent to wrong list :confused:

This looks related to r229241. Thanks to Aaron Ballman for the tip.

The GCC-style clang++ driver defaults to enabling C++ exceptions, but those aren’t really supported on Windows. Disable them with -fno-exceptions, and the __cxa_call_unexpected error should go away. clang-cl doesn’t have this problem because it disables exceptions by default. This is a change in behavior since 3.5, but it’s a regression in a not-yet supported configuration, so I don’t consider it a release blocker.

The operator delete missing symbol has to do with some sized operator delete C++14 dust that hasn’t settled yet. We used to emit an implicit weak definition of sized operator delete, but that caused ELF linkers to pull in more static archive members causing link failures, so we recently stopped doing it. We should probably revert the default back to emitting a weak definition.

The GCC-style clang++ driver defaults to enabling C++ exceptions, but those
aren't really supported on Windows. Disable them with -fno-exceptions, and
the __cxa_call_unexpected error should go away. clang-cl doesn't have this
problem because it disables exceptions by default. This is a change in
behavior since 3.5, but it's a regression in a not-yet supported
configuration, so I don't consider it a release blocker.

Thanks that fixes it.

The operator delete missing symbol has to do with some sized operator delete
C++14 dust that hasn't settled yet. We used to emit an implicit weak
definition of sized operator delete, but that caused ELF linkers to pull in
more static archive members causing link failures, so we recently stopped
doing it. We should probably revert the default back to emitting a weak
definition.

Makes sense. Thanks for the explanation.

Hi again,

Hi again,

>> The operator delete missing symbol has to do with some sized operator
delete
>> C++14 dust that hasn't settled yet. We used to emit an implicit weak
>> definition of sized operator delete, but that caused ELF linkers to
pull in
>> more static archive members causing link failures, so we recently
stopped
>> doing it. We should probably revert the default back to emitting a weak
>> definition.
>
> Makes sense. Thanks for the explanation.

Larisse, any comment on this? It would be nice to unbreak c++14 on Windows.

It turns out that there is really no good way to make the weak definitions
option work reliably.
So, we are in a bit of a tough spot for now... You can still use the weak
definitions options with
"-Xclang -fdefine-sized-deallocation" or turn the feature off completely
with
"-Xclang -fno-sized-deallocation". A much better option is to link to a
library that actually
implements sized delete.
I understand that none of these options are ideal, but that's what we have
at the moment. :-/

-- Larisse.

Hi,