|
|
Be aware of the following issues when implementing C++ drivers:
extern void x;Only the MOD_MISC_WRAPPER macro works correctly.
These wrapper macros are not needed in statically linked drivers, so one solution is to statically link any C++ driver.
A more elegant solution is to separate the invocation of the macros into a .c file and compile that with the C compiler, then link the resulting .o file with the rest of the driver.
DDI version 8 and ODDI drivers do not use these macros and so are not affected.
__vtbl__Q2__3std9type__info;The problem is that, even when compiled with the -Wf,--no_rtti option, the generated code for virtual functions references a class in the standard library typeinfo header. The class is defined in LibC.a:typeinfo.o, but extracting that library and linking it into the driver code would pull in a great deal of unnecessary code. For SVR5, just define the symbol; it will not actually be used as long as modules are compiled with the -Wf,--no_rtti option. When a dynamically-loadable module is provided to supply the necessary C++ runtime support routines, this definition will be included in that module to resolve this problem.