delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/09/08/19:10:36

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=bprdrau
50VU/jgJI50dCHTvOvjrB/ZKcizZe5FFFsxcpfuUNKZ2/0xSe2b88XjQRc29QVnf
28FRjHHLkmy4W4gZFG9snIqvS1vpnpq0Ra8S0uDjCPmcWwB9ftgvZ42RCYqdscRH
Gve6D0TZYH0vZmSdR4x1o9boJ1LG1ZLSlVdA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; s=default; bh=BH1otUyjqI19u
SGR95sVUl3xqpY=; b=IjMFDVBIjI0Jk2kpedHM2lvYnCNC1U7adTPRD6phF6jfD
jTqX6eVfzXO8t3/nj161Sy03OOHKckzfZWamg9PrZUvclxSGVazxUikBwX6TS9M5
AcSCLltGBPPjqVXtcX+FF/CO2Vy4b9sciiCiPdH/yWIciQzMyZSNhgZJbGCJPM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
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
In-Reply-To: <4a702e1e-5ce1-175f-ca52-088dd21ef905@cygwin.com>
References: <CAD8GWsusnJQk_Z42o966BUwaFHedZ4xnEvBC7AcEtWe=K0ioKg AT mail DOT gmail DOT com> <b7878d31-389b-2d73-b988-34db0b926efb AT gmail DOT com> <CAD8GWsu53ZtB5exta8vmpAJZiNsvAi2xKK0KKctq-hiaW5Fsfw AT mail DOT gmail DOT com> <80ff03da-8e78-f52a-00ad-cf601bbf4e49 AT gmail DOT com> <CAD8GWsuCBxO_8R9uBZwkGnbnJnV5-DdnvMvJ7txF0Ww6McYXoQ AT mail DOT gmail DOT com> <75eecba1-f968-a596-778f-77bbd8bb5c59 AT gmail DOT com> <CAD8GWsvNi1_9Dm9m50BR+JOE_amcwprWgndA6tdpKsm-tgf9cw AT mail DOT gmail DOT com> <4a702e1e-5ce1-175f-ca52-088dd21ef905 AT cygwin DOT com>
From: Lee <ler762 AT gmail DOT com>
Date: Fri, 8 Sep 2017 19:10:21 -0400
Message-ID: <CAD8GWstmF5=0yOYzcPLqK3OOmHeYebq=fM4J9yR8__roR=H_GA@mail.gmail.com>
Subject: Re: i686-w64-mingw32-gcc -fstack-protector-strong
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

On 9/8/17, Yaakov Selkowitz <yselkowitz AT cygwin DOT com> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019