[MacPorts] #62132: libgcrypt @1.9.0 does not build on PPC Leopard, Mac OS X 10.5.8, because of "error: redefinition of typedef 'cipher_bulk_ops_t'"

MacPorts noreply at macports.org
Sat Jan 23 13:34:57 UTC 2021


#62132: libgcrypt @1.9.0 does not build on PPC Leopard, Mac OS X 10.5.8, because of
"error: redefinition of typedef 'cipher_bulk_ops_t'"
-----------------------+-----------------------
 Reporter:  ballapete  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:  2.6.4
 Keywords:  leopard    |       Port:  libgcrypt
-----------------------+-----------------------
 {{{
 make[2]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_libgcrypt/libgcrypt/work/libgcrypt-1.9.0/mpi'
 Making all in cipher
 make[2]: Entering directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_libgcrypt/libgcrypt/work/libgcrypt-1.9.0/cipher'
 /bin/sh ../libtool  --tag=CC   --mode=compile /usr/bin/gcc-4.2
 -DHAVE_CONFIG_H -I. -I..  -I../src -I../src -I../mpi -I../mpi
 -I/opt/local/include -I/opt/local/include -pipe -Os -std=gnu89 -arch ppc
 -fno-delete-null-pointer-checks -Wall -MT cipher.lo -MD -MP -MF
 .deps/cipher.Tpo -c -o cipher.lo cipher.c
 libtool: compile:  /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I.. -I../src
 -I../src -I../mpi -I../mpi -I/opt/local/include -I/opt/local/include -pipe
 -Os -std=gnu89 -arch ppc -fno-delete-null-pointer-checks -Wall -MT
 cipher.lo -MD -MP -MF .deps/cipher.Tpo -c cipher.c  -fno-common -DPIC -o
 .libs/cipher.o
 In file included from cipher.c:31:
 ./cipher-internal.h:145: error: redefinition of typedef
 'cipher_bulk_ops_t'
 ../src/cipher-proto.h:132: error: previous declaration of
 'cipher_bulk_ops_t' was here
 make[2]: *** [cipher.lo] Error 1
 make[2]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_libgcrypt/libgcrypt/work/libgcrypt-1.9.0/cipher'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_libgcrypt/libgcrypt/work/libgcrypt-1.9.0'
 make: *** [all] Error 2
 make: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_libgcrypt/libgcrypt/work/libgcrypt-1.9.0'
 Command failed:  cd
 "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_libgcrypt/libgcrypt/work/libgcrypt-1.9.0"
 && /usr/bin/make -w all
 Exit code: 2
 }}}

 The original definition in `cipher/cipher-internal.h` is:

 {{{
   124   /* A structure with function pointers for bulk operations.  The
 cipher
   125      algorithm setkey function initializes them when bulk operations
 are
   126      available and the actual encryption routines use them if they
 are
   127      not NULL.  */
   128   typedef struct cipher_bulk_ops
   129   {
   130     void (*cfb_enc)(void *context, unsigned char *iv, void
 *outbuf_arg,
   131                     const void *inbuf_arg, size_t nblocks);
   132     void (*cfb_dec)(void *context, unsigned char *iv, void
 *outbuf_arg,
   133                     const void *inbuf_arg, size_t nblocks);
   134     void (*cbc_enc)(void *context, unsigned char *iv, void
 *outbuf_arg,
   135                     const void *inbuf_arg, size_t nblocks, int
 cbc_mac);
   136     void (*cbc_dec)(void *context, unsigned char *iv, void
 *outbuf_arg,
   137                     const void *inbuf_arg, size_t nblocks);
   138     void (*ctr_enc)(void *context, unsigned char *iv, void
 *outbuf_arg,
   139                     const void *inbuf_arg, size_t nblocks);
   140     size_t (*ocb_crypt)(gcry_cipher_hd_t c, void *outbuf_arg,
   141                         const void *inbuf_arg, size_t nblocks, int
 encrypt);
   142     size_t (*ocb_auth)(gcry_cipher_hd_t c, const void *abuf_arg,
 size_t nblocks);
   143     void (*xts_crypt)(void *context, unsigned char *tweak, void
 *outbuf_arg,
   144                       const void *inbuf_arg, size_t nblocks, int
 encrypt);
   145   } cipher_bulk_ops_t;
 }}}

 In `src/cipher-proto.h` we find:

 {{{
   124   /*
   125    *
   126    * Symmetric cipher related definitions.
   127    *
   128    */
   129
   130   typedef struct cipher_bulk_ops cipher_bulk_ops_t;
   131
   132   /* Type for the cipher_setkey function.  */
   133   typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
   134                                                    const unsigned
 char *key,
   135                                                    unsigned keylen,
   136                                                    cipher_bulk_ops_t
 *bulk_ops);
 }}}

 C header files get included in this sequence:

 {{{
 . ../config.h
 . /usr/include/stdio.h
 .. /usr/include/_types.h
 ... /usr/include/sys/_types.h
 .... /usr/include/sys/cdefs.h
 .... /usr/include/machine/_types.h
 ..... /usr/include/ppc/_types.h
 . /usr/include/stdlib.h
 .. /usr/include/available.h
 .. /usr/include/sys/wait.h
 ... /usr/include/sys/signal.h
 .... /usr/include/sys/appleapiopts.h
 .... /usr/include/machine/signal.h
 ..... /usr/include/ppc/signal.h
 ...... /usr/include/ppc/_structs.h
 .... /usr/include/sys/_structs.h
 ..... /usr/include/machine/_structs.h
 ...... /usr/include/ppc/_structs.h
 ....... /usr/include/mach/ppc/_structs.h
 ... /usr/include/sys/resource.h
 .... /usr/include/sys/_structs.h
 ... /usr/include/machine/endian.h
 .... /usr/include/ppc/endian.h
 ..... /usr/include/sys/_endian.h
 .. /usr/include/alloca.h
 .. /usr/include/machine/types.h
 ... /usr/include/ppc/types.h
 .... /usr/include/ppc/_types.h
 . /usr/include/string.h
 . /usr/include/errno.h
 .. /usr/include/sys/errno.h
 . ../src/g10lib.h
 .. /usr/lib/gcc/powerpc-apple-darwin9/4.2.1/include/stdarg.h
 .. ../src/visibility.h
 ... ../src/gcrypt-int.h
 .... ../src/gcrypt.h
 ..... /opt/local/include/gpg-error.h
 ...... /usr/lib/gcc/powerpc-apple-darwin9/4.2.1/include/stddef.h
 ...... /usr/include/sys/types.h
 ....... /usr/include/sys/_structs.h
 ...... /usr/lib/gcc/powerpc-apple-darwin9/4.2.1/include/stdint.h
 ..... /usr/include/sys/socket.h
 ...... /usr/include/machine/_param.h
 ....... /usr/include/ppc/_param.h
 ..... /usr/include/sys/time.h
 ...... /usr/include/sys/_structs.h
 ...... /usr/include/time.h
 ....... /usr/include/_structs.h
 ........ /usr/include/sys/_structs.h
 ...... /usr/include/sys/_select.h
 ..... /usr/include/sys/select.h
 ...... /usr/include/sys/_structs.h
 .... ../src/types.h
 .. ../src/../compat/libcompat.h
 . ../src/gcrypt-testapi.h
 . ../src/cipher.h
 .. ../src/../random/random.h
 ... ../src/types.h
 ... ../src/../random/../src/gcrypt-testapi.h
 .. ../src/cipher-proto.h      <<<<<<<<<<<<<<<<<<<
 . ./cipher-internal.h         <<<<<<<<<<<<<<<<<<<
 .. ././poly1305-internal.h
 ... ../src/types.h
 ... ../src/g10lib.h
 ... ../src/cipher.h
 ... ././bufhelp.h
 .... ././bithelp.h
 }}}

 which is due to

 {{{
    27
    28   #include "g10lib.h"
    29   #include "../src/gcrypt-testapi.h"
    30   #include "cipher.h"
    31   #include "./cipher-internal.h"
    32
 }}}

 in `cipher/cipher.c`. I think it's safe to comment line #130 in `src
 /cipher-proto.h` and transpose lines #30 and #31 in `cipher/cipher.c`.
 This way `cipher_bulk_ops_t` will defined in `cipher/cipher.c`.

-- 
Ticket URL: <https://trac.macports.org/ticket/62132>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list