[libcxx-dev] build issue on mingw gcc, need some help

Maarten Verhage via libcxx-dev libcxx-dev at lists.llvm.org
Thu Jan 10 14:23:21 PST 2019


> On Wed, 9 Jan 2019, Shoaib Meenai wrote:
>
>> Note that stdlib_exception.cpp and stdlib_new_delete.cpp already define 
>> _LIBCPP_BUILDING_LIBRARY. Perhaps stdlib_typeinfo.cpp should follow suit?
>
> Oh, indeed. Then that's definitely needed for the other stdlib_*.cpp as 
> well, in order to get dllexport defined for the symbols it generates.
>
> However, that isn't enough. Almost all source files in libcxxabi seem to 
> refer to std::terminate, which is implemented by libcxxabi itself. Thus, 
> the declaration of std::terminate shouldn't be marked dllimport anywhere 
> in any of the translation units.
>
> Therefore I suspect it'd be best to just define _LIBCPP_BUILDING_LIBRARY 
> for all of it.
>
> If there legitimately are functions that would need to be imported from 
> libcxx, they can be linked just fine via thunks, and data symbols should 
> be handled by the mingw specific auto-import mechanism.
>
> // Martin

Today I have been making progress in resolving undefined references for 
things that are declared by libc++ but defined in libc++abi. Including 
std::terminate. I strongly believe it is possible to get two shared 
libraries DLLs out of it with careful visibility preprocessor settings. In 
Linux you can also get two shared libraries right? I'm also motivated to see 
a smooth operation of the functionality of static libc++abi into the libc++ 
DLL. Like the builds of Martin.

If there is dissatisfaction against the ability of libc++ to have two DLLs 
under Windows I would like to know. I believe I read somewhere that libc++ 
should also be able to interoperate the gcc abi: libsupc++. when libc++abi 
is not used.

With some visibility tweaks I'm now getting the libc++abi.dll out of it. 
However I'm currently stuck on the following issue.

In libcxx there is stdexcept.cpp and in libcxxabi there is 
stdlib_stdexcept.cpp. A class like logic_error has the majority of its 
implementation in stdexcept.cpp but there are also some fragments in 
stdlib_stdexcept.cpp. I'm not able to get two DLLs from this spread 
implementation. It makes me wonder why there is stdlib_stdexcept.cpp in 
libc++abi? Would it be possible that a decision is made where this should 
end up?

Best regards,
Maarten Verhage 



More information about the libcxx-dev mailing list