[New-bugs-announce] [issue19998] Python 2.7.6 fails to build _ctypes on GCC 2.x toolchain

Jim Carroll report at bugs.python.org
Mon Dec 16 14:34:41 CET 2013


New submission from Jim Carroll:

When building Python 2.7.6 on older GCC 2.x, the _ctypes module fails to build. The failure is caused due to a header file reference to __builtin_expect (the author expected this to be available when the module was built with gcc, but did not take into account that this was not available in all versions of gcc).

The solution is a simple modification to the test in ffi_common.h

--- Modules/_ctypes/libffi/include/ffi_common.h Sun Nov 10 02:36:41 2013
+++ Modules/_ctypes/libffi/include/ffi_common.h.fix     Mon Dec 16 08:23:56 2013
@@ -115,7 +115,7 @@

 typedef float FLOAT32;

-#ifndef __GNUC__
+#if !defined(__GNUC__) || __GNUC__==2
 #define __builtin_expect(x, expected_value) (x)
 #endif
 #define LIKELY(x)    __builtin_expect(!!(x),1)

----------
components: Build
files: ffi_common.h.patch
keywords: patch
messages: 206307
nosy: jamercee
priority: normal
severity: normal
status: open
title: Python 2.7.6 fails to build _ctypes on GCC 2.x toolchain
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file33165/ffi_common.h.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19998>
_______________________________________


More information about the New-bugs-announce mailing list