undefined reference to `__memcpy_chk' while building Openslide

Jang, Jun H. jj2883 at cumc.columbia.edu
Sun Apr 12 23:37:37 EDT 2020


Hi, I am trying to build Openslide for Windows 10 64bit using Cygwin.

I have followed the instructions in ReadMe file and I am keep running into the same error while building libpng.

For Cygwin system, I currently have
x86_64-w64-mingw32-gcc g++ 9.2.0 (for both)
cmake 3.14.5
make 4.3

For python, I have python 3.7 (anaconda) installed on my system.

So my question is:

  1.  To build Openslide, do I need Python installed on my computer? If so, how do I specify an environment that Cygwin can work with?

  2.  From what I am searching online and seeing in the command prompt, it seems like its most likely due to a version issue with the package version of programs such as make, cmake, mingw64 gcc, etc. Can someone provide me with a working versions of each necessary programs?

  *   MinGW-w64 gcc and g++ for the target architecture (i686 or x86_64)
  *   NASM
  *   OpenJDK
  *   Apache Ant
  *   CMake
  *   gettext utility programs
  *   glib2 utility programs
  *   Native gcc and binutils for your build platform

  1.  If it is not due to program versions, then can someone help me how to fix this error I am encountering?

libtool: link: x86_64-w64-mingw32-gcc -static-libgcc -O2 -g -mms-bitfields -fexceptions -ftree-vectorize -static-libgcc -Wl,--enable-auto-image-base -Wl,--dynamicbase -Wl,--nxcompat -o .libs/png-fix-itxt.exe contrib/tools/png-fix-itxt.o -L/cygdrive/c/users/junhy/openslide2017/openslide-winbuild-20160612/64/root/lib -lz

libtool: link: /usr/bin/x86_64-w64-mingw32-nm -B .libs/png.o .libs/pngerror.o .libs/pngget.o .libs/pngmem.o .libs/pngpread.o .libs/pngread.o .libs/pngrio.o .libs/pngrtran.o .libs/pngrutil.o .libs/pngset.o .libs/pngtrans.o .libs/pngwio.o .libs/pngwrite.o .libs/pngwtran.o .libs/pngwutil.o | sed -n -e 's/^.[ ]([ABCDGIRSTW][ABCDGIRSTW])[ ][ ]([_A-Za-z][_A-Za-z0-9])$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /usr/bin/sed -e '/^[BCDGRS][ ]/s/.[ ]([^ ])/\1 DATA/;s/^.[ ]nm([^ ])[ ][^ ]/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/. //' | sort | uniq > .libs/libpng16.exp

libtool: link: if test DEF = "/usr/bin/sed -n -e 's/^[ ]*//' -e '/^\(;.*\)*$/d' -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' -e q .libs/libpng16.def" ; then cp .libs/libpng16.def .libs/libpng16-16.dll.def; else echo EXPORTS > .libs/libpng16-16.dll.def; cat .libs/libpng16.def >> .libs/libpng16-16.dll.def; fi
libtool: link: x86_64-w64-mingw32-gcc -static-libgcc -shared .libs/libpng16-16.dll.def .libs/png.o .libs/pngerror.o .libs/pngget.o .libs/pngmem.o .libs/pngpread.o .libs/pngread.o .libs/pngrio.o .libs/pngrtran.o .libs/pngrutil.o .libs/pngset.o .libs/pngtrans.o .libs/pngwio.o .libs/pngwrite.o .libs/pngwtran.o .libs/pngwutil.o -L/cygdrive/c/users/junhy/openslide2017/openslide-winbuild-20160612/64/root/lib -lz -O2 -g -mms-bitfields -Wl,--enable-auto-image-base -Wl,--dynamicbase -Wl,--nxcompat -o .libs/libpng16-16.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libpng16.dll.a

/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: .libs/pngrutil.o: in function memcpy': /usr/x86_64-w64-mingw32/sys-root/mingw/include/string.h:202: undefined reference to __memcpy_chk'

/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: .libs/pngwutil.o: in function memcpy': /usr/x86_64-w64-mingw32/sys-root/mingw/include/string.h:202: undefined reference to __memcpy_chk'

collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:869: libpng16.la] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: link: x86_64-w64-mingw32-gcc -static-libgcc -O2 -g -mms-bitfields -fexceptions -ftree-vectorize -static-libgcc -Wl,--enable-auto-image-base -Wl,--dynamicbase -Wl,--nxcompat -o .libs/png-fix-itxt.exe contrib/tools/png-fix-itxt.o -L/cygdrive/c/users/junhy/openslide2017/openslide-winbuild-20160612/64/root/lib -lz
make[1]: Leaving directory '/cygdrive/c/users/junhy/openslide2017/openslide-winbuild-20160612/64/build/libpng-1.6.22'
make: *** [Makefile:766: all] Error 2
Failed: make $parallel (line 401)

Also, in regards to the last line of error: Failed: make $parallel (line 401)

I have tried to change the number of parallels using -j 1 through 4, but it did not change the result.

I have also tried building with 2017 release version, 2016 version, 2015 version, but they all give me the same error.

In addition, I have tried to install Openslide in my windows linux subsystem (ubuntu16.04) and it worked fine.

Thank you in advance.
-Jun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20200413/99cfd692/attachment-0001.html>


More information about the openslide-users mailing list