Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1046350 - libvirt-python: C modules fail to build on Mac (OS X)
Summary: libvirt-python: C modules fail to build on Mac (OS X)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Mac OS
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-24 19:21 UTC by Shanto
Modified: 2016-04-10 17:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-10 17:27:19 UTC


Attachments (Terms of Use)

Description Shanto 2013-12-24 19:21:00 UTC
Description of problem:
libvirt-python package from PyPI fails to build on OS X 10.9.

Version-Release number of selected component (if applicable):
1.2.0

How reproducible:
Installing libvirt-python from pip.

Steps to Reproduce:
1. (sudo) port install libvirt # MacPorts
2. pip install libvirt-python

Actual results:
./libvirt-utils.h:87:22: error: token is not a valid binary operator in a preprocessor subexpression
#   if __GNUC_PREREQ (3, 3)
       ~~~~~~~~~~~~~ ^
./libvirt-utils.h:99:22: error: token is not a valid binary operator in a preprocessor subexpression
#   if __GNUC_PREREQ (3, 4)
       ~~~~~~~~~~~~~ ^
2 errors generated.
error: command '/usr/bin/clang' failed with exit status 1

Expected results:
C modules in libvirt-python should compile and install properly.

Additional information:
__GNUC_PREREQ macro is not defined in OS X. Some developers use alternative method to detect GNU C version as follows:

#define __GNUC_VERSION__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
#if __GNUC_VERSION__ >= 30400
# ...features...
#endif

Comment 1 Cole Robinson 2016-04-10 17:27:19 UTC
This was fixed by:

commit c6ff569fb6a535cb625cd99d22052f756eae5b56
Author: Doug Goldstein <cardoe@cardoe.com>
Date:   Sun Dec 29 16:52:15 2013 -0600

    define __GNUC_PREREQ macro before using it
    
    We brought over use of the __GNUC_PREREQ macro from libvirt but didn't
    bring over the definition of it. This brings over the macro from libvirt
    sources.


Note You need to log in before you can comment on or make changes to this bug.