From f9258e6d7fcf34244dd3e72f93d3ef0f17533355 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 8 Dec 2016 11:29:35 +0100 Subject: [PATCH] Added patch for guarding HAVE_LONG_LONG definition in pyport.h as it is also defined by GDB, and by building GDB with python support will make GDB's compilation fail due to redefinition error. (upstream issue28898) --- ...G-definition-to-prevent-redefinition.patch | 25 +++++++++++++++++++ python3.spec | 8 ++++++ 2 files changed, 33 insertions(+) create mode 100644 00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch diff --git a/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch b/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch new file mode 100644 index 0000000..9084dd6 --- /dev/null +++ b/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch @@ -0,0 +1,25 @@ + +# HG changeset patch +# User Benjamin Peterson +# Date 1481183668 28800 +# Node ID 4745d801cae2d57e3432313acd0b76b8b4cc9c75 +# Parent 148c46d180b2a1510097a1eae79845b61190c879 +guard HAVE_LONG_LONG definition to prevent redefinition (#28898) + +diff --git a/Include/pyport.h b/Include/pyport.h +--- a/Include/pyport.h ++++ b/Include/pyport.h +@@ -37,9 +37,10 @@ Used in: Py_SAFE_DOWNCAST + * integral synonyms. Only define the ones we actually need. + */ + +-// long long is required now. Define HAVE_LONG_LONG unconditionally for +-// compatibility. ++// long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. ++#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG ++#endif + #ifndef PY_LONG_LONG + #define PY_LONG_LONG long long + /* If LLONG_MAX is defined in limits.h, use that. */ + diff --git a/python3.spec b/python3.spec index def96b6..6580d84 100644 --- a/python3.spec +++ b/python3.spec @@ -394,6 +394,13 @@ Patch243: 00243-fix-mips64-triplet.patch # Not yet fixed upstream: http://bugs.python.org/issue28787 Patch249: 00249-fix-out-of-tree-dtrace-builds.patch +# 00250 # +# Guard HAVE_LONG_LONG definition in pyport.h as gdb also sets this +# and by defining it unconditionally in python will make compilation of +# gdb to fail. +# FIXED UPSTREAM: http://bugs.python.org/issue28898 +Patch250: 00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -631,6 +638,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch243 -p1 %patch249 -p1 +%patch250 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library.