how does Fiasco achieve C++ support

Adam Lackorzynski adam at os.inf.tu-dresden.de
Sat Jun 27 00:34:51 CEST 2015


On Fri Jun 26, 2015 at 22:44:07 +0800, Yuxin Ren wrote:
> You said Fiasco implements its own new/delete operator, could you show
> me where the code for those is?

There are several placement new's, for example in thread.cpp and
task.cpp. Just look for "operator new" in those files.

> In addition, does Fiasco modify the code of libstdc++, libsupc++ and libgcc?

Fiasco, the kernel, does not use libstdc++ nor libsupc++, and it also
does not modify libgcc as far as it is using it.

> I think inside those libraries, they may use locks. And we need to use
> the Fiasco's lock implementation, not Linux's.

Generally, libstdc++ does not depend on Linux, it can for example also
use pthreads internally.

> Another confusion comes from the local static object. In order to
> guarantee its constructor only run once, the compiler will insert
> lock around the constructor. but does the gcc know which lock
> implementation to use?

This is disabled by using -fno-threadsafe-statics.




Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/




More information about the l4-hackers mailing list