GNOME Bugzilla – Bug 676511
mkdir on win32 has only one parameter
Last modified: 2014-07-21 11:55:38 UTC
While cross compiling libxslt for mingw host I found that in libxslt/security.c mkdir() is used with two arguments which fails adding a line like this around line #41 #define mkdir(a,b) mkdir(a) fixes the problem
I can confirm this issue. With mingw32 (i586-mingw32msvc-gcc version 4.2.1) it builds, but warns with: CC security.lo security.c: In function 'xsltCheckWritePath': security.c:346: warning: implicit declaration of function 'mkdir' With mingw-w64 (i686-w64-mingw32-gcc or x86_64-w64-mingw32-gcc version 4.7.2) it does not build: make all-recursive make[1]: Entering directory `/vagrant/nokogiri/tmp/x86-mingw32/nokogiri/2.0.0/tmp/i686-w64-mingw32/ports/libxslt/1.1.28/libxslt-1.1.28' Making all in libxslt make[2]: Entering directory `/vagrant/nokogiri/tmp/x86-mingw32/nokogiri/2.0.0/tmp/i686-w64-mingw32/ports/libxslt/1.1.28/libxslt-1.1.28/libxslt' [...] CC security.lo security.c: In function 'xsltCheckWritePath': security.c:346:3: error: too many arguments to function 'mkdir' In file included from /home/vagrant/mingw/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/sys/stat.h:14:0, from security.c:18: /home/vagrant/mingw/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/io.h:267:15: note: declared here make[2]: *** [security.lo] Error 1 make[2]: Leaving directory `/vagrant/nokogiri/tmp/x86-mingw32/nokogiri/2.0.0/tmp/i686-w64-mingw32/ports/libxslt/1.1.28/libxslt-1.1.28/libxslt' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/vagrant/nokogiri/tmp/x86-mingw32/nokogiri/2.0.0/tmp/i686-w64-mingw32/ports/libxslt/1.1.28/libxslt-1.1.28' make: *** [all] Error 2 Attached you can find a patch to fix this.
Created attachment 256651 [details] [review] Fix mingw-w64 build This patch is used to build nokogiri for windows: https://github.com/sparklemotion/nokogiri/pull/976
Can I do something that makes it easier for you to review/merge this patch?
(In reply to comment #3) > Can I do something that makes it easier for you to review/merge this patch? hmm Are you asking me? because I am not an libxslt developer
Review of attachment 256651 [details] [review]: Patch looks OK. Whether the use of _MSC_VER || __MINGW32__ instead of _WIN32 is justified or not is an open question. Better ask libxslt maintainers about it.
Raising importance of the bug report since this is a compilation error.
Hum, indeed I hadn't seen it so far, patch looks fine, applied and pushed to git and pushed, https://git.gnome.org/browse/libxslt/commit/?id=ab5810bf27cd63b6914143d084f7cdb7d08b03da I will never see those as I never use windows or compile for it myself, thanks ! Daniel