Regarding undefined reference to `__memcpy_chk' while building

Kishore Babu kishutvn at gmail.com
Fri Sep 11 17:02:44 EDT 2020


Hi,
The errors are due to fortify not been part of build script, either add
lssp to build or set fortify level as zero , sample script modifications

modify build.sh script from line number 762-765 as shown below
*original :*
cppflags="-D_FORTIFY_SOURCE=2"
cflags="-O2 -g -mms-bitfields -fexceptions -ftree-vectorize ${arch_cflags}"
cxxflags="${cflags}"
ldflags="-static-libgcc -Wl,--enable-auto-image-base -Wl,--dynamicbase
-Wl,--nxcompat"

*modified:*
cppflags="-D_FORTIFY_SOURCE=0"
cflags="-O2 -g -mms-bitfields -fexceptions -ftree-vectorize ${arch_cflags}"
 cxxflags="${cflags}"
 ldflags="-static-libgcc -Wl,--enable-auto-image-base -Wl,--nxcompat"

It can solve those build errors, but please review them as per their
documentation.

Regards,
Kishore
+91-9740804765

On Sat, Sep 12, 2020 at 1:23 AM <
openslide-users-request at lists.andrew.cmu.edu> wrote:

> Send openslide-users mailing list submissions to
>         openslide-users at lists.andrew.cmu.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users
> or, via email, send a message with subject or body 'help' to
>         openslide-users-request at lists.andrew.cmu.edu
>
> You can reach the person managing the list at
>         openslide-users-owner at lists.andrew.cmu.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of openslide-users digest..."
>
>
> Today's Topics:
>
>    1. OpenSlide in Linux-based Docker container running .Net Core
>       (Gerry Suggitt)
>    2. undefined reference to `__memcpy_chk' while building
>       Openslide (Jang, Jun H.)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 6 Apr 2020 18:44:48 +0000
> From: Gerry Suggitt <grsuggitt at hotmail.com>
> To: "openslide-users at lists.andrew.cmu.edu"
>         <openslide-users at lists.andrew.cmu.edu>
> Subject: OpenSlide in Linux-based Docker container running .Net Core
> Message-ID:
>         <
> YTXPR0101MB1824867EBC9AB890F5671D22B5C20 at YTXPR0101MB1824.CANPRD01.PROD.OUTLOOK.COM
> >
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I need to use OpenSlide in a Linux-based Docker Container.
> I have developed the application on Windows targeting .Net Core and it
> works when I launch it on my Windows machine.
>
> I have created the Docker Container but when I try to load the Windows x64
> DLLs fromOpenSlide I get a "Bad IL format" error.
>
> I thought I could install the Debian version as I create the container but
> the command:
> RUN apt-get install openslide-tools
> gets the error:
> Unable to locate package openslide-tools
> The command '/bin/sh -c apt-get install openslide-tools' returned a
> non-zero code: 100
>
> I am a n00b so please forgive me.
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20200406/67087738/attachment.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Mon, 13 Apr 2020 03:37:29 +0000
> From: "Jang, Jun H." <jj2883 at cumc.columbia.edu>
> To: "openslide-users at lists.andrew.cmu.edu"
>         <openslide-users at lists.andrew.cmu.edu>
> Subject: undefined reference to `__memcpy_chk' while building
>         Openslide
> Message-ID:
>         <
> BYAPR02MB4230528445867BEB8AC059E385DD0 at BYAPR02MB4230.namprd02.prod.outlook.com
> >
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> openslide-users mailing list
> openslide-users at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users
>
>
> ------------------------------
>
> End of openslide-users Digest, Vol 119, Issue 1
> ***********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20200912/3d9aea16/attachment-0001.html>


More information about the openslide-users mailing list