[
https://issues.apache.org/jira/browse/XERCESC-2114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16371862#comment-16371862
]
Roger Leigh commented on XERCESC-2114:
--------------------------------------
Whatever this is, it's subtle and it affects more than this one inline
function. I tried
{{diff --git a/src/xercesc/util/PlatformUtils.hpp
b/src/xercesc/util/PlatformUtils.hpp }}
{{index 9f031f56e..0123ff12c 100644 }}
{{--- a/src/xercesc/util/PlatformUtils.hpp }}
{{+++ b/src/xercesc/util/PlatformUtils.hpp }}
{{@@ -804,9 +804,9 @@
XMLPlatformUtils::alignPointerForNewBlockAllocation(XMLSize_t ptrSize) }}
{{ // per-architecture basis. In the absense of that we }}
{{ // take an educated guess. }}
{{ #ifdef XML_PLATFORM_NEW_BLOCK_ALIGNMENT }}
{{- static const XMLSize_t alignment = XML_PLATFORM_NEW_BLOCK_ALIGNMENT; }}
{{+ const XMLSize_t alignment = XML_PLATFORM_NEW_BLOCK_ALIGNMENT; }}
{{ #else }}
{{- static const XMLSize_t alignment = (sizeof(void*) >= sizeof(double)) ?
sizeof(void*) : sizeof(double); }}
{{+ const XMLSize_t alignment = (sizeof(void*) >= sizeof(double)) ?
sizeof(void*) : sizeof(double); }}
{{ #endif }}
{{ }}
{{ // Calculate current alignment of pointer}}
along with addition of some of the compiler flags used by the old
solution/project files
{{/GF /GL /GS /Gy /Zc:forScope /Zc:inline /Zc:wchar_t /fp:precise}}
and it fixes the link error. I think the compiler flags are pointless; it's
the static const in the static inline method.
With this, it then fails with:
{{ome-common.lib(String.cpp.obj) : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned char * __cdecl
xercesc_3_2::ArrayJanitor<unsigned char>::release(void)"
(__imp_?release@?$ArrayJanitor@E@xercesc_3_2@@QEAAPEAEXZ) referenced in
function "public: static char * __cdecl
ome::common::xml::String::transcode(unsigned short const *)"
(?transcode@String@xml@common@ome@@SAPEADPEBG@Z)}}
i.e. in a different library; xalan now linked and this is a subsequent failure.
Not sure if it's related or separate.
What's really annoying with the alignment failure here is that it's not easily
reproducible. I can't reproduce it on my own system. I can't reproduce it on
the same system as a different user. It only happens within the environment of
a continuous integration build, which should be exactly the same. Maybe some
subtlety with compiler flags, but it means that there's some intrinsic
fragility we need to fix. The above patch should be sufficient, but I'm still
concerned about what the underlying problem is since I don't understand what's
at fault.
> Link failure with Xalan-C
> -------------------------
>
> Key: XERCESC-2114
> URL: https://issues.apache.org/jira/browse/XERCESC-2114
> Project: Xerces-C++
> Issue Type: Bug
> Components: Build
> Affects Versions: 3.2.0
> Environment: VS2013 on Windows Server 2012R2
> Reporter: Roger Leigh
> Assignee: Roger Leigh
> Priority: Major
>
> Testing latest rc1 with xalan and VS2013:
> [Build
> log|https://ci.openmicroscopy.org/view/Files/job/OME-FILES-CPP-DEV-merge-win-superbuild/VSARCH=x64,VSCONFIG=Release,VSVERSION=12,label=maxquant-ome/714/console]
> Using [this
> patch|https://raw.githubusercontent.com/ome/ome-cmake-superbuild/master/packages/xalan/patches/win-vc12.diff]
> to build Xalan with VS2013 (it's just the upgraded project files).
> {noformat}
> 12:29:32 (Link target) ->
> 12:29:32 XalanDiagnosticMemoryManager.obj : error LNK2001:
> unresolved external symbol "__declspec(dllimport) unsigned __int64 const
> `public: static unsigned __int64 __cdecl
> xercesc_3_2::XMLPlatformUtils::alignPointerForNewBlockAllocation(unsigned
> __int64)'::`2'::alignment"
> (__imp_?alignment@?1??alignPointerForNewBlockAllocation@XMLPlatformUtils@xercesc_3_2@@SA_K_K@Z@4_KB)
>
> [D:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xalan-source\c\Projects\Win32\VC12\AllInOne\AllInOne.vcxproj]
> 12:29:32 ..\..\..\..\Build\Win64\VC12\Release\Xalan-C_1_11.dll :
> fatal error LNK1120: 1 unresolved externals
> [D:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xalan-source\c\Projects\Win32\VC12\AllInOne\AllInOne.vcxproj]
> {noformat}
> Is there any incompatible change expected here? Could potentially be missing
> symbol exports or anything of that nature?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]