GNOME Bugzilla – Bug 454388
improve mingw build (cross-compilation)
Last modified: 2009-08-23 17:02:32 UTC
This is patch that improve libxml mingw build that use GNU autotools and make it more compatible to existing win32 builds. Build is done with "gcc 3.4.5 (mingw special)". The patch is for version 2.6.27 but can be applied to 2.6.29. Changes: - ./configure.in - Sset flags for mingw build to enable modules, modules extention and ld flag "-avoid-version" is to create dll with name libxml2.dll instead of libxml2[versufix].dll where [versufix] is -2 for version info 8:27:6 (=8-6). - ./Makefile.am - Add XXX_EXTRA_LDFLAGS to testdso otherwise shared library isn't not created. Flag -no-undefined should present for win32 builds and for -avoid-version in case of mingw see above. - Remove $(EXEEXT) from test scripts. Libtool create wrapper script without .exe suffix. This script set paths needed to run exutable in .libs directory. If test script run directly program$(EXEEXT), program fail since cannot load shared libraries. - ./doc/devhelp/Makefile.am Changes are not related to mingw build. Modification fix problem when builddir != sourcedir. - ./error.c After modification error message will contain "input file name", "line number" and other information in case of mingw build. Lets see test case .build/xmllint --noout --relaxng ./test/relaxng/tutorA.rng ./test/relaxng/tutor9_5_2.xml Expacted first line in error message is: "./test/relaxng/tutor9_5_2.xml:1: element addressBook: Relax-NG validity error : Did not expect element addressBook there" Without modification the line is: "Did not expect element addressBook there" ,i.e. without file, line, (?), type(?). The pointer to function fprintf in shared library(dll) differ from pointer to same function in executable. This is true for mingw. If I remember well this is true for borland compiler since I/O stream function are part for CRT. It is posible in recent compiler versions this to be solved. I test Igors build (msc 13) and its is ok. I'm not sure that my modification is correct. I dont understand why should call channel if it differ from fprintf or xmlGenericErrorDefaultFunc. I think that comparison chanel == fprintf is not correct for win32 platform. It's seems to me that return is true only if dll and program are build with msc compiler. If dll is build with one compiler but program with other or both with gcc(mingw), borland and may other I expert result to be false. With patch above I'm able to run all tests under wine simulation and results are same as linux. I don't resolve one problems. When I run mingw build on win32 platform following test: "xmllint.exe --noout --relaxng .\tutorA.rng .\tutor9_5_2.xml" the error message is: ".%5Ctutor9_5_2.xml:1: element addressBook: Relax-NG validity error : Did not ex pect element addressBook there .\tutor9_5_2.xml fails to validate" , i.e. %5C instead \. Under wine error message is OK.
Created attachment 91319 [details] [review] proposed patch Patch can be applied to 2.6.29.
I don't think the patch can be applied as is. There are things which are likely to break other kind of Windows build (like the removal of $EXEEXT in the makefiles.am . The change to error.c looks also suspicious to me, even with your explanations. In general I can't comment on Windows build patches, and those have to be reviewed on the list where the people with windows expertise are listening. So please take the patch, post it on the list and this can be discussed there, but I can't apply a patch modifying Windows behaviour on my own since I have absolutely no way of testing. So I'm closing it as NOTGNOME, but please get this on the list, thanks, Daniel
Interesting status (RESOLVED) and resolution (NOTGNOME) !!!!
NO it's not WONTFIX as I do take patches but they must got to the list. It's NOTGNOME because it's not a normal gnome platform, most people looking at bugzilla.gnome.org are not interested in the Windows platform, which is why this must go to the list to be discussed with other people using libxml2 on Windows. Perfectly logical from my POV ! Daniel