Opened 3 years ago

Closed 17 months ago

#63547 closed defect (fixed)

gnupg2 @2.3.2 does not build on PPC Tiger, Mac OS X 10.4.11, because of redefinition of typedef 'KEYBOX_HANDLE'

Reported by: ballapete (Peter "Pete" Dyballa) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: tiger Cc: jann@…, ionic@…
Port: gnupg2

Description

/opt/local/bin/gcc-apple-4.2 -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/opt/local/share/locale\" -DGNUPG_BINDIR="\"/opt/local/bin\"" -DGNUPG_LIBEXECDIR="\"/opt/local/libexec\"" -DGNUPG_LIBDIR="\"/opt/local/lib/gnupg\"" -DGNUPG_DATADIR="\"/opt/local/share/gnupg\"" -DGNUPG_SYSCONFDIR="\"/opt/local/etc/gnupg\"" -DGNUPG_LOCALSTATEDIR="\"/opt/local/var\""  -DGNUPG_DEFAULT_PINENTRY="\"/opt/local/bin/pinentry\""      -I/opt/local/include -I/opt/local/include -I/opt/local/include -DKEYBOX_WITH_X509=1 -I/opt/local/include -I/opt/local/include   -Wall -Wno-pointer-sign -Wpointer-arith -pipe -Os -arch ppc -MT keyboxd-backend-support.o -MD -MP -MF .deps/keyboxd-backend-support.Tpo -c -o keyboxd-backend-support.o `test -f 'backend-support.c' || echo './'`backend-support.c
In file included from keybox-defs.h:37,
                 from backend-support.c:32:
keybox.h:36: error: redefinition of typedef 'KEYBOX_HANDLE'
backend.h:28: error: previous declaration of 'KEYBOX_HANDLE' was here
make[2]: *** [keyboxd-backend-support.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_mail_gnupg2/gnupg2/work/gnupg-2.3.2/kbx'
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_mail_gnupg2/gnupg2/work/gnupg-2.3.2'
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_mail_gnupg2/gnupg2/work/gnupg-2.3.2'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_mail_gnupg2/gnupg2/work/gnupg-2.3.2" && /usr/bin/make -j1 -w all 
Exit code: 2
Error: Failed to build gnupg2: command execution failed

Pre-compiling the C source file I get:

# 25 "backend.h" 2


struct keybox_handle;
typedef struct keybox_handle *KEYBOX_HANDLE;

.
.
.

# 30 "keybox.h" 2






typedef struct keybox_handle *KEYBOX_HANDLE;

gnupg-2.3.2/kbx/keybox.h has:

    1	/* keybox.h - Keybox operations
    2	 * Copyright (C) 2001, 2003, 2012 Free Software Foundation, Inc.
    3	 *
    4	 * This file is part of GnuPG.
    5	 *
    6	 * GnuPG is free software; you can redistribute it and/or modify
    7	 * it under the terms of the GNU General Public License as published by
    8	 * the Free Software Foundation; either version 3 of the License, or
    9	 * (at your option) any later version.
   10	 *
   11	 * GnuPG is distributed in the hope that it will be useful,
   12	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14	 * GNU General Public License for more details.
   15	 *
   16	 * You should have received a copy of the GNU General Public License
   17	 * along with this program; if not, see <https://www.gnu.org/licenses/>.
   18	 */
   19	
   20	#ifndef KEYBOX_H
   21	#define KEYBOX_H 1
   22	#ifdef __cplusplus
   23	extern "C" {
   24	#if 0
   25	 }
   26	#endif
   27	#endif
   28	
   29	#include "../common/iobuf.h"
   30	#include "keybox-search-desc.h"
   31	
   32	#ifdef KEYBOX_WITH_X509
   33	# include <ksba.h>
   34	#endif
   35	
   36	typedef struct keybox_handle *KEYBOX_HANDLE;
   37	

and gnupg-2.3.2/kbx/backend.c has:

    1	/* backend.h - Definitions for keyboxd backends
    2	 * Copyright (C) 2019 g10 Code GmbH
    3	 *
    4	 * This file is part of GnuPG.
    5	 *
    6	 * GnuPG is free software; you can redistribute it and/or modify
    7	 * it under the terms of the GNU General Public License as published by
    8	 * the Free Software Foundation; either version 3 of the License, or
    9	 * (at your option) any later version.
   10	 *
   11	 * GnuPG is distributed in the hope that it will be useful,
   12	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14	 * GNU General Public License for more details.
   15	 *
   16	 * You should have received a copy of the GNU General Public License
   17	 * along with this program; if not, see <https://www.gnu.org/licenses/>.
   18	 */
   19	
   20	#ifndef KBX_BACKEND_H
   21	#define KBX_BACKEND_H
   22	
   23	#include <ksba.h>
   24	#include "keybox-search-desc.h"
   25	
   26	/* Forward declaration of the keybox handle type.  */
   27	struct keybox_handle;
   28	typedef struct keybox_handle *KEYBOX_HANDLE;
   29	

They both are included from gnupg-2.3.2/kbx/backend-support.c

    1	/* backend-support.c - Supporting functions for the backend.
    2	 * Copyright (C) 2019 g10 Code GmbH
    3	 *
    4	 * This file is part of GnuPG.
    5	 *
    6	 * GnuPG is free software; you can redistribute it and/or modify
    7	 * it under the terms of the GNU General Public License as published by
    8	 * the Free Software Foundation; either version 3 of the License, or
    9	 * (at your option) any later version.
   10	 *
   11	 * GnuPG is distributed in the hope that it will be useful,
   12	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14	 * GNU General Public License for more details.
   15	 *
   16	 * You should have received a copy of the GNU General Public License
   17	 * along with this program; if not, see <https://www.gnu.org/licenses/>.
   18	 * SPDX-License-Identifier: GPL-3.0+
   19	 */
   20	
   21	#include <config.h>
   22	#include <stdio.h>
   23	#include <stdlib.h>
   24	#include <stddef.h>
   25	#include <string.h>
   26	
   27	#include "keyboxd.h"
   28	#include "../common/i18n.h"
   29	#include "../common/asshelp.h"
   30	#include "../common/tlv.h"
   31	#include "backend.h"
   32	#include "keybox-defs.h"
   33	

and gnupg-2.3.2/kbx/keybox-defs.h

    1	/* keybox-defs.h - internal Keybox definitions
    2	 *	Copyright (C) 2001, 2004 Free Software Foundation, Inc.
    3	 *
    4	 * This file is part of GnuPG.
    5	 *
    6	 * GnuPG is free software; you can redistribute it and/or modify
    7	 * it under the terms of the GNU General Public License as published by
    8	 * the Free Software Foundation; either version 3 of the License, or
    9	 * (at your option) any later version.
   10	 *
   11	 * GnuPG is distributed in the hope that it will be useful,
   12	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14	 * GNU General Public License for more details.
   15	 *
   16	 * You should have received a copy of the GNU General Public License
   17	 * along with this program; if not, see <https://www.gnu.org/licenses/>.
   18	 */
   19	
   20	#ifndef KEYBOX_DEFS_H
   21	#define KEYBOX_DEFS_H 1
   22	
   23	#ifdef GPG_ERR_SOURCE_DEFAULT
   24	# if GPG_ERR_SOURCE_DEFAULT != GPG_ERR_SOURCE_KEYBOX
   25	#  error GPG_ERR_SOURCE_DEFAULT already defined
   26	# endif
   27	#else
   28	# define GPG_ERR_SOURCE_DEFAULT  GPG_ERR_SOURCE_KEYBOX
   29	#endif
   30	#include <gpg-error.h>
   31	#define map_assuan_err(a) \
   32	        map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
   33	
   34	#include <sys/types.h> /* off_t */
   35	
   36	#include "../common/util.h"
   37	#include "keybox.h"
   38	

The one typedef too much can simply be omitted from keybox.h, I think…

Attachments (1)

main.log (167.3 KB) - added by ballapete (Peter "Pete" Dyballa) 3 years ago.
Main.log from PPC Tiger

Download all attachments as: .zip

Change History (10)

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

Attachment: main.log added

Main.log from PPC Tiger

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

On High Sierra the two typedefs are simply accepted by Clang!

comment:2 Changed 3 years ago by kencu (Ken)

gcc 4.8+ will take them too, as we know.

We've seen this redefinition of typedefs error 1000 times with gcc-4.2...

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

With GCC 7 this error does not happen.

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

I reported this case to the GnuPG developers: https://dev.gnupg.org/T5630.

comment:5 Changed 3 years ago by kencu (Ken)

I suggest we just blacklist gcc-4.[0-2] and move along, nothing to see here folks...

but if you can manage upstream to support gcc-4.2, that is certainly OK instead.

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

It's a C11 feature, which upstream apparently doesn't want to require since they fixed it. https://dev.gnupg.org/rGca54d3f148933baac1f0243f76e4961abca285b1

comment:7 Changed 3 years ago by jmarshallidau

I've just created a new ticket #63552 to point out that version 2.3.2 is on the TEST branch, not the STABLE branch.

I'm figuring that the 2.2.31 --> 2.3.2 upgrade of this port was unintentional and requesting that it be reverted to the STABLE branch (currently 2.2.31).

See #63552 for details.

comment:8 Changed 17 months ago by ballapete (Peter "Pete" Dyballa)

gnupg2 @2.2.40 is now installed, so this ticket can be closed.

comment:9 Changed 17 months ago by kencu (Ken)

Resolution: fixed
Status: newclosed

as requested

Note: See TracTickets for help on using tickets.