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:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=ylNIzR7smszgqLqwzIp1cABLdRaToYTKw25d+rPsITcDH1f3C+B1Q hwnrWBPvt6WbZe2OuZ88GFWG7FjjrIPJwI/J6hCiHBda6r/c2uDl4NX3rwqrkOup KK7xnX7lBXttG7OQ7csDJMejOlrPkQU9PGiO7n8W+7z2ifT70t2keE= 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:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=PaxKe6uCrVnracLZka90Fzl1AVc=; b=ApmkVULBGMARDlqEeX6Sp8NcfwW6 WGKjDAdQQqiCS1Qj0dXQNXkYZo6gyqqheZeUKdkfQwGdv3qANM3K6RLG8gDf2kUm 47zzxoif9fWvt83nQPKjBthfigLcJldE5Nq84Vi4kltqqRPgoZsnVGjR0Vjn4OtP Eofj4ad77khx56Q= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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-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 Date: Mon, 4 Feb 2019 15:27:37 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: 32 bit vs 64 bit Cygwin, followup Message-ID: <20190204142737.GO3532@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20181129085816 DOT GV30649 AT calimero DOT vinschen DOT de> <20181129163327 DOT GD30649 AT calimero DOT vinschen DOT de> <20190202170508 DOT GB3532 AT calimero DOT vinschen DOT 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) --wLAMOaPNJ0fu1fTG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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" -----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--