SourceForge has been redesigned. Learn more.
Close

#695 Change ZIP service to use zLib 1.2.5 instead of 1.2.3

closed-fixed
5
2011-10-11
2011-09-16
No

Change to use zlib V1.2.5 instead of zlib V1.2.3.

Building the ZIP service currently fails on Windows using zlib V1.2.5. A note was added to the STAF Developer's Guide per Bug #3406572 that says that STAF builds have only been tested using zLib V1.2.3 so this note can be changed when support is added for zlib V1.2.5.

Need to build and test on all platforms and update automated builds to use zlib V1.2.5 instead of V1.2.3.
May also need to update the zLib license in STAFInst and InstallAnywhere panels.

Discussion

  • Sharon Lucas

    Sharon Lucas - 2011-10-05

    Trying to build the zip project using zlib V1.2.5 on Windows (using STAF V3.4.7 source code), we get the following unresolved external symbol errors:

    /cygdrive/c/dev/sf/src/staf
    $ export ZLIB_SOURCEDIR=c:/tools/zlib-1.2.5
    $ make PROJECTS=zip
    find: `c:/tools/zlib-1.2.5/gzio.c': No such file or directory
    ...
    *** Compiling adler32.obj ***
    adler32.c
    *** Linking shared library STAFZlib.dll ***
    zlib.def : error LNK2001: unresolved external symbol gzbuffer
    zlib.def : error LNK2001: unresolved external symbol gzclearerr
    zlib.def : error LNK2001: unresolved external symbol gzclose
    zlib.def : error LNK2001: unresolved external symbol gzclose_r
    zlib.def : error LNK2001: unresolved external symbol gzclose_w
    zlib.def : error LNK2001: unresolved external symbol gzdirect
    zlib.def : error LNK2001: unresolved external symbol gzdopen
    zlib.def : error LNK2001: unresolved external symbol gzeof
    zlib.def : error LNK2001: unresolved external symbol gzerror
    zlib.def : error LNK2001: unresolved external symbol gzflush
    zlib.def : error LNK2001: unresolved external symbol gzgetc
    zlib.def : error LNK2001: unresolved external symbol gzgets
    zlib.def : error LNK2001: unresolved external symbol gzoffset
    zlib.def : error LNK2001: unresolved external symbol gzopen
    zlib.def : error LNK2001: unresolved external symbol gzprintf
    zlib.def : error LNK2001: unresolved external symbol gzputc
    zlib.def : error LNK2001: unresolved external symbol gzputs
    zlib.def : error LNK2001: unresolved external symbol gzread
    zlib.def : error LNK2001: unresolved external symbol gzrewind
    zlib.def : error LNK2001: unresolved external symbol gzseek
    zlib.def : error LNK2001: unresolved external symbol gzsetparams
    zlib.def : error LNK2001: unresolved external symbol gztell
    zlib.def : error LNK2001: unresolved external symbol gzungetc
    zlib.def : error LNK2001: unresolved external symbol gzwrite
    c:\dev\sf\rel\win32\staf\retail\lib\STAFZlib.lib : fatal error LNK1120: 24 unresolved externals
    LINK : fatal error LNK1141: failure during build of exports file
    make: *** [/cygdrive/c/dev/sf/rel/win32/staf/retail/lib/STAFZlib.dll] Error 2

     
  • Sharon Lucas

    Sharon Lucas - 2011-10-05

    To fix the unresolved externals errors when building the zip project on Windows using zlib V1.2.5, modified services/zip/makefile.zip and added the following to stafzlib_objs:
    gzclose, gzread, gzwrite, gzlib

     
  • Sharon Lucas

    Sharon Lucas - 2011-10-05
    • assigned_to: nobody --> slucas
     
  • Sharon Lucas

    Sharon Lucas - 2011-10-10

    Building the zip project using zlib V1.2.5 on Solaris x86 gets the following visibility attribute not supported warnings and error:

    ...
    *** Compiling zutil.o ***
    /opt/dev/autobuild/tools/zlib-1.2.5/zutil.c: In function `zcalloc':
    /opt/dev/autobuild/tools/zlib-1.2.5/zutil.c:308: warning: visibility attribute not supported in this configuration; ignored
    /opt/dev/autobuild/tools/zlib-1.2.5/zutil.c: In function `zcfree':
    /opt/dev/autobuild/tools/zlib-1.2.5/zutil.c:316: warning: visibility attribute not supported in this configuration; ignored
    *** Compiling uncompr.o ***
    *** Compiling trees.o ***
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c:1244: warning: visibility attribute not supported in this configuration; ignored
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c:1244: warning: visibility attribute not supported in this configuration; ignored
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c: In function `_tr_init':
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c:410: warning: visibility attribute not supported in this configuration; ignored
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c: In function `_tr_align':
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c:919: warning: visibility attribute not supported in this configuration; ignored
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c: In function `_tr_stored_block':
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c:883: warning: visibility attribute not supported in this configuration; ignored
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c: In function `_tr_flush_block':
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c:1020: warning: visibility attribute not supported in this configuration; ignored
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c: In function `_tr_tally':
    /opt/dev/autobuild/tools/zlib-1.2.5/trees.c:1071: warning: visibility attribute not supported in this configuration; ignored
    *** Compiling inftrees.o ***
    /opt/dev/autobuild/tools/zlib-1.2.5/inftrees.c: In function `inflate_table':
    /opt/dev/autobuild/tools/zlib-1.2.5/inftrees.c:330: warning: visibility attribute not supported in this configuration; ignored
    *** Compiling inflate.o ***
    *** Compiling inffast.o ***
    /opt/dev/autobuild/tools/zlib-1.2.5/inffast.c: In function `inflate_fast':
    /opt/dev/autobuild/tools/zlib-1.2.5/inffast.c:324: warning: visibility attribute not supported in this configuration; ignored
    *** Compiling infback.o ***
    *** Compiling gzclose.o ***
    *** Compiling gzread.o ***
    *** Compiling gzwrite.o ***
    *** Compiling gzlib.o ***
    /opt/dev/autobuild/tools/zlib-1.2.5/gzlib.c: In function `gz_error':
    /opt/dev/autobuild/tools/zlib-1.2.5/gzlib.c:518: warning: visibility attribute not supported in this configuration; ignored
    *** Compiling deflate.o ***
    *** Compiling crc32.o ***
    *** Compiling compress.o ***
    *** Compiling adler32.o ***
    *** Linking shared library libSTAFZlib.so ***
    ld: fatal: relocation error: R_386_GOTOFF: file /opt/dev/autobuild/build/obj/solaris/staf/retail/libs/zlib/trees.o: symbol _length_code: relocation must bind locally
    collect2: ld returned 1 exit status
    gmake: *** [/opt/dev/autobuild/build/rel/solaris/staf/retail/lib/libSTAFZlib.so] Error 1

    Googled and found out that the Solaris gcc compiler does not support the GNU C extension attribute, visibility (*hidden*), which is used by zlib 1.2.5. To fix this, I can change services/zip/makefile.zip to add compiler flag -DNO_VIZ when building zlib on Solaris.

     
  • Sharon Lucas

    Sharon Lucas - 2011-10-11

    Here's a diff of the additional changes to services/zip/makefile.zip to support building the zip project using zlib 1.2.5 on Solaris using the gcc compiler:

    Index: services/zip/makefile.zip

    RCS file: /cvsroot/staf/src/staf/services/zip/makefile.zip,v
    retrieving revision 1.4
    diff -r1.4 makefile.zip
    91c91,101
    < $(stafzlib_targets): CFLAGS := $(CC_EXPORT_SHARED_LIB_SYMBOLS)
    ---
    > $(stafzlib_targets): CFLAGS := $(CC_EXPORT_SHARED_LIB_SYMBOLS)
    >
    > # The Solaris gcc compiler does not support the GNU C extension attribute,
    > # visibility (*hidden*), which is used by zlib 1.2.5 source code. Setting
    > # the NO_VIZ compiler flag resolves this problem when building zlib on
    > # Solaris.
    >

     
  • Sharon Lucas

    Sharon Lucas - 2011-10-11

    CVS Diff of Changes

     
  • Sharon Lucas

    Sharon Lucas - 2011-10-11
    • status: open --> closed-fixed
     
  • Sharon Lucas

    Sharon Lucas - 2011-10-11

    Attached a file containing a cvs diff of all the changes needed to support zlib V1.2.5.
    Tested on all platforms supported by STAF.
    This feature will be in the next release of STAF (V3.4.8) currently planned for December 2011.

     
  • Sharon Lucas

    Sharon Lucas - 2011-10-11

    Updated the zLib license that is provided in the NOTICES.txt file that gets installed in the STAF root directory.

     

Log in to post a comment.