i686-w64-mingw32-gcc -fstack-protector-strong
Yaakov Selkowitz
yselkowitz@cygwin.com
Fri Sep 8 22:34:00 GMT 2017
On 2017-09-08 16:08, Lee wrote:
> $ i686-w64-mingw32-gcc --version
> i686-w64-mingw32-gcc (GCC) 6.3.0
> Copyright (C) 2016 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> $ i686-w64-mingw32-gcc -fstack-protector-strong -o div.exe div.c
> $ ./div.exe
> C:/cygwin/home/Lee/t/div.exe: error while loading shared libraries: ?:
> cannot open shared object file: No such file or directory
> $ objdump -x ./div.exe | egrep -i "dll name"
> DLL Name: KERNEL32.dll
> DLL Name: msvcrt.dll
> DLL Name: libssp-0.dll
> $ ls -l /usr/i686-w64-mingw32/sys-root/mingw/bin/libssp-0.dll
> -rwxr-xr-x 1 root None 14336 Aug 17 08:26
> /usr/i686-w64-mingw32/sys-root/mingw/bin/libssp-0.dll
You created a MinGW executable which depends on other MinGW DLLs.
Therefore, either you have to tell it where to find its dependencies:
PATH="$(cygpath -S):$(cygpath
-W):/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH" \
./div.exe
Or, since you're only using GCC's libraries, just link with -static.
--
Yaakov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170908/5ff5ad67/attachment.sig>
More information about the Cygwin
mailing list