From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129731 invoked by alias); 8 Sep 2017 23:10:25 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 129094 invoked by uid 89); 8 Sep 2017 23:10:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=you!! X-HELO: mail-it0-f46.google.com Received: from mail-it0-f46.google.com (HELO mail-it0-f46.google.com) (209.85.214.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Sep 2017 23:10:24 +0000 Received: by mail-it0-f46.google.com with SMTP id r131so228850itc.1 for ; Fri, 08 Sep 2017 16:10:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ji1UkDpZjgsB2gxX/MSBbBXUcLbwzxg5LQxCVJlrIp4=; b=m7Mm8yygDDsZhQO3bdlfFPtwcoN7YkmdEGdPJKcX5oNWh2Lzy8lT7rx+47zGJCjR8O vjrlLHDq5FmwzLsEmG/uy21C+PBUS/weWRdpjWTeIfml9ZoNL4dpz2yx5x11VAeOQu8M 7uOwRcKuDGIM7gPCrZDmfx7kuDs+dfd3AmfwMdG3IwuDoyeOz+2fM6T61dtOcbRWhdIh kTotYagvmzJQvMVLmN5xPQ1tvSPMcPfHJ4y4ZlTiutRxbnFfnfnzNQfYZhBQVrMNbYHx dnLQlIs9WnOurHcHEdzrq7KBmuw1Uda/LzKWGrCJIT/LD29OVwuktOz2zKMsQ1sASLXQ wtSA== X-Gm-Message-State: AHPjjUiCykLj3OURv/RTf78qqZhVKt+TzVQZDF5QGwBC6j/saX8AlcJW JkCcUb75thS4v8SM7By9vs4Y6GQRKvMamV97DOU= X-Google-Smtp-Source: AOwi7QDoJG/bXqgD3/WCyRx9qTBGGijix4B8LdlPlEe6MGYNNuW6n1ekDCpWKVYt600CBAYxRWO+GqyRa5w+Djoz4go= X-Received: by 10.36.121.85 with SMTP id z82mr3082848itc.87.1504912222082; Fri, 08 Sep 2017 16:10:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.184.1 with HTTP; Fri, 8 Sep 2017 16:10:21 -0700 (PDT) In-Reply-To: <4a702e1e-5ce1-175f-ca52-088dd21ef905@cygwin.com> References: <80ff03da-8e78-f52a-00ad-cf601bbf4e49@gmail.com> <75eecba1-f968-a596-778f-77bbd8bb5c59@gmail.com> <4a702e1e-5ce1-175f-ca52-088dd21ef905@cygwin.com> From: Lee Date: Fri, 08 Sep 2017 23:10:00 -0000 Message-ID: Subject: Re: i686-w64-mingw32-gcc -fstack-protector-strong To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00105.txt.bz2 On 9/8/17, Yaakov Selkowitz 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 >> 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. That was it. Thank you!! $ i686-w64-mingw32-gcc -static -fstack-protector-strong -o div.exe div.c $ ./div works $ i686-w64-mingw32-gcc -fstack-protector-strong -o div.exe div.c $ PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH ./div.exe works and follow up question if I may - what should I have read that would have told me that? Lee -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple