[vlc-devel] [PATCH] contrib: gcrypt: Fix relocation truncated errors

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Aug 25 18:28:27 CEST 2016


On 08/25/2016 06:23 PM, Hugo Beauzée-Luyssen wrote:
> This fixed our 64bits builds.
> Sending this as a patch since my asm & gcrypt experience usually involves
> mistakes and a lot of pain.
> ---
>  contrib/src/gcrypt/64bits-relocation.patch | 20 ++++++++++++++++++++
>  contrib/src/gcrypt/rules.mak               |  3 +++
>  2 files changed, 23 insertions(+)
>  create mode 100644 contrib/src/gcrypt/64bits-relocation.patch
>
> diff --git a/contrib/src/gcrypt/64bits-relocation.patch b/contrib/src/gcrypt/64bits-relocation.patch
> new file mode 100644
> index 0000000..4d995a0
> --- /dev/null
> +++ b/contrib/src/gcrypt/64bits-relocation.patch
> @@ -0,0 +1,20 @@
> +--- libgcrypt/cipher/rijndael.c.orig	2016-08-25 17:54:33.755153207 +0200
> ++++ libgcrypt/cipher/rijndael.c	2016-08-25 17:54:36.655151003 +0200
> +@@ -744,7 +744,7 @@
> +   const void *key = ctx->keyschenc;
> +   uintptr_t rounds = ctx->rounds;
> +   uintptr_t ret;
> +-  asm volatile ("movq %[encT], %%r8\n\t"
> ++  asm volatile ("movabs %[encT], %%r8\n\t"
> +                 "callq *%[ret]\n\t"
> +                 : [ret] "=a" (ret),
> +                   "+D" (key),
> +@@ -1127,7 +1127,7 @@
> +   const void *key = ctx->keyschdec;
> +   uintptr_t rounds = ctx->rounds;
> +   uintptr_t ret;
> +-  asm volatile ("movq %[dectabs], %%r8\n\t"
> ++  asm volatile ("movabs %[dectabs], %%r8\n\t"
> +                 "callq *%[ret]\n\t"
> +                 : [ret] "=a" (ret),
> +                   "+D" (key),
> diff --git a/contrib/src/gcrypt/rules.mak b/contrib/src/gcrypt/rules.mak
> index 23ec964..5239cb2 100644
> --- a/contrib/src/gcrypt/rules.mak
> +++ b/contrib/src/gcrypt/rules.mak
> @@ -15,6 +15,9 @@ libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2 .sum-gcrypt
>  ifdef HAVE_WINSTORE
>  	$(APPLY) $(SRC)/gcrypt/winrt.patch
>  endif
> +ifdef HAVE_WIN64
> +	$(APPLY) $(SRC)/gcrypt/64bits-relocation.patch
> +endif
>  	$(MOVE)
>
>  DEPS_gcrypt = gpg-error
>
For the record, I meant "this fixes our 64bits *windows* build"


More information about the vlc-devel mailing list