This is the mail archive of the
mailing list for the Cygwin project.
Re: i686-w64-mingw32-gcc -fstack-protector-strong
On 9/8/17, Yaakov Selkowitz <firstname.lastname@example.org> wrote:
> 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
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>> $ 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
> 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" \
> Or, since you're only using GCC's libraries, just link with -static.
That was it. Thank you!!
$ i686-w64-mingw32-gcc -static -fstack-protector-strong -o div.exe div.c
$ i686-w64-mingw32-gcc -fstack-protector-strong -o div.exe div.c
$ PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH ./div.exe
and follow up question if I may - what should I have read that would
have told me that?
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple