[PATCH] libgcrypt: disable some ARM assembly when building __PIC__

Jussi Kivilinna jussi.kivilinna at iki.fi
Tue May 20 19:55:56 CEST 2014


On 20.05.2014 00:20, Kyle McMartin wrote:
> Hi,
> 
> We're currently getting DT_TEXTREL set for libgcrypt.so.20... after some
> investigation, it seems the camellia, cast5, and rijndael arm assembly
> which was added since libgcrypt v1.5 is responsible. I'll spend some
> cycles attempting to fix this when __PIC__, but for the moment, we might
> as well disable them when building -fPIC.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1069792

Does the attached patch fix issues with __PIC__?

-Jussi

> 
> regards, Kyle
> 
> diff --git a/cipher/camellia-arm.S b/cipher/camellia-arm.S
> index 255a246..57ed361 100644
> --- a/cipher/camellia-arm.S
> +++ b/cipher/camellia-arm.S
> @@ -20,7 +20,7 @@
>  
>  #include <config.h>
>  
> -#if defined(__ARMEL__)
> +#if defined(__ARMEL__) && !defined(__PIC__)
>  #ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
>  
>  .text
> @@ -609,5 +609,5 @@ _gcry_camellia_arm_decrypt_block:
>  .long 0x80808000, 0x00010101, 0x40004040, 0xc7c700c7
>  .long 0x9e9e9e00, 0x003d3d3d, 0x4f004f4f, 0x9e9e009e
>  
> -#endif /*HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS*/
> +#endif /*HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS*/
>  #endif /*__ARM_ARCH >= 6*/
> diff --git a/cipher/camellia.h b/cipher/camellia.h
> index d0e3c18..c8f9556 100644
> --- a/cipher/camellia.h
> +++ b/cipher/camellia.h
> @@ -32,7 +32,7 @@
>  #include <config.h>
>  /* USE_ARM_ASM indicates whether to use ARM assembly code. */
>  # undef USE_ARM_ASM
> -# if defined(__ARMEL__)
> +# if defined(__ARMEL__) && !defined(__PIC__)
>  #  ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
>  #   define USE_ARM_ASM 1
>  #  endif
> diff --git a/cipher/cast5-arm.S b/cipher/cast5-arm.S
> index 57c89b7..7707ba0 100644
> --- a/cipher/cast5-arm.S
> +++ b/cipher/cast5-arm.S
> @@ -20,7 +20,7 @@
>  
>  #include <config.h>
>  
> -#if defined(__ARMEL__)
> +#if defined(__ARMEL__) && !defined(__PIC__)
>  #ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
>  
>  .text
> diff --git a/cipher/cast5.c b/cipher/cast5.c
> index 115e1e6..bf4123e 100644
> --- a/cipher/cast5.c
> +++ b/cipher/cast5.c
> @@ -54,7 +54,7 @@
>  
>  /* USE_ARM_ASM indicates whether to use ARM assembly code. */
>  #undef USE_ARM_ASM
> -#if defined(__ARMEL__)
> +#if defined(__ARMEL__) && !defined(__PIC__)
>  # ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
>  #  define USE_ARM_ASM 1
>  # endif
> diff --git a/cipher/rijndael-arm.S b/cipher/rijndael-arm.S
> index cea8c51..f06be60 100644
> --- a/cipher/rijndael-arm.S
> +++ b/cipher/rijndael-arm.S
> @@ -20,7 +20,7 @@
>  
>  #include <config.h>
>  
> -#if defined(__ARMEL__)
> +#if defined(__ARMEL__) && !defined(__PIC__)
>  #ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
>  
>  .text
> @@ -849,5 +849,5 @@ _gcry_aes_arm_decrypt_block:
>  .long 0x6184cb7b, 0x00000055, 0x70b632d5, 0x00000021
>  .long 0x745c6c48, 0x0000000c, 0x4257b8d0, 0x0000007d
>  
> -#endif /*HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS*/
> +#endif /*HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS*/
>  #endif /*__ARMEL__ */
> diff --git a/cipher/rijndael.c b/cipher/rijndael.c
> index 8019f0a..1ffc559 100644
> --- a/cipher/rijndael.c
> +++ b/cipher/rijndael.c
> @@ -69,7 +69,7 @@
>  
>  /* USE_ARM_ASM indicates whether to use ARM assembly code. */
>  #undef USE_ARM_ASM
> -#if defined(__ARMEL__)
> +#if defined(__ARMEL__) && !defined(__PIC__)
>  # ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
>  #  define USE_ARM_ASM 1
>  # endif
> 
> _______________________________________________
> Gcrypt-devel mailing list
> Gcrypt-devel at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-fix-arm-assembly-when-building.patch
Type: text/x-patch
Size: 4344 bytes
Desc: not available
URL: </pipermail/attachments/20140520/88656a2f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 713 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20140520/88656a2f/attachment.sig>


More information about the Gcrypt-devel mailing list