From vapier at gentoo.org Wed Sep 12 03:44:36 2012 From: vapier at gentoo.org (Mike Frysinger) Date: Tue, 11 Sep 2012 21:44:36 -0400 Subject: [PATCH] set mpi limb for all amd64 targets Message-ID: <1347414276-30722-1-git-send-email-vapier@gentoo.org> The new x32 ABI has sizeof(unsigned long) == 4 which causes random crashes. Add an explicit setting for all amd64 targets so things work nicely. This patch is by H.J. Lu. --- mpi/amd64/mpi-asm-defs.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 mpi/amd64/mpi-asm-defs.h diff --git a/mpi/amd64/mpi-asm-defs.h b/mpi/amd64/mpi-asm-defs.h new file mode 100644 index 0000000..17de1c1 --- /dev/null +++ b/mpi/amd64/mpi-asm-defs.h @@ -0,0 +1,4 @@ +/* This file defines some basic constants for the MPI machinery. We + * need to define the types on a per-CPU basis, so it is done with + * this file here. */ +#define BYTES_PER_MPI_LIMB 8 -- 1.7.9.7 From wk at gnupg.org Fri Sep 14 17:32:44 2012 From: wk at gnupg.org (Werner Koch) Date: Fri, 14 Sep 2012 17:32:44 +0200 Subject: [PATCH] set mpi limb for all amd64 targets In-Reply-To: <1347414276-30722-1-git-send-email-vapier@gentoo.org> (Mike Frysinger's message of "Tue, 11 Sep 2012 21:44:36 -0400") References: <1347414276-30722-1-git-send-email-vapier@gentoo.org> Message-ID: <87har0liw3.fsf@vigenere.g10code.de> On Wed, 12 Sep 2012 03:44, vapier at gentoo.org said: > The new x32 ABI has sizeof(unsigned long) == 4 which causes random > crashes. Add an explicit setting for all amd64 targets so things > work nicely. I recall that this x32 ABI is contested. The proposed patch changes a fundamental internal type (unsigned long to uint64_t) without setting up a new ABI in mpi/config.links. It looks harmless but it is a workaround for a bug which seems to be a more fundamental problem. I hesitate to apply it without having seen a description of the actual problem or having read up on the dispute at LWN. What is the CPU-OS-VENDOR string you are using? Salam-Shalom, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. From vapier at gentoo.org Sat Sep 15 02:30:13 2012 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 14 Sep 2012 17:30:13 -0700 Subject: [PATCH] set mpi limb for all amd64 targets In-Reply-To: <87har0liw3.fsf@vigenere.g10code.de> References: <1347414276-30722-1-git-send-email-vapier@gentoo.org> <87har0liw3.fsf@vigenere.g10code.de> Message-ID: On Fri, Sep 14, 2012 at 8:32 AM, Werner Koch wrote: > On Wed, 12 Sep 2012 03:44, vapier at gentoo.org said: >> The new x32 ABI has sizeof(unsigned long) == 4 which causes random >> crashes. Add an explicit setting for all amd64 targets so things >> work nicely. > > I recall that this x32 ABI is contested. no idea what you mean. all the mainline toolchain packages support it now as does the kernel. > The proposed patch changes a > fundamental internal type (unsigned long to uint64_t) without setting up > a new ABI in mpi/config.links. It looks harmless but it is a workaround > for a bug which seems to be a more fundamental problem. i'm not familiar with the gcrypt build system. both the x64_64 ABI and the x32 ABI can natively handle uint64_t in a single register i.e. there's no overhead. sizeof(unsigned long) on x32 is 4 though while on x86_64 it is 8. > What is the CPU-OS-VENDOR string you are using? it doesn't have a unique one: x86_64-linux-gnu -mike From wk at gnupg.org Mon Sep 17 15:19:15 2012 From: wk at gnupg.org (Werner Koch) Date: Mon, 17 Sep 2012 15:19:15 +0200 Subject: [PATCH] set mpi limb for all amd64 targets In-Reply-To: (Mike Frysinger's message of "Fri, 14 Sep 2012 17:30:13 -0700") References: <1347414276-30722-1-git-send-email-vapier@gentoo.org> <87har0liw3.fsf@vigenere.g10code.de> Message-ID: <87vcfciy7g.fsf@vigenere.g10code.de> On Sat, 15 Sep 2012 02:30, vapier at gentoo.org said: > no idea what you mean. all the mainline toolchain packages support it > now as does the kernel. Search for x32 on LWN to see what I mean. IIRC, the x32 ABI was specified by Intel for use on certain embedded systems. It is questionable there are any benefits for standard 84 bit CPUs. > it doesn't have a unique one: x86_64-linux-gnu Which defines the amd64 ABI and not the x32. That ABI means that an LONG is 64 bit and not 32. As I said it will likely work to define the MPI limb size to 64 bit instead of directly to "unsigned long". However we are mixing two ABIs here which is not a good idea unless it can be proofed that there are no problems. And as you reported there are problems mixing the two ABIs. What about using "./configure --disable-asm" as a workaround? Salam-Shalom, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. From vapier at gentoo.org Mon Sep 17 20:31:30 2012 From: vapier at gentoo.org (Mike Frysinger) Date: Mon, 17 Sep 2012 14:31:30 -0400 Subject: [PATCH] set mpi limb for all amd64 targets In-Reply-To: <87vcfciy7g.fsf@vigenere.g10code.de> References: <1347414276-30722-1-git-send-email-vapier@gentoo.org> <87vcfciy7g.fsf@vigenere.g10code.de> Message-ID: <201209171431.31114.vapier@gentoo.org> On Monday 17 September 2012 09:19:15 Werner Koch wrote: > On Sat, 15 Sep 2012 02:30, vapier at gentoo.org said: > > no idea what you mean. all the mainline toolchain packages support it > > now as does the kernel. > > Search for x32 on LWN to see what I mean. IIRC, the x32 ABI was > specified by Intel for use on certain embedded systems. no, not really. it works on any 64bit cpu since it just uses different types of sizes and generates slightly different instructions (to use 32bit regs rather than 64bit regs). it was designed to shrink bloat since the vast majority of applications out there don't need more than 4GiB of RAM. yes, this ends up improving performance on embedded systems and making the part more competitive against ARM, but a good number (maybe even a majority) of laptops today don't have more than 4GiB of RAM either. although if you're dismissive of "embedded systems", i guess you're also dismissive of ARM too ? > It is questionable there are any benefits for standard 84 bit CPUs. guess you mean 64bit. all x86 64bit intel/amd64 processors are "standard" and can run the x32 ABI. > > it doesn't have a unique one: x86_64-linux-gnu > > Which defines the amd64 ABI and not the x32. it doesn't specify just the amd64 ABI anymore. > As I said it will likely work to define the > MPI limb size to 64 bit instead of directly to "unsigned long". However > we are mixing two ABIs here which is not a good idea unless it can be > proofed that there are no problems. w/this patch, `make check` passes for both libgcrypt and gnupg. no idea what you're looking for exactly ... i hate to state the obvious, but it is literally impossible to prove a negative. > And as you reported there are problems mixing the two ABIs. don't know what you're referring to here. i'm not mixing them, i'm just running x32. > What about using "./configure --disable-asm" as a workaround? i'm not interested in workarounds. if i was, i wouldn't be posting patches to *fix* the problem. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: From devurandom at gmx.net Mon Sep 17 23:46:31 2012 From: devurandom at gmx.net (Dennis Schridde) Date: Mon, 17 Sep 2012 23:46:31 +0200 Subject: [PATCH] Generate and install a pkg-config file + Use pkg-config to find gpg-error Message-ID: <1927881.1kmRzLy7A1@ernie> Hello! Attached patches make libgcrypt install a pkg-config file and its configure.ac file search for gpg-error using one. This aids in cross-compiling, where the output of gpg-error-config cannot directly be used, e.g. because the paths may need an additional prefix. Best regards, Dennis Schridde -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Generate-and-install-a-pkg-config-file.patch Type: text/x-patch Size: 1446 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Use-pkg-config-to-find-gpg-error.patch Type: text/x-patch Size: 986 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From devurandom at gmx.net Mon Sep 17 23:52:26 2012 From: devurandom at gmx.net (Dennis Schridde) Date: Mon, 17 Sep 2012 23:52:26 +0200 Subject: [PATCH] Generate and install a pkg-config file + Use pkg-config to find gpg-error Message-ID: <1495569.2q5oltAnlX@ernie> Hello! Attached patches make libgcrypt install a pkg-config file and its configure.ac file search for gpg-error using one. This aids in cross-compiling, where the output of gpg-error-config cannot directly be used, e.g. because the paths may need an additional prefix. Best regards, Dennis Schridde -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Generate-and-install-a-pkg-config-file.patch Type: text/x-patch Size: 1445 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Use-pkg-config-to-find-gpg-error.patch Type: text/x-patch Size: 985 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From wk at gnupg.org Tue Sep 18 09:08:01 2012 From: wk at gnupg.org (Werner Koch) Date: Tue, 18 Sep 2012 09:08:01 +0200 Subject: [PATCH] Generate and install a pkg-config file + Use pkg-config to find gpg-error In-Reply-To: <1927881.1kmRzLy7A1@ernie> (Dennis Schridde's message of "Mon, 17 Sep 2012 23:46:31 +0200") References: <1927881.1kmRzLy7A1@ernie> Message-ID: <87mx0nizam.fsf@vigenere.g10code.de> On Mon, 17 Sep 2012 23:46, devurandom at gmx.net said: > > Attached patches make libgcrypt install a pkg-config file and its > configure.ac See my comments to your patch on gnupg-devel. Salam-Shalom, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.