[poppler] Poppler provided printf() functions on Windows not language compliant

William Bader williambader at hotmail.com
Mon Mar 7 01:52:29 UTC 2016


> jazzynico posted a version as an attachment for message 6 here:
> 
>     https://bugs.launchpad.net/inkscape-devlibs/+bug/1552913

I forgot to add to the previous email that "nm libpoppler-58.dll | grep vfprintf | sort -u" returns
6a2df964 T ___mingw_vfprintf
6a300388 T _vfprintf
6a300388 t .text$vfprintf
6a7f1d48 N .debug_frame$vfprint
and nm shows a sequence
6a2df33c T ___main
6a2e2f78 t ___mbrtowc_cp
6a2df4cc T ___mingw_TLScallback
6a2e1084 T ___mingw_pformat
6a2df938 T ___mingw_snprintf
6a2df964 T ___mingw_vfprintf
6a2df998 T ___mingw_vprintf
6a2dfbb4 T ___mingw_vsnprintf
6a2df9d0 T ___mingw_vsprintf
I think that these are all part of the mechanics of creating a dll with COFF. The symbols are too close together to have any significant amount of code. I think that one of the differences between ELF and COFF is that ELF dedicates a cpu register to support position independent code. At least on unix, COFF shared objects have to be preconfigured to load at a fixed address. You have to make stubs with import modules for each library (which might be one reason that some maintainers complain whenever a poppler release changes the external API of libpoppler). "nm libpoppler-58.dll" has a section of links to import stubs. The lines below are an example. "I" means an indirect reference.
6a3c56f0 I __imp__cos
6a3c56f4 I __imp__exit
6a3c56f8 I __imp__fclose
6a3c56fc I __imp__fflush
6a3c5700 I __imp__fgetc
6a3c5704 I __imp__fgetpos
6a3c5708 I __imp__floor
It looks like libpoppler is requesting all of the *printf functions from mingw but the rest of stdio from msvcrt.
The link below says that mingw replaces the stdio libraries because the msvcrt versions are not ANSI compatible and that you can force the msvcrt versions by compiling with -D__USE_MINGW_ANSI_STDIO=0 or by not using compile options like -ansi or -posix that set __STRICT_ANSI__,
Maybe the devlib people recently changed the compile options that they use to build poppler.
http://mingw-users.1079350.n2.nabble.com/mingw-vfprintf-question-td5445899.html
William


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20160306/ce877f55/attachment.html>


More information about the poppler mailing list