Originally posted by: haubi
Hi,
apologies if this is the wrong forum - have not seen a fix for this yet, and don't know better where to report such things.
There is a bug in [i]/usr/include/sys/thread.h[/i] of AIX oslevel [b]5.3.0.0[/b], which does not appear in AIX 5.2 an earlier.
Look at declaration of type 'thread_creds_t', actually being a variable-definition rather than a type-declaration, due to the missing keyword 'typedef'.
code /* Kernel view of thread credemtials structure (size-invariant) */
struct thread_credentials {
uint flags; /* Control structure data */
cred_ext_t cred; /* Credentials to be modified */
int reserved[9]; /* reserved fields for future */
} thread_creds_t;
[/code]This causes some very strange gcc-behaviour:
When there is more than one global constructor in a c++ project, then only one global object gets constructed.
The clue is that gcc seems to create only one global-constructor-entry per object file, giving it the mangled name of the first global object in the source.
So all object files having sys/thread.h compiled in, contain a global-constructor-entry of the same name, so only one of them gets collected (by gcc's collect2), and therefore only one is executed at program-startup.
As the type 'thread_creds_t' is introduced first with AIX 5.3, there is a simple workaround: Just define thread_creds_t to nothing, i.e. 'gcc -Dthread_creds_t='
If necessary, I have some sample to demonstrate the problem.
Thanks,
haubi
PS: If you need more information from the actual system, please give me the full commandline, i'm not an aix administrator...
#AIX-Forum