Static link on AIX with pthread
I've been reading and researching this for a couple of days now, and decided I needed outside help!
(and this site seemed like a nice place, so I thought I'd post my question here and see how it goes)
our small company hasn't built our applications on AIX for several years and I was assigned this task (good one I like the challenge).
the problem I am having is easy to describe and I can see other people experiencing it too, although I cannot seem to find the answer.
if I link the application "not static", that is, I do not use "-static", in the build commands the application works fine in development but not on our other AIX machine that we are using for testing.
[quick notes on two cars;
Dev:
~$ uname -a
AIX aix3 2 5 000BA50D4C00
Test:
~$ uname -a
AIX aix4 1 5 002459A64C00
]
if I refer to "-static" the application "breaks" at runtime on the development machine when an exception is thrown:
terminate called after throwing an instance of 'MyAppError'
Segmentation fault (core dumped)
And (as if that weren't enough), the application still won't run on the test machine:
exec(): 0509-036 Cannot load program ./myapp because of the following errors:
0509-130 Symbol resolution failed for myapp because:
0509-136 Symbol _sigqueue (number 65) is not exported from
dependent module /unix.
0509-136 Symbol ra_attachrset (number 95) is not exported from
dependent module /unix.
0509-136 Symbol __rs_pickmcm (number 99) is not exported from
dependent module /unix.
0509-136 Symbol _timer_create (number 122) is not exported from
dependent module /unix.
0509-136 Symbol _timer_delete (number 123) is not exported from
dependent module /unix.
0509-136 Symbol _timer_getoverrun (number 124) is not exported from
dependent module /unix.
0509-136 Symbol _timer_gettime (number 125) is not exported from
dependent module /unix.
0509-136 Symbol _timer_settime (number 126) is not exported from
dependent module /unix.
0509-136 Symbol count_event_waiters (number 159) is not exported from
dependent module /unix.
0509-192 Examine .loader section symbols with the
'dump -Tv' command.
I should note here that we are linking with "-pthead" and I have read several articles that say that it is not okay to link statically when using pthread.
my brain hurts.
I would be very grateful for any input on this.
source to share
Part of your problem is that you are building on AIX 5.2 and trying to test AIX 5.1 (info uname -a
shows that - thanks for including it). You can usually use an older platform and work on a newer one, but not vice versa. So this is the beginning of your problems.
Both AIX 5.1 and 5.2 are long in the tooth; you must be at least AIX 5.3 and possibly AIX 6.x.
source to share