X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0A18385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1708941132; bh=NUlrECSscZawpfkJXsSKYBC24714zFvJSf6wcMGx1Fk=; h=Subject:To:Date:References:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=aZfQpaHgFKckSDdwtibaq2dvP9pMrn9SrQ4U6JUvUJZj1o2lbs1n6gknQ6knI+DW3 W1cqPLQjDs0R1JTpponH5hGs1fkkAJbbs9xjvWRftrxdjgsZE6Ab5uoJrv7nyHoxxu NSAHipLODgH9PGirqUyXkULJ1im7rSVV0OutTxtk= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA5CD3858CDB ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BA5CD3858CDB ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708941070; cv=none; b=P+Pzl0uRjUVkA8acUcQA9fR9EcYY2f3hgChe47vLWwuXAhYgBRTAg/VkoI5m6GgjI+ae+lkjnQtSEvv4L7h7grLkuUTRVLKye8Xv+pIcET2geoyi+xQ5ec3f+OqmKmNAtA9Q0n2ncJY/kkNJ28GqT9qESPDUWgekl5jz86R8jTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708941070; c=relaxed/simple; bh=j/hdRIL8M5rxtU4VYWGD9gvY5ZV/5ygc3xz9ogOABQU=; h=DKIM-Signature:From:Subject:To:Message-ID:Date:MIME-Version; b=l9/8By5+EoJxboGbcZXqjxR0ISmdCKWA4wrHOsGXegvSkjPNJX9MMj+pl9w9iao2njPbK9FhyM9KCb1ycCAjJDblZw/3Z5fE08fA8nrCmiLLsI44votY1V9wHvlAh9vHzYDfrashwhgtngpkMoHIUH0xx660leCzOVeqkNTWAjY= ARC-Authentication-Results: i=1; server2.sourceware.org X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1708941065; bh=0pk/2tPIGdQnp/yggR6FFyb51rzhiei48GCOvuWXGEG=; h=X-Sonic-MF:From:Subject:To:Date:From:Subject; b=YiBAMCEcg2JgaPKUI2op9GNC/L9YmKUMyuLBzZDYPf7uzjh5upjxXrDGSj6oWdEU5Jf5oyKyMo7uZ4VgQ6FErI+ZJdI12P3MDC91Gs6X42HSVOX9VPwHxO9N7Ct+xr6PPXZBD/fFPZTb8Ie8yh+L/hN07gYWygGbdnPF1ub2orFlNGhmXWeVD7guirylTALx7RqnNwKf1eUSvn+OKfNgymQd537RFjXfPxYunF9TOz4lAPkNFgcvefI5Xt3mokeZH+UC2HzSPKfszv9zbLJpr/TBWp0EaF4Jji0sAHG3PS9g3t62AJqKzTK3c8kUgFKG2h0youeu/NgUwgIlRNTrmA== X-YMail-OSG: .8WHYzYVM1mi30y5G3gRYjnpa0YYRXpFZwqdKrIt_2BqHc0P2gc_OVtts5Wqk2K xMWfI4eBEMbHYOUIhx86BhQUkI5eKLidKvU13rM8bxx2Q0WTbdbhGMcP.FMhU_NtysymuD837sSF t50S4Yu3AttLXQk8y5Elz.Lp_MqzgRsvSIDy3aGq73N0sEK6vMNpWJmzx4GD7L9LKzvF0GfFHm5o Id.t064lzk_hybTGy.gT6_BZGHwSl0pB2kzti_KgpBA1oH_Cy6le07iB_FjC3FMdJqJgq8CaXq2s xcAtIksN1cIh19HLgWoHqsQt4zd9OPgknyfnT_9D8XeJW.Ex0TOrnYw_XAtcB6eKHuAtfU1ZUsv2 EPdskZRkhvDCNArRKo.PEfQYjMX5EPz85Ii00KqWhDII5.OHN4AyPHU95r6UVK9C00eGIZmEvZIj LtaVwi.zZaFDq8UkgTL29tbXEsYf7uVaPXVlRyLANRZS2Q3uHjWNR6DTGH2VdA3GJOQFjyATXV8P N0wKlvvbMbsrBTXgB.lKL6uv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Yg5OZcp6dQqefDbgOD_JfhrGC02Da9C0jEeugPr9Md5ihpTfU D6wAl1DC6IBllqeMnS1GjnmDznoKtSJjO8NWY0aQgcJ6qRiuaiOrlb4ZRzZIdMPBWHbcw1HnEUVG .HYK6BkLR1CUq1.jZcZ0koK.Ia2HyuCfJthE1q427uIxO3sjC_ak8d9fUftEjhYyzAEyuwh2TWy7 uht7wxtQ6ihQwPmVZMsrTXszDG7mfKV4OGD3Qw6voL5UWYoIpzPJt5Zw3LfFONOgVSDWOiz.yIbo IcEnIdDX6tikb66j680hlEnWwGfQRsdwnb0P2miUmErIllbGTLZo3lWEqLS_NIy7.BDM_Jbq_VC6 HrhfHGkl7omYwF2MEIFiMHPUUr0k9R76.HaXhNWum__FmoYoIbgUtRkrmRq6swKJWqx9.ARj0ze4 7XFInGx34uTIlSvTr9pj_hG.fg9OFv3Y.GOoCY0zJgaBxFpNqZYIYLVRorLhFlZtJUGBrzCNiaBB LFED5uR9OvLE9x8kKU9RmzKjYq8axaXIhW7aXafhjY2afGXYm06f.CfuDlbtkDPVYoOUXj5YKHvs LGEOUQsTlAUb6YnYefOGJCTOFD4970Y71onJIBzQ5cdHETi.yE8wK3Kirzd52mmo6e9n0HWJcc8A lZxwYgkjn X-Sonic-MF: X-Sonic-ID: ccc22eef-11c7-4dfd-8bcd-eefe7ab0b5fa Subject: 'sh.'exe' issue with redirection To: cygwin AT cygwin DOT com Message-ID: <8d97486a-f68e-afb7-721b-883c60212559@yahoo.no> Date: Mon, 26 Feb 2024 10:51:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Content-Language: en-GB References: <8d97486a-f68e-afb7-721b-883c60212559 DOT ref AT yahoo DOT no> X-Mailer: WebService/1.1.22103 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Gisle Vanem via Cygwin Reply-To: Gisle Vanem Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Cygwin" Hello list, my 1st issue here. I'm now having a big issue with 'sh.exe' used by *any* GNU-make program in a link-macro (or simple rule) where 'stdout' gets redirect like this: LDFLAGS = -nologo -debug -incremental:no -verbose define link_EXE @echo -e "\e[1;32mLinking $(1)\e[0m" link.exe $(LDFLAGS) -out:$(strip $(1)) $(2) > link.tmp @cat link.tmp >> $(1:.exe=.map) endef Using Microsoft's 'link.exe' or clang-cl's 'lld-link.exe' does not matter. And it's not specific to Qt. But the error- level gets lost when I intentionally remove a needed .lib-file in any type of link-command. 'Qt6Widgets.lib' in the case below. Issuing gnu-make to link a simple Qt6 program and with '--debug=j' shows (edited for clarity): Linking qtdiag.exe Reaping winning child 0000019a69da3fb0 PID link.exe -nologo -debug -incremental:no -verbose -out:qtdiag.exe objects/main.obj objects/qtdiag.obj f:\gv\Qt\6.5.1\msvc2019_64/lib/Qt6Core.lib f:\gv\Qt\6.5.1\msvc2019_64/lib/Qt6Gui.lib f:\gv\Qt\6.5.1\msvc2019_64/lib/Qt6Network.lib f:\gv\Qt\6.5.1\msvc2019_64/lib/Qt6OpenGL.lib > link.tmp CreateProcess(f:\CygWin64\bin\sh.exe,f:/CygWin64/bin/sh.exe -c "link.exe -nologo -debug -incremental:no -verbose -out:qtdiag.exe objects/main.obj objects/qtdiag.obj f:\gv\Qt\6.5.1\msvc2019_64/lib/Qt6Core.lib f:\gv\Qt\6.5.1\msvc2019_64/lib/Qt6Gui.lib f:\gv\Qt\6.5.1\msvc2019_64/lib/Qt6Network.lib f:\gv\Qt\6.5.1\msvc2019_64/lib/Qt6OpenGL.lib > link.tmp",...) Live child 0000024430223280 (qtdiag.exe) PID 2491888511248 Reaping winning child 0000024430223280 PID 2491888511248 CreateProcess(f:\CygWin64\bin\sh.exe,f:/CygWin64/bin/sh.exe -c "cat link.tmp >> qtdiag.map",...) Live child 0000024430223280 (qtdiag.exe) PID 2491888513984 Reaping winning child 0000024430223280 PID 2491888513984 CreateProcess(f:\CygWin64\bin\echo.exe,echo,...) Live child 0000024430223280 (qtdiag.exe) PID 2491888511536 Reaping winning child 0000024430223280 PID 2491888511536 Removing child 0000024430223280 PID 2491888511536 from chain. Now 'link.tmp' contains: qtdiag.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QList __cdecl QStyleFactory::keys(void)" qtdiag.exe : fatal error LNK1120: 1 unresolved externals since I intentionally removed 'Qt6Widgets.lib'. GNU-make doesn't stop since 'sh.exe' seems to have reset the exit-code somehow. But defining my 'link_EXE' macro w/o a '> link.tmp' works fine: LDFLAGS = -nologo -debug -incremental:no define link_EXE @echo -e "\e[1;32mLinking $(1)\e[0m" link.exe $(LDFLAGS) -out:$(strip $(1)) $(2) @cat link.tmp >> $(1:.exe=.map) endef Resulting in this to 'stdout': qtdiag.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QList __cdecl QStyleFactory::keys(void)" ... qtdiag.exe : fatal error LNK1120: 1 unresolved externals -------------- But I'd rather prefer '-verbose' and redirection to see the details of 'link.exe'. So what in Cygwin's 'sh.exe' could cause the exit-code 1120 from 'link.exe' (or others) to get lost like this? The 'link' exit-codes are listed here: https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-errors-and-warnings?view=msvc-170 (all >= 1000 if that matters). I have tried several gnu-make programs to figure out this "redirection bug". They all behave the same; exit-code from 'link.exe' gets ignored. Hence it's not a GNU-make issue AFAICS. I also ensured there is no Cygwin/MSys 'link.exe' program in the PATH ahead of MSVC's 'link.exe' and I've deleted f:\Cygwin64\bin\link.exe I suspect perhaps all this started to happen after the huge update of "Visual-Studio 17.10 Preview 1.0". cl/link version. 14.40.33521: https://devblogs.microsoft.com/visualstudio/introducing-visual-studio-17-10-preview-1-is-here/ I fixed this by adding this 'Git-for-Windows' directory: f:\ProgramFiler\Git-2\usr\bin before 'f:\Cygwin64\bin' (thus letting GNU-make to use 'f:\ProgramFiler\Git-2\usr\bin\sh.exe' instead). But I'd rather keep it simpler and use 'f:\Cygwin64\bin\sh.exe'. And 'f:\Cygwin64\bin\sh --version' shows: GNU bash, version 5.2.21(1)-release (x86_64-pc-cygwin) ... So how can I hnt down this issue. Is there perhaps some env-var in my shell that could cause this? Please advice. -- --gv -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple