Menu

#75 Pngcrush build error with ptrdiff_t when bulding with zlib-1.2.8

None
open
None
1
2017-06-03
2017-06-01
No

1.8.11 failed to build on x86 (works on x86_64)

Tested with Slackware 14.2, GCC 5.3.0, zlib-1.2.8

Build error:

gcc -c -DLIBPNG_UNIFIED  -I. -DNO_GZ -DPNGCRUSH_USE_ARM_NEON -DPNGCRUSH_USE_MPS_MSA -DPNGCRUSH_USE_INTEL_SSE -DPNG_INTEL_SSE -O3 -funroll-loops -fomit-frame-pointer pngcrush.c
gcc -c -DLIBPNG_UNIFIED  -I. -DNO_GZ -DPNGCRUSH_USE_ARM_NEON -DPNGCRUSH_USE_MPS_MSA -DPNGCRUSH_USE_INTEL_SSE -DPNG_INTEL_SSE -O3 -funroll-loops -fomit-frame-pointer adler32.c
In file included from adler32.c:8:0:
zutil.h:33:17: error: conflicting types for ptrdiff_t
    typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */
                 ^
In file included from zconf.h:247:0,
                 from zlib.h:34,
                 from zutil.h:22,
                 from adler32.c:8:
/usr/lib/gcc/i586-slackware-linux/5.3.0/include/stddef.h:149:26: note: previous declaration of ptrdiff_t was here
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
                          ^
Makefile:71: recipe for target 'adler32.o' failed
make: *** [adler32.o] Error 1

Discussion

  • Willy Sudiarto Raharjo

    Sorry, i forgot to put a title for this ticket

     
    • Glenn Randers-Pehrson

      No problem, I added one.

       
  • Glenn Randers-Pehrson

    • summary: , --> ,Pngcrush build error with ptrdiff_t
    • assigned_to: Glenn Randers-Pehrson
    • Group: -->
     
  • Glenn Randers-Pehrson

    Please try building with zlib-1.2.11.

     

    Last edit: Glenn Randers-Pehrson 2017-06-01
  • Glenn Randers-Pehrson

    • summary: ,Pngcrush build error with ptrdiff_t --> Pngcrush build error with ptrdiff_t when bulding with zlib-1.2.8
     
  • Willy Sudiarto Raharjo

    Hi Glenn,

    I'm afraid that's quite complicated in my situation.
    zlib is part of Slackware core packages, while pngcrush came in as third party application from SBo project and we have a strict rule that it should build on top of Slackware's core package.

    Patrick (Slackware maintainer) is very strict on introducing new version on -stable releases, except for security updates. Since there has been no security vulns report on zlib, i don't really think he would accept this proposal. Also, same code works in x86_64. It's architecture spesific.

    but i will try to build with zlib 1.2.11 for testing

     
  • Willy Sudiarto Raharjo

    I still got the same build failure message on zlib 1.2.11

     
    • Glenn Randers-Pehrson

      Thanks. I'll look into this.

       
  • Willy Sudiarto Raharjo

    Just FYI, i used this source: http://downloads.sourceforge.net/pmt/pngcrush-1.8.11.tar.xz
    some other distributions are using -nolib version

     
    • Glenn Randers-Pehrson

      Thanks again, that gives more to go on. That should be using the zutil.h that's included in the tar.xz distribution, so I wonder why you are seeing a conflict. Hmm, I see, it's conflicting with the system stddef.h which would be a zlib bug not a pngcrush bug. I'll follow up on that with the zlib dev.

       

      Last edit: Glenn Randers-Pehrson 2017-06-01
  • Willy Sudiarto Raharjo

    Hi Glenn

    one of SBo maintainer push this fix in the build script and it worked fine here

    sed -i '/typedef long ptrdiff_t;/s,long,__PTRDIFF_TYPE__,' zutil.h

    is it possible to change it in upstream code?

    thanks

     
  • Willy Sudiarto Raharjo

    The resulting code is

    #ifdef Z_SOLO
          typedef __PTRDIFF_TYPE__ ptrdiff_t;  /* guess -- will be caught if guess is wrong */
    #endif
    
     
  • Glenn Randers-Pehrson

    Thanks, I've reported this upstream and will patch pngcrush.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.