在 2018/12/23 8:23, Maarten Verhage 写道:
> Then I build the makefile. The result of that is in the attachment 
> libcxx_build_result.txt. Would you be willing to check if these compile 
> warning look harmless? I didn't build libc++abi yet. Because I'm missing the 
> knowledge to see what role it has.
> 

I know little about LLVM so I don't have any comments. Sorry.  :|

> 
> But I cannot find a libc.a or a libm.a library files in the mingw64 builds 
> like x86_64-8.1.0-release-win32-seh-rt_v6-rev0 for example.
> 

Standard C functionality is provided by msvcrt, complemented by
libmingw32 and libmingwex. So neither libc nor libm exists.

These libraries are hard-coded in the builtin specs of GCC. Try this
command to get them:
```
gcc -dumpspecs | grep -P '(?<!\w)-l[^\s]+'
```

> My questions are:
> 
> What should I do to make this little program to link?
> Is there an internet resource where I can learn what all the mingw64 
> supplied static libraries are used for? Like libsupc++.a, libgcc_eh.a. And 
> where the standard C library is hidden?
> 

Probably there is, but most of these comes from my personal experience
(they may be wrong or outdated hence feel welcome to rectify):

GCC's builtin specs is hard-coded as string literals in one of its
source file. For mingw targets it is 'config/i386/mingw32.h'.

If static libraries are preferred (`-static` is passed to g++ during
linking) then libgcc is linked as `-lgcc_s -lgcc`; otherwise it is
linked as `-lgcc -lgcc_eh` (`_eh` probably stands for 'exception
handling'. This can be corroborated by examining symbols using `nm
--defined-only libgcc_eh.a`). Since you pass `-static` to g++ you need
`-lmingw32 -lgcc -lgcc_eh -lmingwex -lgcc -lgcc_eh -lmsvcrt` in this
order. Some code in libmingwex might reference symbols in libgcc so the
latter has to be duplicated.

`libsupc++` is the C++ support library that provides RTTI for
fundamental types, global `operator new` and `operator delete`
functions, thread-safe local static initialization, thread-local storage
support (emulated) etc. It is purely provided as a static library,
because libstdc++ has it encapsulated and if you want to link against
libsupc++ dynamically you will be linking against libstdc++.


> Thanks a lot for your time!
> 
> Best regards,
> Maarten Verhage 
> 

-- 
Best regards,
LH_Mouse

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to