Discussion:
[xmlsec] extra defines for static linking
Aleksey Sanin
2017-06-11 00:10:44 UTC
Permalink
Looks like XMLSEC_STATIC controls export on win32. Makes sense
that it is required. Merged.

Aleksey
Hi ,
Please find attahced patch 0002-extra-defines-for-static-linking.patch -
it resolves build configuration with --enable-static-linking . Tested
for x86_64-w64-mingw32 host.
For protocol build error is
CCLD xmlsec1.exe
.../apps/xmlsec.c:1172: undefined reference to `__imp_xmlSecDSigNs'
.../apps/xmlsec.c:1172: undefined reference to `__imp_xmlSecNodeSignature'
No idea why only -DXMLSEC_STATIC is enough to resolve issue.
strace shows
...
futex(0x7fc64a2ccc88, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(2,
\n",
) = 109
write(2,
"func=xmlSecKeyDataIdsRegister:file=keysdata.c:line=103:obj=aes:subj=xmlSecPtrListAdd:error=1:xmlsec
library function failed: \n",
126func=xmlSecKeyDataIdsRegister:file=keysdata.c:line=103:obj=aes:subj=xmlSecPtrListAdd:error=1:xmlsec
) = 126
write(2,
"func=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:file=dl.c:line=540:obj=aes:subj=xmlSecKeyDataIdsRegister:error=1:xmlsec"...,
155func=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:file=dl.c:line=540:obj=aes:subj=xmlSecKeyDataIdsRegister:error=1:xmlsec
) = 155
write(2,
"func=xmlSecOpenSSLInit:file=crypto.c:line=332:obj=unknown:subj=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:error=1:xmlse"...,
156func=xmlSecOpenSSLInit:file=crypto.c:line=332:obj=unknown:subj=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:error=1:xmlsec
) = 156
write(2, "Error: xmlSecCryptoInit failed\n", 31Error: xmlSecCryptoInit
failed
) = 31
write(2, "Error: xmlsec crypto intialization failed.\n", 43Error: xmlsec
crypto intialization failed.
) = 43
write(2, "Error: initialization failed\n", 29Error: initialization failed
) = 29
fstat(1, {st_mode=S_IFREG|0644, st_size=30364, ...}) = 0
...
Regards,
Roumen
P.S. It is more easy to post patch to mail list instead to open github
pull request.
_______________________________________________
xmlsec mailing list
http://www.aleksey.com/mailman/listinfo/xmlsec
Aleksey Sanin
2017-06-11 00:33:27 UTC
Permalink
I think LIBXML_STATIC and LIBXSLT_STATIC might also be required.
That's how Win32 build works for MSVC.

I am looking at the test failures -- it's the test script that
passes incorrect params for this case.

Aleksey
Hi ,
Please find attahced patch 0002-extra-defines-for-static-linking.patch -
it resolves build configuration with --enable-static-linking . Tested
for x86_64-w64-mingw32 host.
For protocol build error is
CCLD xmlsec1.exe
.../apps/xmlsec.c:1172: undefined reference to `__imp_xmlSecDSigNs'
.../apps/xmlsec.c:1172: undefined reference to `__imp_xmlSecNodeSignature'
No idea why only -DXMLSEC_STATIC is enough to resolve issue.
strace shows
...
futex(0x7fc64a2ccc88, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(2,
\n",
) = 109
write(2,
"func=xmlSecKeyDataIdsRegister:file=keysdata.c:line=103:obj=aes:subj=xmlSecPtrListAdd:error=1:xmlsec
library function failed: \n",
126func=xmlSecKeyDataIdsRegister:file=keysdata.c:line=103:obj=aes:subj=xmlSecPtrListAdd:error=1:xmlsec
) = 126
write(2,
"func=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:file=dl.c:line=540:obj=aes:subj=xmlSecKeyDataIdsRegister:error=1:xmlsec"...,
155func=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:file=dl.c:line=540:obj=aes:subj=xmlSecKeyDataIdsRegister:error=1:xmlsec
) = 155
write(2,
"func=xmlSecOpenSSLInit:file=crypto.c:line=332:obj=unknown:subj=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:error=1:xmlse"...,
156func=xmlSecOpenSSLInit:file=crypto.c:line=332:obj=unknown:subj=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:error=1:xmlsec
) = 156
write(2, "Error: xmlSecCryptoInit failed\n", 31Error: xmlSecCryptoInit
failed
) = 31
write(2, "Error: xmlsec crypto intialization failed.\n", 43Error: xmlsec
crypto intialization failed.
) = 43
write(2, "Error: initialization failed\n", 29Error: initialization failed
) = 29
fstat(1, {st_mode=S_IFREG|0644, st_size=30364, ...}) = 0
...
Regards,
Roumen
P.S. It is more easy to post patch to mail list instead to open github
pull request.
_______________________________________________
xmlsec mailing list
http://www.aleksey.com/mailman/listinfo/xmlsec
Aleksey Sanin
2017-06-11 00:53:35 UTC
Permalink
I fixed the --enable-static-linking -- it should imply no
dynamic loading for crypto libraries (kind of makes sense :) ):

https://github.com/lsh123/xmlsec/commit/b422875e66bfe7053ba61dc0e26b86386ea51850

Aleksey
Post by Aleksey Sanin
I think LIBXML_STATIC and LIBXSLT_STATIC might also be required.
That's how Win32 build works for MSVC.
I am looking at the test failures -- it's the test script that
passes incorrect params for this case.
Aleksey
Hi ,
Please find attahced patch 0002-extra-defines-for-static-linking.patch -
it resolves build configuration with --enable-static-linking . Tested
for x86_64-w64-mingw32 host.
For protocol build error is
CCLD xmlsec1.exe
.../apps/xmlsec.c:1172: undefined reference to `__imp_xmlSecDSigNs'
.../apps/xmlsec.c:1172: undefined reference to `__imp_xmlSecNodeSignature'
No idea why only -DXMLSEC_STATIC is enough to resolve issue.
strace shows
...
futex(0x7fc64a2ccc88, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(2,
\n",
) = 109
write(2,
"func=xmlSecKeyDataIdsRegister:file=keysdata.c:line=103:obj=aes:subj=xmlSecPtrListAdd:error=1:xmlsec
library function failed: \n",
126func=xmlSecKeyDataIdsRegister:file=keysdata.c:line=103:obj=aes:subj=xmlSecPtrListAdd:error=1:xmlsec
) = 126
write(2,
"func=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:file=dl.c:line=540:obj=aes:subj=xmlSecKeyDataIdsRegister:error=1:xmlsec"...,
155func=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:file=dl.c:line=540:obj=aes:subj=xmlSecKeyDataIdsRegister:error=1:xmlsec
) = 155
write(2,
"func=xmlSecOpenSSLInit:file=crypto.c:line=332:obj=unknown:subj=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:error=1:xmlse"...,
156func=xmlSecOpenSSLInit:file=crypto.c:line=332:obj=unknown:subj=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:error=1:xmlsec
) = 156
write(2, "Error: xmlSecCryptoInit failed\n", 31Error: xmlSecCryptoInit
failed
) = 31
write(2, "Error: xmlsec crypto intialization failed.\n", 43Error: xmlsec
crypto intialization failed.
) = 43
write(2, "Error: initialization failed\n", 29Error: initialization failed
) = 29
fstat(1, {st_mode=S_IFREG|0644, st_size=30364, ...}) = 0
...
Regards,
Roumen
P.S. It is more easy to post patch to mail list instead to open github
pull request.
_______________________________________________
xmlsec mailing list
http://www.aleksey.com/mailman/listinfo/xmlsec
_______________________________________________
xmlsec mailing list
http://www.aleksey.com/mailman/listinfo/xmlsec
Loading...