[xmlsec] Building xmlsec for iOs

84.le0n 84.le0n at gmail.com
Thu Aug 18 13:31:40 PDT 2011


Actually I'm not compiling for iOs but for simulator (i386 architecture) that runs on a pc, cross-compile for iOs (arm architecture) will be the next topic ;)

The only thing I want to do now is compile xmlsec using libs from sources, I don't know if all that options may conflict...have you never used all that options I use?

I don't know if I've to use the --with-lib..-src option during compiling, I've created all that libraries but I've executed "make install" too, so I don't know which option is more useful for me.

I don't understand about function name mangling...is there a separation like "underscore means private functions, otherwise are public functions" ? 
Inside source code I've not found any function starting with underscore, why the linker searches that symbols if they are not present nor called inside code? Is something related to your code or to the compilation process?

You're not familiar with compiling for iOS, but you can help me about your code ;)

Thank you for your help, and sorry for this long email ;) 



Il giorno 18/ago/2011, alle ore 16:50, Aleksey Sanin <aleksey at aleksey.com> ha scritto:

> Sorry, I am not familiar with iOS compilation so it is hard for me to say
> something definite but it looks like you there is a problem with function
> name mangling. 
> Aleksey
> 
> On 8/18/11 5:34 AM, 84.le0n wrote:
>> 
>> 
>> Hi all,
>> after some test now I get another error, during make phase.
>> 
>> These are the steps I've done, configuring for "build i386-apple-darwin10" and "host i686-apple-darwin10" (for iOs simulator included in SDK) :
>> 1) make of static libxml2.a (not using original libxml2.dylib because xmlsec requires newer version that that offered by Apple )
>> 2) using this libxml2.a static lib I've built a static libxslt.a , version 1.1.26
>> 3) then I've builded openssl libs (libcrypto.a and libssl.a), version 1.0.0.d
>> 4) the last is xmlsec version 1.2.18, configured as follow
>> 
>> ------------------ from here ------------------------
>> 
>> ./configure \
>>      --prefix=<destination_path> \
>>      --build=i386-apple-darwin10 \
>>      --host=i686-apple-darwin10 \
>>      --enable-static \
>>      --enable-static-linking \
>>      --disable-shared \
>>      --disable-crypto-dl \
>>      --disable-apps-crypto-dl \
>>      --disable-mscrypto \
>>      --without-nspr \
>>      --without-nss \
>>      --without-seamonkey-ver \
>>      --without-mozilla-ver \
>>      --without-gcrypt \
>>      --without-gnutls \
>>      --with-default-crypto=openssl \
>>      --with-libxml=<path_of_my_libxml2> \
>>      --with-libxslt=<path_of_my_libxslt> \
>>      --with-openssl=<path_of_my_openssl>
>> 
>> ------------------ to here ------------------------
>> 
>> The configuration runs without problems and finds my libs correctly, but doing make I get this error
>> 
>> ------------------ from here ------------------------
>> 
>> Undefined symbols:
>>   "_xmlSecOpenSSLAppDefaultKeysMngrInit", referenced from:
>>       _xmlSecAppCryptoSimpleKeysMngrInit in crypto.o
>>   "_xmlSecOpenSSLTransformDes3CbcGetKlass", referenced from:
>>       _xmlSecAppEncryptTmpl in xmlsec.o
>>   "_xmlSecOpenSSLAppKeysMngrCertLoad", referenced from:
>>       _xmlSecAppCryptoSimpleKeysMngrCertLoad in crypto.o
>>   "_xmlSecOpenSSLAppDefaultKeysMngrLoad", referenced from:
>>       _xmlSecAppCryptoSimpleKeysMngrLoad in crypto.o
>>   "_xmlSecOpenSSLAppDefaultKeysMngrSave", referenced from:
>>       _xmlSecAppCryptoSimpleKeysMngrSave in crypto.o
>>   "_xmlSecOpenSSLAppKeyLoad", referenced from:
>>       _xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad in crypto.o
>>       _xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad in crypto.o
>>   "_xmlSecOpenSSLShutdown", referenced from:
>>       _xmlSecAppCryptoShutdown in crypto.o
>>   "_xmlSecOpenSSLAppKeyCertLoad", referenced from:
>>       _xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad in crypto.o
>>   "_xmlCheckVersion", referenced from:
>>       _main in xmlsec.o
>>   "_xmlSecOpenSSLAppDefaultKeysMngrAdoptKey", referenced from:
>>       _xmlSecAppCryptoSimpleKeysMngrKeyGenerate in crypto.o
>>       _xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad in crypto.o
>>       _xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad in crypto.o
>>       _xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad in crypto.o
>>   "_xmlSecOpenSSLAppInit", referenced from:
>>       _xmlSecAppCryptoInit in crypto.o
>>   "_xmlSecOpenSSLTransformHmacSha1GetKlass", referenced from:
>>       _xmlSecAppSignTmpl in xmlsec.o
>>   "_xmlSecOpenSSLTransformSha1GetKlass", referenced from:
>>       _xmlSecAppSignTmpl in xmlsec.o
>>   "_xmlSecOpenSSLInit", referenced from:
>>       _xmlSecAppCryptoInit in crypto.o
>>   "_xmlSecOpenSSLAppGetDefaultPwdCallback", referenced from:
>>       _xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad in crypto.o
>>       _xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad in crypto.o
>>   "_xmlSecOpenSSLAppShutdown", referenced from:
>>       _xmlSecAppCryptoShutdown in crypto.o
>> ld: symbol(s) not found
>> collect2: ld returned 1 exit status
>> make[2]: *** [xmlsec1] Error 1
>> make[1]: *** [all-recursive] Error 1
>> make: *** [all] Error 2
>> 
>> 
>> ------------------ to here ------------------------
>> 
>> 
>> The strange thing is that I can't find these symbols with the underscore, but without initial underscore I can find many results, an example :
>> 
>> ------------------ from here ------------------------
>> --------------  without underscore -------------
>> $ grep -Rin xmlSecOpenSSLAppGetDefaultPwdCallback ./
>> Binary file ./xmlsec1-1.2.18/apps/crypto.o matches
>> ./xmlsec1-1.2.18/include/xmlsec/openssl/app.h:119:XMLSEC_CRYPTO_EXPORT void*              xmlSecOpenSSLAppGetDefaultPwdCallback(void);
>> ./xmlsec1-1.2.18/include/xmlsec/openssl/symbols.h:109:#define xmlSecCryptoAppGetDefaultPwdCallback    xmlSecOpenSSLAppGetDefaultPwdCallback
>> Binary file ./xmlsec1-1.2.18/src/openssl/.libs/libxmlsec1-openssl.a                 matches
>> ./xmlsec1-1.2.18/src/openssl/app.c:1531: * xmlSecOpenSSLAppGetDefaultPwdCallback:
>> ./xmlsec1-1.2.18/src/openssl/app.c:1538:xmlSecOpenSSLAppGetDefaultPwdCallback(void) {
>> ./xmlsec1-1.2.18/src/openssl/crypto.c:250:    gXmlSecOpenSSLFunctions->cryptoAppDefaultPwdCallback        = (void*)xmlSecOpenSSLAppGetDefaultPwdCallback();
>> Binary file ./xmlsec1-1.2.18/src/openssl/libxmlsec1_openssl_la-app.o matches
>> Binary file ./xmlsec1-1.2.18/src/openssl/libxmlsec1_openssl_la-crypto.o matches
>> 
>> 
>> --------------  with underscore -------------
>> $ grep -Rin _xmlsecopensslappgetdefault ./
>> Binary file ./xmlsec1-1.2.18/apps/crypto.o matches
>> Binary file ./xmlsec1-1.2.18/src/openssl/.libs/libxmlsec1-openssl.a                 matches
>> Binary file ./xmlsec1-1.2.18/src/openssl/libxmlsec1_openssl_la-app.o matches
>> Binary file ./xmlsec1-1.2.18/src/openssl/libxmlsec1_openssl_la-crypto.o matches
>> 
>> ------------------ to here ------------------------
>> 
>> Why I obtain this error ?
>> Where are defined that symbols with underscore ?
>> What can I do to correct this error ?
>> 
>> 
>> Thank you for your help!
>> 
>> 
>> 
>> _______________________________________________
>> xmlsec mailing list
>> xmlsec at aleksey.com
>> http://www.aleksey.com/mailman/listinfo/xmlsec
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aleksey.com/pipermail/xmlsec/attachments/20110818/916a54c4/attachment-0001.html>


More information about the xmlsec mailing list