This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to support C++ in a new OS


Hi,

I have read the docs about how to port the libstdc++ and I know more
about it now.
But in the docs, it does not talk much about the thread/mutex stuff.
My system has thread and locking support, so how can I change the
library to use our own mechanism?
I find gcc uses some gthread_* stuff. How does gthread_* functions
interact with libsupc++ and libgcc?

I have two more questions.
1. Does libsupc++ have dependency on other parts of gcc? And can I
make libsupc++ a standalone library?
2. The entire libstdc++ library is too huge for me now. I only need a
few classes in the STL. Can I only port only a few classes in
libstdc++?
     And are there any light weight or smaller STL libraries?

Thanks a lot!
Yuxin

On Tue, Jun 23, 2015 at 6:47 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 23 June 2015 at 17:47, Yuxin Ren <ryx@gwmail.gwu.edu> wrote:
>> Thank you all so much!
>>
>> Our target OS will use the same hardware architecture (x86_32) and
>> object format.
>> I do not want to run gcc on the target OS.
>> Our OS has thread and lock support.
>> Currently we have outdated dietlibc in our system, and we maybe going
>> to port musl libc.
>> Are those C libraries sufficient? If not, which C library are needed?
>
> They should be sufficient, I'm not sure though.
>
>> I have some further questions.
>> 1. What is the functionality of libstdc++ and libsupc++? What is the
>> relationship between them? I see libsupc++ is a sub-directory of
>> libstdc++, this confuses me a bit.
>
> Libsupc++ is a subset of libstdc++, it provides just the basic runtime
> environment (exception handling, run-time type identification, dynamic
> memory allocation/deallocation).
>
> Libstdc++ provides the complete C++ standard library, including I/O,
> containers, algorithms, threading etc.
>
>
>> 2. It looks like libgcc and libsupc++ are important. In order to port
>> them to our OS, how much and where do I have to modify? And after
>
> Have you read the docs?
>
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/internals.html
>
>
>> porting them, can I guide gcc to link them properly just using command
>> line options without recompile gcc?
>
> They are part of gcc, it always links with the versions installed
> alongside the compiler.
>
>> 3. For somethings such as vectors, which library they depend on?
>
> Libstdc++, but mostly just its headers not the shared library, because
> std::vector is a template.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]