AIX mars 1 5 005A28AD4C00
Thread model: aix
gcc version 3.3.2
I am trying to build a popular open source cryptography library (crypto++ http://www.cryptopp.com/#download v5.5.2).
However, I get a warning message while compiling a CPP file (dll.cpp)
misc.h: In member function `const T& CryptoPP::Singleton<T, F, instance>::Ref()
const [with T = CryptoPP::DL_KeyAgreementAlgorithm_DH<CryptoPP::Integer,
CryptoPP::NoCofactorMultiplication>, F =
CryptoPP::NewObject<CryptoPP::DL_KeyAgreementAlgorithm_DH<CryptoPP::Integer,
CryptoPP::NoCofactorMultiplication> >, int instance = 0]':
dh.h:85: instantiated from `const CryptoPP::DL_KeyAgreementAlgorithm<typename GROUP_PARAMETERS::Element>& CryptoPP::DH_Domain<GROUP_PARAMETERS, COFACTOR_OPTION>::GetKeyAgreementAlgorithm() const [with GROUP_PARAMETERS = CryptoPP::DL_GroupParameters_GFP_DefaultSafePrime, COFACTOR_OPTION = CryptoPP::NoCofactorMultiplication]'
dh.h:92: instantiated from here
misc.h:121: warning: sorry: semantics of inline function static data `char
s_objectState' are wrong (you'll wind up with multiple copies)
The reference to misc.h (line 121) is in several places and I get many warning messages like that. I am going bonkers trying to figure out what this means and how to get rid of this.
I tried removing the static part from the variable initialization on line 121 and tried compiling the file using g++ -DNDEBUG -g -O2 -pipe -c dll.cpp
Now I dont get any warnings but the compiler is stuck there, it wont give any result now
Hi, this issue was solved after I removed static however, I have a new issue that seems to be AIX specific :
Just to summarize - I am using a cryptographic library called libcryptopp.a and building a wrapper around that library to access specific functions I need to use. The wrapper is in the form of a Shared Object so that I can call it from my legacy application.
I have libcryptopp.a and the functions in my wrapper (C++ program - aeswrap.cpp) are defined in the ".a" library. I am using the attached make file to build the Shared Object (libaes.so). However, when I try to call the function in my wrapper, I get a segmentation violation. It is worthwhile to mention that when I create an exe out of the same wrapper by statically linking it with libcryptopp.a it works fine.
I did a Truss on the file and these are the last few lines I got -
0509-151 The program does not have an entry point or
the o_snentry field in the auxiliary header is invalid.
kwrite(2, "\t 0 5 0 9 - 1 5 1 T h".., 115) = 115
_getpid() = 467000
lseek(3, 0, 1) = 4096
lseek(3, 4551, 0) = 4551
kread(3, "\t 0 5 0 9 - 1 9 4 E x".., 4096) = 454
0509-194 Examine file headers with the 'dump -ohv' command.
kwrite(2, "\t 0 5 0 9 - 1 9 4 E x".., 61) = 61
kfcntl(1, F_GETFL, 0x00000000) = 2
kfcntl(2, F_GETFL, 0x00000000) = 2
_exit(255)
I am stuck here and I dont know what I am doing wrong. Is the SO not being built correctly? I haave no clue what is to be done next. Just to debug I opened a file (FILE *fp) and noticed that the program exits after it encounters a particular function in the cpp program -
StringSource( PlainText.c_str() , true,
new StreamTransformationFilter( Encryptor,
new StringSink( CipherText )
) // StreamTransformationFilter
); // StringSource
This function is defined in the archive ".a" file.
I am just confused because it goes through when I make it into an exe? obviously there seems to be something wrong with the SO. Any help will be greatly appreciated.
It is something I've noticed about C++ progs - we can never get all the libraries whenever there is something STL related. If you use g++ or gcc or linking, the executable always works correctly. If you use ld, it sometimes works, but most of the time it comes up with a segv. If you run ldd on the exe, you'll find a whole load of stuff missing even though it links ok.
Be careful of -b in ld. Sun, AIX and gcc all have a -b parameter but the meaning and how it operates is different on all three.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.