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

Maarten Verhage via libcxx-dev libcxx-dev at lists.llvm.org
Fri Dec 28 04:09:40 PST 2018


Dear people,

I've got some help from the people of mingw64 to get libc++abi, libc++ and 
llvm to build with the mingw included gcc compiler. I was able to build 
libc++abi and libc++ with g++. The static library libc++.a did work with a 
little example program.

Then I was trying to get the shared version: libc++.dll to build with cmake. 
This didn't work. I have to say I'm pretty annoyed by the complexity and 
large makefile sizes using cmake. You can call me whatever you want about my 
decision to stop using cmake for this. Also I believe it's important that I 
for myself gain a better understanding of the building process.

Still experts here on the building process design this into cmake scripts 
and python scripts. But unfortunately in this way it is too complicated to 
fully understand this for myself so I can apply the knowledge into my own 
makefile. I do found files like flags.make and link.txt to provide parts of 
the g++ and ar calls to build the libraries. I hope to learn a bit more on 
specific flags and defines.

I started to make a straightforward mingw64 makefile to build the shared 
version of libc++abi. As I'm on Windows I believe _LIBCXXABI_FUNC_VIS should 
end up being __declspec(dllexport) but when I do a preprocess only on a file 
like cxa_personality.cpp I see _LIBCXXABI_FUNC_VIS end up being 
__attribute__((dllexport)). Somehow the file libc++abi.dll is build but it 
is just about 50 kB and llvm-readobj -coff-exports shows nothing.

My question is what kind of define or flag might have caused this to happen? 
And how can I correct it?

Attached is the makefile I currently have. Doesn't look great but you know 
I'm working on it.

Best regards,
Maarten 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.mak
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20181228/b44ae0d3/attachment.ksh>


More information about the libcxx-dev mailing list