On Fri, Aug 11, 2017 at 6:53 AM, Godmar Back godmar@gmail.com wrote:
In a recent github thread https://github.com/OP-TEE/optee_os/issues/1708#issuecomment-320245973 it was suggested that I ask this list about what the exact reasons for the lack of C++ support are, and how/if they break down by C++ feature so as to gauge a possible investment in remedying this situation at least partially.
Answering this question would required detailed knowledge of OP-TEE, and I doubt that anyone on this list has such knowledge. I was just reading some FAQs about OP-TEE myself.
I would guess that part of the problem is that libstdc++ is so large, and isn't designed to be pulled apart into small pieces, as there are a lot of features that interact with other features. Just running nm on libstdc++.so, and grepping for GLIBC_, I see that it calls 105 glibc functions. Some of these functions are I/O related and are obvious problems, like fopen, fclose, fread, fwrite. Some of them are clock related and could be an issue, like clock_gettime, gettimeofday. The string and memory routines are probably OK, but libstdc++ may be using more of them than OP-TEE implements. There are also a lot of wide-character and multi-byte character routines being used that may not be available. There are pthread related functions that may or may not be a problem. There are also some environment and locale related routines that are likely a problem, but maybe you can just provide a default environment and locale.
Otherwise, I don't know enough about OP-TEE to guess what might be a problem. The exception handling support just requires the ability to read your own process memory, including the stack, the unwind info, and the ELF headers that get loaded into memory at program start. I don't know if that is a problem for OP-TEE.
Jim