From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28172 invoked by alias); 4 Feb 2019 14:32:58 -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 28164 invoked by uid 89); 4 Feb 2019 14:32:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-100.9 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Habiel, habiel X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.187) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Feb 2019 14:32:57 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mrwnt-1hVpOx0bLB-00o0LD for ; Mon, 04 Feb 2019 15:27:38 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id AF616A80412; Mon, 4 Feb 2019 15:27:37 +0100 (CET) Date: Mon, 04 Feb 2019 14:32:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: 32 bit vs 64 bit Cygwin, followup Message-ID: <20190204142737.GO3532@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20181129085816.GV30649@calimero.vinschen.de> <20181129163327.GD30649@calimero.vinschen.de> <20190202170508.GB3532@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wLAMOaPNJ0fu1fTG" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-02/txt/msg00021.txt.bz2 --wLAMOaPNJ0fu1fTG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1590 On Feb 4 09:16, Sam Habiel wrote: > >That's not GCC fault. You're running varargs, written for the standard > >stack layout of the MSABI target from a function with a stack laid out > >in SYSV ABI. That can't work. >=20 > I did some research to see how to write my own version of varargs (the > code base is already instrumented to do different versions of varargs > based on operating system). What I noticed though is that after > disassembling code for win64 abi vs sysv abi, it seems like gcc/crt is > attempting to do the right thing. There is different code for sysv vs > win64 for va_start. >=20 > sysv: > 10 va_list vl; > 11 va_start(vl,n); > 0x00000001004010e4 <+100>: movl $0x8,-0xc8(%rbp) > 0x00000001004010ee <+110>: movl $0x30,-0xc4(%rbp) > 0x00000001004010f8 <+120>: lea 0x10(%rbp),%rax > 0x00000001004010fc <+124>: mov %rax,-0xc0(%rbp) > 0x0000000100401103 <+131>: lea -0xb0(%rbp),%rax > 0x000000010040110a <+138>: mov %rax,-0xb8(%rbp) >=20 > win64: > 10 va_list vl; > 11 va_start(vl,n); > 0x00000001004010a3 <+35>: lea 0x18(%rbp),%rax > 0x00000001004010a7 <+39>: mov %rax,-0x18(%rbp) >=20 > So there may be a incomplete support for varargs for the sysv abi--but bu= ggy. >=20 > I attached the disassembly as well as the testing programs for your conve= nience. There's nothing for me to do here. You still have to make sure to choose the right varargs version and if there's really a bug, you really should report it to GCC. Corinna --=20 Corinna Vinschen Cygwin Maintainer --wLAMOaPNJ0fu1fTG Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxYS9kACgkQ9TYGna5E T6B6uxAAkyFBUd8sWPqxipJOMHA0VmuqRmVUaky4zfKOf2XtNikjNEEUIgBAYDSI SJUJKNsjwX472vGlNP6Nfn4JagUEbz3tDipPvdMD7YTpuaqKXSs4QzCtfrB3G6Dl rrunV24vkgxZO3wo39biXBn142vsO6HKavbpu6qi5UmUJnh0u7D+D0wNMxcB+pOP 9lYi+aD8uvrhatlo+CR9fIiCIS/nVwGYLemsQV1Y3HmLOadQzlx8/qozzb2X3+E9 1Cxu5CeuHZ4qK9wdLSmeQeWQybCTPt09/LqICK2HfvQ64q19PC/Kz57nwVe2gFXL YaVMLrs3XjGBCjAvmwwwEGB7AvfvUnPPp8mlqLbflmlPjUlJ36w/Vr0p8ywspMA5 VQAiOsoKJYUSwg5dLwduiN40tnHaKuVuEyHZLy4aGLb+OeGaJnejhl4OgUcfhXU1 Ndw2CTG+U5JppzlEUvtAR/Hb2MqERATkQea+nbzM8tnkcwIaFe3a0wz4yVaicnrp xlwk3vKuNHqdK18z8Q6pvSuLgh8WYNyrs8DvWHYpdClxu5xjJmBqZXWdZ1Ddwl2x 5IBwpJ1wVWoWhXjvsGep4Bwywpv+W+RslodizfeoOab1dQkmmaeHzndXCYy8SxCq leJweoNdcQ0469ptpLDdkvipMxCr+rZWP1265OrpkhkKhGnLrLA= =ZHtt -----END PGP SIGNATURE----- --wLAMOaPNJ0fu1fTG--