I've ported our BC-XOM NWRFC application to several platforms now, but have run up against a wall on our AIX 5.3 system.
SAP Note 1056696 says
- AIX (64 bit)
xlC_r -DSAPonUNIX -DSAPwithUNICODE -D_AIX51 -D_LARGE_FILES -U__unix -q64 -DSAPwithTHREADS -qtbtable=full -qhalt=e -qalias=noansi -O -qstrict -qlibansi -qinlglue -DNDEBUG -qarch=pwr4 -qtune=balanced -qspill=2560 -DSAPonRS6000 -D__NO_XLC_BUILTIN_VA -E <program>.cpp> <program>.ii
/usr/bin/perl5 u16lit.pl -cpp -asciistring <program>. ii
xlC_r -DSAPonUNIX -DSAPwithUNICODE -D_AIX51 -D_LARGE_FILES -U__unix -q64 -DSAPwithTHREADS -qtbtable=full -qhalt=e -qalias=noansi -O -qstrict -qlibansi -qinlglue -DNDEBUG -qarch=pwr4 -qtune=balanced -qspill=2560 -DSAPonRS6000 -D__NO_XLC_BUILTIN_VA -c <program>.i
xlC_r -q64 -brtl -bnortllib -bloadmap:<program>.out -bmap:<program>.map -o <program> <program>.o libsapnwrfc.so libsapucum.so [and possibly libicudecnumber.so]
But this doesn't work. The compilation of our program fails because the preprocessor pass does not treat the cU() macro correctly. It looks as if it creates 16-bit unicode literals when it shouldn't. I had to add -DSAPwithoutUTF16_LITERALS to the first command to get the program to compile. I have to wonder if there are other options not set correctly.
Once past that hurdle, I was able to build an executable. The executable has a test option which simply invokes RfcGetVersion() and prints/logs the result. The idea is to show that the NWRFC libraries are installed correctly and available to the program. Alas, the program always gets a segmentation violation (SIGSEGV). Running it under truss I always see RfcGetVersion called, then for some reason, /etc/password is accessed. Then the program crashes:
...
setuid(0x0000000000000008) | = 0 |
getuidx(1) | = 8 |
getuidx(2) | = 8 |
test**********************************************
kwrite(1, " t e s t * * * * * * * *".., 51) | = 51 |
->libsapnwrfc.so:RfcGetVersion(0xfffffffffffcfa8, 0xfffffffffffcfa4, 0xfffffffffffcfa0)
getuidx(2) | = 8 |
open("/etc/passwd", O_RDONLY) | = 3 |
kioctl(3, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY
kfcntl(3, F_GETFD, 0x0000000000000000) | = 0 |
kfcntl(3, F_SETFD, 0x0000000000000001) | = 0 |
accessx("/etc/security/passwd", 04, 0) | Err#13 EACCES |
_getpid() | = 4706424 |
accessx("/etc/passwd", 04, 0) | = 0 |
statx("/etc/passwd", 0x0FFFFFFFFFFFB0B0, 176, 0) = 0
close(3) | = 0 |
Received signal #11, SIGSEGV [default] |
*** process killed ***
RfcGetVersion() is about as simple a function as one could ask for to test with. There is no unicode to mess with until the function gets back, so that is not the problem. The function never returns. I've played around with the link options but with no success. It always ends in a crash.
Anyone else seen this and maybe worked around it??
Thanks!
Rich
Aside: The SAP note does not provide settings for Solaris on X86_64.