delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/02/09/15:17:38

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:date:from:to:subject:message-id:mime-version
:content-type; q=dns; s=default; b=HI3Oc+Dy88FICxHw5gFy9viXVUNcH
cRKlS2IFdoW82yIZJN6ZRPxymFpsx3X6Y5aNVS8h1yOpgxJRi3LcYeXX/a9+KuVC
FJFXpyocs17Vh1Zb5l9vU7PZ8vjv6uAMx8fQja+SKujS9QWAaH5pFIduJGfZf0HO
INKhUdiXMNq9FQ=
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:date:from:to:subject:message-id:mime-version
:content-type; s=default; bh=kknVY3BcMzrC6qNoCtLutXYYR+8=; b=Gef
HXU1msWNCsjx5WmPA7q5OlVqs6jK8tBiQw2w5lHqoF4CogrOviZEeZmQXvjAWwL5
A8K18PJ3QzMOjwyXG9dDjbefUO3IyQ4fNn1w9xqF7AUwXY5/fEOaxbTUK9wdny6g
w92peFPIdsdRaBW8FOsLdf9K2nF22QTWWmIA7TDY=
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.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=appdata, AppData, bitten, cygdrive
X-HELO: ppsw-42.csi.cam.ac.uk
Date: Fri, 9 Feb 2018 20:17:20 +0000 (GMT Standard Time)
From: Arthur Norman <acn1 AT cam DOT ac DOT uk>
To: cygwin AT cygwin DOT com
Subject: i686-w64-mingw32-gcc via ssh and hence without /usr/bin on PATH fails
Message-ID: <alpine.WNT.2.00.1802092002330.13788@panamint>
User-Agent: Alpine 2.00 (WNT 1167 2008-08-23)
MIME-Version: 1.0

In 2014 there was a query about i686-w64-mingw32-gcc in the case that 
/usr/bin was not on the PATH, and the responses then said that the issue 
would be fixed in the next release.

I got bitten now because when I use ssh to execute a command on a remote 
cygwin64 system /bin gets on PATH but /usr/bin does not. The use case is 
that the Windows10/cygwin setup is in a virtualbox VM, and the cygwin was 
only installed with the components I needed for my use of it.

This shows ssh from the Ubuntu64 host to the Windows10/cygwin64 host with 
PATH set up in a somewhat minimal manner.
ssh -p 18664 localhost echo \$PATH
/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Users/cyg_server/AppData/Local/Microsoft/WindowsApps

Now here are some examples that start with a very basic "hello world" 
program in C (main() only contains a call to printf) in a variety of ways 
run from a cygwin64 shell on a Windows machine

acn1 AT panamint ~ i686-w64-mingw32-gcc hello.c -o hello
    compilation locally goes without fuxx

acn1 AT panamint ~ /usr/bin/i686-w64-mingw32-gcc hello.c -o hello
    specifically invoking the compiler from /usr/bin is OK

acn1 AT panamint ~ /bin/i686-w64-mingw32-gcc hello.c -o hello
/tmp/cck2N9Nc.s: Assembler messages:
/tmp/cck2N9Nc.s:12: Error: invalid instruction suffix for `push'
    specifically invoking the compiler from /bin fails in a way that I
    believe probably relates to confusion between 32 and 64-bit assembly
    code.

acn1 AT panamint ~ ssh localhost i686-w64-mingw32-gcc hello.c -o hello
/tmp/ccK5oXEh.s: Assembler messages:
/tmp/ccK5oXEh.s:12: Error: invalid instruction suffix for `push'
    Remote executtion of the compiler via ssh will not have /usr/bin on
    PATH and fails.

acn1 AT panamint ~ ssh localhost "PATH=/usr/bin:\$PATH; i686-w64-mingw32-gcc 
hello.c -o hello"
    If I explicitly put /usr/bin back on PATH then the compilation is
    OK again.

Having uncovered this as an apparent root of problems that I was having I 
can now make my scripts use this final recipe and so I can make progress 
again, but this feels pretty odd and somewhat unsatisfactory... and maybe 
some others will get caught by it?

So so far as I am conncerned now I have a fix this is no longer urgent, 
but it is perhaps best reported.

    Arthur Norman




--
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