Opened 3 years ago

Closed 3 years ago

#62132 closed defect (fixed)

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'"

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: leopard, tiger Cc:
Port: libgcrypt

Description

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.

Attachments (5)

main.log (53.4 KB) - added by ballapete (Peter "Pete" Dyballa) 3 years ago.
Main.log from PPC Leopard
main.2.log (55.3 KB) - added by ballapete (Peter "Pete" Dyballa) 3 years ago.
Main.log from PPC Tiger
Tiger-spawn.patch (657 bytes) - added by ballapete (Peter "Pete" Dyballa) 3 years ago.
Patch file to solve the problem with missing spawn.h C header file (on Tiger and before)
0001-cipher-proto-remove-forward-typedef-of-cipher_bulk_MP.patch (4.3 KB) - added by ballapete (Peter "Pete" Dyballa) 3 years ago.
Patch set to correct the typdef problem
0001-global-fix-compile-error-at-pragma-GCC-diagnostic-MP.patch (1.0 KB) - added by ballapete (Peter "Pete" Dyballa) 3 years ago.
Patch to move the #pragma statements into their proper places

Download all attachments as: .zip

Change History (30)

Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from PPC Leopard

comment:1 Changed 3 years ago by Schamschula (Marius Schamschula)

Owner: set to Schamschula
Status: newassigned

Unfortunately, there is little I can do to fix a PPC build. If you find a workaround, please open a PR.

comment:2 Changed 3 years ago by Schamschula (Marius Schamschula)

Cc: mps@… removed

comment:3 in reply to:  1 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to Schamschula:

If you find a workaround, please open a PR.

Waht is a PR? Public Relation, Public Request, People's Republic, or something different?

comment:4 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

My idea does not work:

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 ../src/cipher.h:90,
                 from ././poly1305-internal.h:29,
                 from ./cipher-internal.h:23,
                 from cipher.c:30:
../src/cipher-proto.h:138: error: expected declaration specifiers or '...' before 'cipher_bulk_ops_t'
cipher.c: In function 'cipher_setkey':
cipher.c:735: error: too many arguments to function 'c->spec->setkey'
cipher.c:769: error: too many arguments to function 'c->spec->setkey'
make[2]: *** [cipher.lo] Error 1

Things like c->spec->setkey do not look like good old C so presumingly libgcrypt should better be built with GCC7… That's my next try!

comment:5 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Just checking my deeds. The sequence of including C header files end with:

. ../src/gcrypt-testapi.h
. ./cipher-internal.h
.. ././poly1305-internal.h
... ../src/types.h
... ../src/g10lib.h
... ../src/cipher.h
.... ../src/../random/random.h
..... ../src/types.h
..... ../src/../random/../src/gcrypt-testapi.h
.... ../src/cipher-proto.h
... ././bufhelp.h
.... ././bithelp.h
. ../src/cipher.h

which shows the effect of the patch. The pre-processed output (via -E -dD -H instead of -c) shows:

 8360	# 135 "../src/cipher-proto.h"
 8361	typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
 8362	       const unsigned char *key,
 8363	       unsigned keylen,
 8364	       cipher_bulk_ops_t *bulk_ops);
 8365	
...
 9049	# 99 "./cipher-internal.h"
...
 9078	
 9079	typedef struct cipher_bulk_ops
 9080	{
 9081	  void (*cfb_enc)(void *context, unsigned char *iv, void *outbuf_arg,
 9082	    const void *inbuf_arg, size_t nblocks);
 9083	  void (*cfb_dec)(void *context, unsigned char *iv, void *outbuf_arg,
 9084	    const void *inbuf_arg, size_t nblocks);
 9085	  void (*cbc_enc)(void *context, unsigned char *iv, void *outbuf_arg,
 9086	    const void *inbuf_arg, size_t nblocks, int cbc_mac);
 9087	  void (*cbc_dec)(void *context, unsigned char *iv, void *outbuf_arg,
 9088	    const void *inbuf_arg, size_t nblocks);
 9089	  void (*ctr_enc)(void *context, unsigned char *iv, void *outbuf_arg,
 9090	    const void *inbuf_arg, size_t nblocks);
 9091	  size_t (*ocb_crypt)(gcry_cipher_hd_t c, void *outbuf_arg,
 9092	        const void *inbuf_arg, size_t nblocks, int encrypt);
 9093	  size_t (*ocb_auth)(gcry_cipher_hd_t c, const void *abuf_arg, size_t nblocks);
 9094	  void (*xts_crypt)(void *context, unsigned char *tweak, void *outbuf_arg,
 9095	      const void *inbuf_arg, size_t nblocks, int encrypt);
 9096	} cipher_bulk_ops_t;
 9097	# 156 "./cipher-internal.h"

so the sequnce still is not correct. Could be I should not change cipher/cipher.c

Last edited 3 years ago by ballapete (Peter "Pete" Dyballa) (previous) (diff)

comment:6 Changed 3 years ago by jmroot (Joshua Root)

Redefinition of typedefs is an error prior to C11, so this is probably an issue on more than just ppc?

comment:7 in reply to:  5 ; Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

The error is similar:

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 ../src/cipher.h:90,
                 from cipher.c:30:
../src/cipher-proto.h:138: error: expected declaration specifiers or '...' before 'cipher_bulk_ops_t'
cipher.c: In function 'cipher_setkey':
cipher.c:735: error: too many arguments to function 'c->spec->setkey'
cipher.c:769: error: too many arguments to function 'c->spec->setkey'
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'

because the definition of cipher_bulk_ops_t comes too late:

. ../src/gcrypt-testapi.h
. ../src/cipher.h
.. ../src/../random/random.h
... ../src/types.h
... ../src/../random/../src/gcrypt-testapi.h
.. ../src/cipher-proto.h      <<<<<<<<<<<<<<<<<<< actually redefines and then uses
. ./cipher-internal.h         <<<<<<<<<<<<<<<<<<< has the #define
.. ././poly1305-internal.h
... ../src/types.h
... ../src/g10lib.h
... ../src/cipher.h
... ././bufhelp.h
.... ././bithelp.h

So, since no error was reported yet it's like that GCC7 and other modern compilers work around this.

comment:8 in reply to:  7 ; Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

libgcrypt @1.9.0 built with GCC7. I am running now a make check.

comment:9 in reply to:  8 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to ballapete:

I am running now a make check.

Some errors happened:

PASS: prime
/bin/sh: line 5: 62771 Bus error               (core dumped) GCRYPT_IN_REGRESSION_TEST=1 ${dir}$tst
FAIL: basic
...
PASS: t-ed448
      now running 'basic' test with all hardware features disabled.
/bin/sh: line 5: 63058 Bus error               (core dumped) GCRYPT_IN_REGRESSION_TEST=1 ${dir}$tst
FAIL: basic-disable-all-hwf
Note: benchmark running in quick regression test mode.
...
=======================================
2 of 29 tests failed
(1 test was not run)
Please report to https://bugs.gnupg.org
=======================================

comment:10 Changed 3 years ago by jmroot (Joshua Root)

You can probably report this upstream since they don't seem to advertise a C11 requirement.

comment:11 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Keywords: tiger added

Similar failure on PPC Tiger, Mac OS X 10.4.11:

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 /opt/local/bin/gcc-apple-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:  /opt/local/bin/gcc-apple-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'

Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.2.log added

Main.log from PPC Tiger

comment:12 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Trying to build on PPC Tiger with GCC7 leads to a new error:

/opt/local/bin/gcc-mp-7 -DHAVE_CONFIG_H -I. -I..  -I../src -I../src -I/opt/local/include -I/opt/local/include -pipe -Os -std=gnu89 -arch ppc -fno-delete-null-pointer-checks -Wall -MT random.o -MD -MP -MF .deps/random.Tpo -c -o random.o random.c
random.c:509:10: fatal error: spawn.h: No such file or directory
 #include <spawn.h>
          ^~~~~~~~~
compilation terminated.
make[2]: *** [random.o] 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/tests'
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

spawn.h is in Legacy Support although as sys/spawn.h, but let's see!

comment:13 in reply to:  12 ; Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

spawn.h is not found despite legacysupport 1.0.

comment:14 in reply to:  13 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Changing the original

#ifdef USE_POSIX_SPAWN_FOR_TESTS
#include <spawn.h>
extern char **environ;

to

#ifdef USE_POSIX_SPAWN_FOR_TESTS
#include <sys/spawn.h>
extern char **environ;

leads to a new error:

Making all in tests
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/tests'
/opt/local/bin/gcc-mp-7 -DHAVE_CONFIG_H -I. -I..  -I../src -I../src -I/opt/local/include -I/opt/local/include/LegacySupport -I/opt/local/include -pipe -Os -std=gnu89 -I/opt/local/include/LegacySupport -arch ppc -fno-delete-null-pointer-checks -Wall -MT random.o -MD -MP -MF .deps/random.Tpo -c -o random.o random.c
random.c: In function 'run_all_rng_tests':
random.c:551:11: warning: implicit declaration of function 'posix_spawn'; did you mean 'posix_openpt'? [-Wimplicit-function-declaration]
       if (posix_spawn (&pid, program, NULL, NULL, argv, environ))
           ^~~~~~~~~~~
           posix_openpt
mv -f .deps/random.Tpo .deps/random.Po
/bin/sh ../libtool  --tag=CC   --mode=link /opt/local/bin/gcc-mp-7 -I/opt/local/include -pipe -Os -std=gnu89 -I/opt/local/include/LegacySupport -arch ppc -fno-delete-null-pointer-checks -Wall -no-install -L/opt/local/lib -Wl,-headerpad_max_install_names -lMacportsLegacySupport -arch ppc -o random random.o ../src/libgcrypt.la ../compat/libcompat.la -L/opt/local/lib -lgpg-error  
libtool: link: warning: `-no-install' is ignored for powerpc-apple-darwin8.11.0
libtool: link: warning: assuming `-no-fast-install' instead
libtool: link: /opt/local/bin/gcc-mp-7 -I/opt/local/include -pipe -Os -std=gnu89 -I/opt/local/include/LegacySupport -arch ppc -fno-delete-null-pointer-checks -Wall -Wl,-headerpad_max_install_names -arch ppc -o .libs/random random.o  -L/opt/local/lib ../src/.libs/libgcrypt.dylib ../compat/.libs/libcompat.a -lMacportsLegacySupport /opt/local/lib/libgpg-error.dylib
Undefined symbols:
  "_posix_spawn", referenced from:
      _main in random.o
ld: symbol(s) not found
collect2: error: ld returned 1 exit status
make[2]: *** [random] 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/tests'
make[1]: *** [all-recursive] Error 1

So it seems that the Legacy Support version 1.0 is not prepared for this?

comment:15 in reply to:  10 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to jmroot:

You can probably report this upstream since they don't seem to advertise a C11 requirement.

Done in https://dev.gnupg.org/T5264. The solution proposed by Werner Koch is: "Do not use -fno-common"

comment:16 Changed 3 years ago by Schamschula (Marius Schamschula)

Perhaps adding the following to the Portfile would implement Werner Koch's solution:

if {[string match "*gcc*" ${configure.compiler}]} {
    configure.cflags-append "-fcommon"
}

comment:17 in reply to:  16 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to Schamschula:

Perhaps adding the following to the Portfile would implement Werner Koch's solution:

There seems to be a better approach by patching the sources that they comply again to GNU coding standards. Later this day, presumingly, other build precesses from port will have finished so that I can test this approach.

comment:18 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

The two patches jukivili (Jussi Kivilinna) supplied worked – I only had to translate them into unified diff output format (and made one mistake which I had to find). I asked Jussi whether I may publish them here. The simpler one removes #pragmas from incorrect places, which newer compilers might accept. The other set of patches solves the problem of repeated typedefs.

comment:19 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Another patch was supplied by gniibe (NIIBE Yutaka) to solve the problem with missing spawn.h C header file. I am waiting for permission to publish it here.

comment:20 in reply to:  19 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Replying to ballapete:

I am waiting for permission to publish it here.

Permission was given. Presumingly the patch only concerns Tiger and before. I could test this in a few days when a few other Tiger problems will be fixed…

Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: Tiger-spawn.patch added

Patch file to solve the problem with missing spawn.h C header file (on Tiger and before)

comment:21 in reply to:  18 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

No answer. Since the patches are already public I think I can attach the translated versions. The original files are a git-diff or such. Since I do no know how to apply them I "translated" theem manually to unified diff output.

Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Patch set to correct the typdef problem

Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Patch to move the #pragma statements into their proper places

comment:22 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

libgcrypt @1.9.0 finally built on PPC Leopard, Mac OS X 10.5.8 with GCC 4.2 and the two patch files 0001-global-fix-compile-error-at-pragma-GCC-diagnostic-MP.patch and 0001-cipher-proto-remove-forward-typedef-of-cipher_bulk_MP.patch. The C header file /usr/include/spawn.h on Leopard seems to suffice. I am going to run a make check

comment:23 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Next releaaes of libgcrypt will make use of the getentropy() function. This means that Portfile will need to have

PortGroup           legacysupport 1.0

A problem exists since the developers do not know whether and when a symbol _getentropy was introduced to some dylib by Apple. Another question is whether a guard in Legacy Support exists that can be used by the C pre-processor to either use or bypass Legacy Support code…

comment:24 Changed 3 years ago by ballapete (Peter "Pete" Dyballa)

Meanwhile libgcrypt @1.9.2 built and installed…

comment:25 Changed 3 years ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.